chiark / gitweb /
Remove libiptc things
[elogind.git] / Makefile.am
1 #  -*- Mode: makefile; indent-tabs-mode: t -*-
2 #
3 #  This file is part of systemd.
4 #
5 #  Copyright 2010-2012 Lennart Poettering
6 #  Copyright 2010-2012 Kay Sievers
7 #  Copyright 2013 Zbigniew Jędrzejewski-Szmek
8 #  Copyright 2013 David Strauss
9 #
10 #  systemd is free software; you can redistribute it and/or modify it
11 #  under the terms of the GNU Lesser General Public License as published by
12 #  the Free Software Foundation; either version 2.1 of the License, or
13 #  (at your option) any later version.
14 #
15 #  systemd is distributed in the hope that it will be useful, but
16 #  WITHOUT ANY WARRANTY; without even the implied warranty of
17 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 #  Lesser General Public License for more details.
19 #
20 #  You should have received a copy of the GNU Lesser General Public License
21 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
22
23 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
24 AM_MAKEFLAGS = --no-print-directory
25 AUTOMAKE_OPTIONS = color-tests parallel-tests
26
27 GCC_COLORS ?= 'ooh, shiny!'
28 export GCC_COLORS
29
30 SUBDIRS = . po
31
32 # remove targets if the command fails
33 .DELETE_ON_ERROR:
34
35 # keep intermediate files
36 .SECONDARY:
37
38 # Keep the test-suite.log
39 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
40
41 LIBUDEV_CURRENT=7
42 LIBUDEV_REVISION=2
43 LIBUDEV_AGE=6
44
45 LIBGUDEV_CURRENT=2
46 LIBGUDEV_REVISION=0
47 LIBGUDEV_AGE=2
48
49 LIBSYSTEMD_CURRENT=6
50 LIBSYSTEMD_REVISION=0
51 LIBSYSTEMD_AGE=6
52
53 # The following four libraries only exist for compatibility reasons,
54 # their version info should not be bumped anymore
55 LIBSYSTEMD_LOGIN_CURRENT=9
56 LIBSYSTEMD_LOGIN_REVISION=3
57 LIBSYSTEMD_LOGIN_AGE=9
58
59 LIBSYSTEMD_DAEMON_CURRENT=0
60 LIBSYSTEMD_DAEMON_REVISION=12
61 LIBSYSTEMD_DAEMON_AGE=0
62
63 LIBSYSTEMD_ID128_CURRENT=0
64 LIBSYSTEMD_ID128_REVISION=28
65 LIBSYSTEMD_ID128_AGE=0
66
67 LIBSYSTEMD_JOURNAL_CURRENT=11
68 LIBSYSTEMD_JOURNAL_REVISION=5
69 LIBSYSTEMD_JOURNAL_AGE=11
70
71 # Dirs of external packages
72 dbuspolicydir=@dbuspolicydir@
73 dbussessionservicedir=@dbussessionservicedir@
74 dbussystemservicedir=@dbussystemservicedir@
75 pamlibdir=@pamlibdir@
76 pamconfdir=@pamconfdir@
77 pkgconfiglibdir=$(libdir)/pkgconfig
78 polkitpolicydir=$(datadir)/polkit-1/actions
79 bashcompletiondir=@bashcompletiondir@
80 zshcompletiondir=@zshcompletiondir@
81 rpmmacrosdir=$(prefix)/lib/rpm/macros.d
82 sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
83 sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
84 varlogdir=$(localstatedir)/log
85 systemdstatedir=$(localstatedir)/lib/systemd
86 catalogstatedir=$(systemdstatedir)/catalog
87 xinitrcdir=$(sysconfdir)/X11/xinit/xinitrc.d
88
89 # Our own, non-special dirs
90 pkgsysconfdir=$(sysconfdir)/systemd
91 userunitdir=$(prefix)/lib/systemd/user
92 userpresetdir=$(prefix)/lib/systemd/user-preset
93 tmpfilesdir=$(prefix)/lib/tmpfiles.d
94 sysusersdir=$(prefix)/lib/sysusers.d
95 sysctldir=$(prefix)/lib/sysctl.d
96 binfmtdir=$(prefix)/lib/binfmt.d
97 modulesloaddir=$(prefix)/lib/modules-load.d
98 networkdir=$(rootprefix)/lib/systemd/network
99 pkgincludedir=$(includedir)/systemd
100 systemgeneratordir=$(rootlibexecdir)/system-generators
101 usergeneratordir=$(prefix)/lib/systemd/user-generators
102 systemshutdowndir=$(rootlibexecdir)/system-shutdown
103 systemsleepdir=$(rootlibexecdir)/system-sleep
104 systemunitdir=$(rootprefix)/lib/systemd/system
105 systempresetdir=$(rootprefix)/lib/systemd/system-preset
106 udevlibexecdir=$(rootprefix)/lib/udev
107 udevhomedir=$(udevlibexecdir)
108 udevrulesdir=$(udevlibexecdir)/rules.d
109 udevhwdbdir=$(udevlibexecdir)/hwdb.d
110 catalogdir=$(prefix)/lib/systemd/catalog
111 kernelinstalldir = $(prefix)/lib/kernel/install.d
112 factory_etcdir = $(prefix)/share/factory/etc
113 factory_pamdir = $(prefix)/share/factory/etc/pam.d
114 bootlibdir = $(prefix)/lib/systemd/boot/efi
115
116 # And these are the special ones for /
117 rootprefix=@rootprefix@
118 rootbindir=$(rootprefix)/bin
119 rootlibexecdir=$(rootprefix)/lib/systemd
120
121 EXTRA_DIST =
122 BUILT_SOURCES =
123 INSTALL_EXEC_HOOKS =
124 UNINSTALL_EXEC_HOOKS =
125 INSTALL_DATA_HOOKS =
126 UNINSTALL_DATA_HOOKS =
127 DISTCLEAN_LOCAL_HOOKS =
128 CLEAN_LOCAL_HOOKS =
129 pkginclude_HEADERS =
130 noinst_LTLIBRARIES =
131 lib_LTLIBRARIES =
132 include_HEADERS =
133 noinst_DATA =
134 pkgconfiglib_DATA =
135 polkitpolicy_in_in_files =
136 polkitpolicy_in_files =
137 polkitpolicy_files =
138 dist_udevrules_DATA =
139 nodist_udevrules_DATA =
140 dist_pkgsysconf_DATA =
141 nodist_pkgsysconf_DATA =
142 dist_pkgdata_DATA =
143 dist_dbuspolicy_DATA =
144 dist_dbussystemservice_DATA =
145 dist_systemunit_DATA_busnames =
146 dist_sysusers_DATA =
147 check_PROGRAMS =
148 check_DATA =
149 tests=
150 manual_tests =
151 TEST_EXTENSIONS = .py
152 PY_LOG_COMPILER = $(PYTHON)
153 if ENABLE_TESTS
154 noinst_PROGRAMS = $(manual_tests) $(tests)
155 TESTS = $(tests)
156 else
157 noinst_PROGRAMS =
158 TESTS =
159 endif
160 udevlibexec_PROGRAMS =
161
162 in_files = $(filter %.in,$(EXTRA_DIST))
163 in_in_files = $(filter %.in.in, $(in_files))
164 m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
165
166 CLEANFILES = $(BUILT_SOURCES) \
167         $(pkgconfiglib_DATA) \
168         $(in_files:.in=) $(in_in_files:.in.in=) \
169         $(m4_files:.m4=)
170
171 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
172         $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
173         $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
174
175 AM_CPPFLAGS = \
176         -include $(top_builddir)/config.h \
177         -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
178         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
179         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
180         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
181         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
182         -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
183         -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
184         -DCERTIFICATE_ROOT=\"$(CERTIFICATEROOT)\" \
185         -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
186         -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
187         -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
188         -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
189         -DSYSTEMD_SLEEP_BINARY_PATH=\"$(rootlibexecdir)/systemd-sleep\" \
190         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
191         -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(rootbindir)/systemd-tty-ask-password-agent\" \
192         -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
193         -DROOTPREFIX=\"$(rootprefix)\" \
194         -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\" \
195         -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\" \
196         -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
197         -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
198         -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
199         -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
200         -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
201         -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
202         -DSYSTEMD_LANGUAGE_FALLBACK_MAP=\"$(pkgdatadir)/language-fallback-map\" \
203         -DX_SERVER=\"$(bindir)/X\" \
204         -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
205         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
206         -DQUOTACHECK=\"$(QUOTACHECK)\" \
207         -DKEXEC=\"$(KEXEC)\" \
208         -DLIBDIR=\"$(libdir)\" \
209         -DROOTLIBDIR=\"$(rootlibdir)\" \
210         -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
211         -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
212         -I $(top_srcdir)/src \
213         -I $(top_builddir)/src/shared \
214         -I $(top_srcdir)/src/shared \
215         -I $(top_srcdir)/src/network \
216         -I $(top_srcdir)/src/login \
217         -I $(top_srcdir)/src/journal \
218         -I $(top_srcdir)/src/timedate \
219         -I $(top_srcdir)/src/timesync \
220         -I $(top_srcdir)/src/resolve \
221         -I $(top_builddir)/src/resolve \
222         -I $(top_srcdir)/src/systemd \
223         -I $(top_builddir)/src/core \
224         -I $(top_srcdir)/src/core \
225         -I $(top_srcdir)/src/libudev \
226         -I $(top_srcdir)/src/udev \
227         -I $(top_srcdir)/src/udev/net \
228         -I $(top_builddir)/src/udev \
229         -I $(top_srcdir)/src/libsystemd/sd-bus \
230         -I $(top_srcdir)/src/libsystemd/sd-event \
231         -I $(top_srcdir)/src/libsystemd/sd-rtnl \
232         -I $(top_srcdir)/src/libsystemd/sd-network \
233         -I $(top_srcdir)/src/libsystemd/sd-hwdb \
234         -I $(top_srcdir)/src/libsystemd/sd-device \
235         -I $(top_srcdir)/src/libsystemd-network \
236         -I $(top_srcdir)/src/libsystemd-terminal \
237         $(OUR_CPPFLAGS)
238
239 AM_CFLAGS = $(OUR_CFLAGS)
240 AM_LDFLAGS = $(OUR_LDFLAGS)
241
242 # ------------------------------------------------------------------------------
243 define move-to-rootlibdir
244         if test "$(libdir)" != "$(rootlibdir)"; then \
245                 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
246                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
247                 rm -f $(DESTDIR)$(libdir)/$$libname && \
248                 $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
249                 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
250         fi
251 endef
252
253 INSTALL_DIRS =
254
255 SHUTDOWN_TARGET_WANTS =
256 LOCAL_FS_TARGET_WANTS =
257 MULTI_USER_TARGET_WANTS =
258 GRAPHICAL_TARGET_WANTS =
259 RESCUE_TARGET_WANTS =
260 SYSINIT_TARGET_WANTS =
261 SOCKETS_TARGET_WANTS =
262 BUSNAMES_TARGET_WANTS =
263 TIMERS_TARGET_WANTS =
264 USER_SOCKETS_TARGET_WANTS =
265 USER_DEFAULT_TARGET_WANTS =
266 USER_BUSNAMES_TARGET_WANTS =
267
268 SYSTEM_UNIT_ALIASES =
269 USER_UNIT_ALIASES =
270 GENERAL_ALIASES =
271
272 install-target-wants-hook:
273         what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && dir=$(systemunitdir) && $(add-wants)
274         what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && dir=$(systemunitdir) && $(add-wants)
275         what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
276         what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && dir=$(systemunitdir) && $(add-wants)
277         what="$(RESCUE_TARGET_WANTS)" && wants=rescue.target && dir=$(systemunitdir) && $(add-wants)
278         what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && dir=$(systemunitdir) && $(add-wants)
279         what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(systemunitdir) && $(add-wants)
280         what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && dir=$(systemunitdir) && $(add-wants)
281         what="$(SLICES_TARGET_WANTS)" && wants=slices.target && dir=$(systemunitdir) && $(add-wants)
282         what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
283         what="$(USER_DEFAULT_TARGET_WANTS)" && wants=default.target && dir=$(userunitdir) && $(add-wants)
284
285 install-busnames-target-wants-hook:
286         what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
287         what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
288
289 define add-wants
290         [ -z "$$what" ] || ( \
291           dir=$(DESTDIR)$$dir/$$wants.wants && \
292           $(MKDIR_P) -m 0755 $$dir && \
293           cd $$dir && \
294           rm -f $$what && \
295           for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
296 endef
297
298 install-directories-hook:
299         $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
300
301 install-aliases-hook:
302         set -- $(SYSTEM_UNIT_ALIASES) && \
303                 dir=$(systemunitdir) && $(install-aliases)
304         set -- $(USER_UNIT_ALIASES) && \
305                 dir=$(userunitdir) && $(install-relative-aliases)
306         set -- $(GENERAL_ALIASES) && \
307                 dir= && $(install-relative-aliases)
308
309 define install-aliases
310         while [ -n "$$1" ]; do \
311                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
312                 rm -f $(DESTDIR)$$dir/$$2 && \
313                 $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
314                 shift 2 || exit $$?; \
315         done
316 endef
317
318 define install-relative-aliases
319         while [ -n "$$1" ]; do \
320                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
321                 rm -f $(DESTDIR)$$dir/$$2 && \
322                 $(LN_S) --relative $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
323                 shift 2 || exit $$?; \
324         done
325 endef
326
327 install-touch-usr-hook:
328         touch -c $(DESTDIR)/$(prefix)
329
330 INSTALL_EXEC_HOOKS += \
331         install-target-wants-hook \
332         install-directories-hook \
333         install-aliases-hook \
334         install-touch-usr-hook
335
336 if ENABLE_KDBUS
337 INSTALL_EXEC_HOOKS += \
338         install-busnames-target-wants-hook
339 endif
340
341 # ------------------------------------------------------------------------------
342 AM_V_M4 = $(AM_V_M4_$(V))
343 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
344 AM_V_M4_0 = @echo "  M4      " $@;
345
346 AM_V_XSLT = $(AM_V_XSLT_$(V))
347 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
348 AM_V_XSLT_0 = @echo "  XSLT    " $@;
349
350 AM_V_GPERF = $(AM_V_GPERF_$(V))
351 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
352 AM_V_GPERF_0 = @echo "  GPERF   " $@;
353
354 AM_V_LN = $(AM_V_LN_$(V))
355 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
356 AM_V_LN_0 = @echo "  LN      " $@;
357
358 AM_V_RM = $(AM_V_RM_$(V))
359 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
360 AM_V_RM_0 = @echo "  RM      " $@;
361
362 # ------------------------------------------------------------------------------
363 rootbin_PROGRAMS = \
364         systemctl \
365         systemd-notify \
366         systemd-ask-password \
367         systemd-tty-ask-password-agent \
368         systemd-machine-id-setup \
369         systemd-escape
370
371 bin_PROGRAMS = \
372         systemd-cgls \
373         systemd-cgtop \
374         systemd-nspawn \
375         systemd-detect-virt \
376         systemd-delta \
377         systemd-analyze \
378         systemd-run \
379         systemd-stdio-bridge \
380         systemd-path
381
382 dist_bin_SCRIPTS = \
383         src/kernel-install/kernel-install
384
385 dist_kernelinstall_SCRIPTS = \
386         src/kernel-install/50-depmod.install \
387         src/kernel-install/90-loaderentry.install
388
389 rootlibexec_PROGRAMS = \
390         systemd \
391         systemd-cgroups-agent \
392         systemd-initctl \
393         systemd-shutdownd \
394         systemd-shutdown \
395         systemd-remount-fs \
396         systemd-reply-password \
397         systemd-fsck \
398         systemd-fsckd \
399         systemd-machine-id-commit \
400         systemd-ac-power \
401         systemd-sysctl \
402         systemd-sleep \
403         systemd-bus-proxyd \
404         systemd-socket-proxyd \
405         systemd-update-done
406
407 systemgenerator_PROGRAMS = \
408         systemd-getty-generator \
409         systemd-fstab-generator \
410         systemd-system-update-generator \
411         systemd-debug-generator
412
413 dist_bashcompletion_DATA = \
414         shell-completion/bash/busctl \
415         shell-completion/bash/journalctl \
416         shell-completion/bash/systemd-analyze \
417         shell-completion/bash/systemd-cat \
418         shell-completion/bash/systemd-cgls \
419         shell-completion/bash/systemd-cgtop \
420         shell-completion/bash/systemd-delta \
421         shell-completion/bash/systemd-detect-virt \
422         shell-completion/bash/systemd-nspawn \
423         shell-completion/bash/systemd-run \
424         shell-completion/bash/udevadm \
425         shell-completion/bash/kernel-install
426
427 nodist_bashcompletion_DATA = \
428         shell-completion/bash/systemctl
429
430 dist_zshcompletion_DATA = \
431         shell-completion/zsh/_journalctl \
432         shell-completion/zsh/_udevadm \
433         shell-completion/zsh/_kernel-install \
434         shell-completion/zsh/_systemd-nspawn \
435         shell-completion/zsh/_systemd-analyze \
436         shell-completion/zsh/_systemd-run \
437         shell-completion/zsh/_sd_hosts_or_user_at_host \
438         shell-completion/zsh/_sd_outputmodes \
439         shell-completion/zsh/_sd_unit_files \
440         shell-completion/zsh/_systemd-delta \
441         shell-completion/zsh/_systemd
442
443 nodist_zshcompletion_DATA = \
444         shell-completion/zsh/_systemctl
445
446 EXTRA_DIST += \
447         shell-completion/bash/systemctl.in \
448         shell-completion/zsh/_systemctl.in
449
450 CLEANFILES += \
451         $(nodist_bashcompletion_DATA) \
452         $(nodist_zshcompletion_DATA)
453
454 dist_sysctl_DATA = \
455         sysctl.d/50-default.conf
456
457 dist_systemunit_DATA = \
458         units/graphical.target \
459         units/multi-user.target \
460         units/emergency.target \
461         units/sysinit.target \
462         units/basic.target \
463         units/getty.target \
464         units/halt.target \
465         units/kexec.target \
466         units/local-fs.target \
467         units/local-fs-pre.target \
468         units/initrd.target \
469         units/initrd-fs.target \
470         units/initrd-root-fs.target \
471         units/remote-fs.target \
472         units/remote-fs-pre.target \
473         units/network.target \
474         units/network-pre.target \
475         units/network-online.target \
476         units/nss-lookup.target \
477         units/nss-user-lookup.target \
478         units/poweroff.target \
479         units/reboot.target \
480         units/rescue.target \
481         units/rpcbind.target \
482         units/time-sync.target \
483         units/shutdown.target \
484         units/final.target \
485         units/umount.target \
486         units/sigpwr.target \
487         units/sleep.target \
488         units/sockets.target \
489         units/timers.target \
490         units/paths.target \
491         units/suspend.target \
492         units/swap.target \
493         units/slices.target \
494         units/system.slice \
495         units/x-.slice \
496         units/systemd-fsckd.socket \
497         units/systemd-initctl.socket \
498         units/systemd-shutdownd.socket \
499         units/syslog.socket \
500         units/dev-hugepages.mount \
501         units/dev-mqueue.mount \
502         units/sys-kernel-config.mount \
503         units/sys-kernel-debug.mount \
504         units/sys-fs-fuse-connections.mount \
505         units/tmp.mount \
506         units/var-lib-machines.mount \
507         units/printer.target \
508         units/sound.target \
509         units/bluetooth.target \
510         units/smartcard.target \
511         units/systemd-ask-password-wall.path \
512         units/systemd-ask-password-console.path \
513         units/systemd-udevd-control.socket \
514         units/systemd-udevd-kernel.socket \
515         units/system-update.target \
516         units/initrd-switch-root.target \
517         units/machines.target
518
519 if ENABLE_KDBUS
520 dist_systemunit_DATA += \
521         $(dist_systemunit_DATA_busnames)
522 endif
523
524 dist_systemunit_DATA_busnames += \
525         units/busnames.target
526
527 nodist_systemunit_DATA = \
528         units/getty@.service \
529         units/serial-getty@.service \
530         units/console-shell.service \
531         units/console-getty.service \
532         units/container-getty@.service \
533         units/systemd-initctl.service \
534         units/systemd-shutdownd.service \
535         units/systemd-remount-fs.service \
536         units/systemd-ask-password-wall.service \
537         units/systemd-ask-password-console.service \
538         units/systemd-sysctl.service \
539         units/emergency.service \
540         units/rescue.service \
541         units/user@.service \
542         units/systemd-suspend.service \
543         units/systemd-halt.service \
544         units/systemd-poweroff.service \
545         units/systemd-reboot.service \
546         units/systemd-kexec.service \
547         units/systemd-fsck@.service \
548         units/systemd-fsck-root.service \
549         units/systemd-fsckd.service \
550         units/systemd-machine-id-commit.service \
551         units/systemd-udevd.service \
552         units/systemd-udev-trigger.service \
553         units/systemd-udev-settle.service \
554         units/systemd-hwdb-update.service \
555         units/debug-shell.service \
556         units/initrd-parse-etc.service \
557         units/initrd-cleanup.service \
558         units/initrd-udevadm-cleanup-db.service \
559         units/initrd-switch-root.service \
560         units/systemd-nspawn@.service \
561         units/systemd-update-done.service
562
563 dist_userunit_DATA = \
564         units/user/basic.target \
565         units/user/default.target \
566         units/user/exit.target
567
568 nodist_userunit_DATA = \
569         units/user/systemd-exit.service
570
571 dist_systempreset_DATA = \
572         system-preset/90-systemd.preset
573
574 EXTRA_DIST += \
575         units/getty@.service.m4 \
576         units/serial-getty@.service.m4 \
577         units/console-shell.service.m4.in \
578         units/console-getty.service.m4.in \
579         units/container-getty@.service.m4.in \
580         units/rescue.service.in \
581         units/systemd-initctl.service.in \
582         units/systemd-shutdownd.service.in \
583         units/systemd-remount-fs.service.in \
584         units/systemd-ask-password-wall.service.in \
585         units/systemd-ask-password-console.service.in \
586         units/systemd-sysctl.service.in \
587         units/emergency.service.in \
588         units/systemd-halt.service.in \
589         units/systemd-poweroff.service.in \
590         units/systemd-reboot.service.in \
591         units/systemd-kexec.service.in \
592         units/user/systemd-exit.service.in \
593         units/systemd-fsck@.service.in \
594         units/systemd-fsck-root.service.in \
595         units/systemd-fsckd.service.in \
596         units/systemd-machine-id-commit.service.in \
597         units/user@.service.m4.in \
598         units/debug-shell.service.in \
599         units/systemd-suspend.service.in \
600         units/quotaon.service.in \
601         units/initrd-parse-etc.service.in \
602         units/initrd-cleanup.service.in \
603         units/initrd-udevadm-cleanup-db.service.in \
604         units/initrd-switch-root.service.in \
605         units/systemd-nspawn@.service.in \
606         units/systemd-update-done.service.in
607
608 EXTRA_DIST += \
609         units/rc-local.service.in \
610         units/halt-local.service.in
611
612 # automake is broken and can't handle files with a dash in front
613 # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14728#8
614 units-install-hook:
615         mv $(DESTDIR)$(systemunitdir)/x-.slice $(DESTDIR)/$(systemunitdir)/-.slice
616
617 units-uninstall-hook:
618         rm -f $(DESTDIR)/$(systemunitdir)/-.slice
619
620 INSTALL_DATA_HOOKS += units-install-hook
621 UNINSTALL_DATA_HOOKS += units-uninstall-hook
622
623 dist_doc_DATA = \
624         README \
625         NEWS \
626         LICENSE.LGPL2.1 \
627         LICENSE.GPL2 \
628         LICENSE.MIT \
629         DISTRO_PORTING \
630         src/libsystemd/sd-bus/PORTING-DBUS1 \
631         src/libsystemd/sd-bus/DIFFERENCES \
632         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
633
634 @INTLTOOL_POLICY_RULE@
635
636 # ------------------------------------------------------------------------------
637
638 MANPAGES =
639 MANPAGES_ALIAS =
640
641 include Makefile-man.am
642
643 .PHONY: man update-man-list
644 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
645
646 XML_FILES = \
647         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
648 HTML_FILES = \
649         ${XML_FILES:.xml=.html}
650 HTML_ALIAS = \
651         ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
652
653 if ENABLE_MANPAGES
654 man_MANS = \
655         $(MANPAGES) \
656         $(MANPAGES_ALIAS)
657
658 noinst_DATA += \
659         $(HTML_FILES) \
660         $(HTML_ALIAS)
661
662 CLEANFILES += \
663         $(man_MANS) \
664         $(HTML_FILES) \
665         $(HTML_ALIAS)
666
667 docs/html/man:
668         $(AM_V_at)$(MKDIR_P) $(dir $@)
669         $(AM_V_LN)$(LN_S) -f ../../man $@
670
671 noinst_DATA += \
672         docs/html/man
673
674 CLEANFILES += \
675         docs/html/man
676
677 if HAVE_PYTHON
678 man/index.html: man/systemd.index.html
679         $(AM_V_LN)$(LN_S) -f systemd.index.html $@
680
681 noinst_DATA += \
682         man/index.html
683
684 CLEANFILES += \
685         man/index.html
686
687 XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml)
688 NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
689 SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))
690
691 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB)
692         $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
693         $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
694         @echo "Makefile-man.am has been regenerated"
695
696 man/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
697         $(AM_V_at)$(MKDIR_P) $(dir $@)
698         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
699
700 man/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py $(SOURCE_XML_FILES)
701         $(AM_V_at)$(MKDIR_P) $(dir $@)
702         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
703
704 EXTRA_DIST += \
705         man/systemd.index.xml \
706         man/index.html \
707         man/systemd.directives.xml \
708         man/glib-event-glue.c
709
710 CLEANFILES += \
711         man/systemd.index.xml \
712         man/systemd.directives.xml
713
714 endif
715
716 endif
717
718 EXTRA_DIST += \
719         $(XML_FILES) \
720         $(HTML_FILES) \
721         $(HTML_ALIAS) \
722         $(man_MANS) \
723         tools/make-man-index.py \
724         tools/make-directive-index.py \
725         tools/xml_helper.py
726
727 # ------------------------------------------------------------------------------
728 noinst_LTLIBRARIES += \
729         libsystemd-shared.la
730
731 libsystemd_shared_la_SOURCES = \
732         src/shared/capability.c \
733         src/shared/capability.h \
734         src/shared/linux/auto_dev-ioctl.h \
735         src/shared/ioprio.h \
736         src/shared/missing.h \
737         src/shared/initreq.h \
738         src/shared/securebits.h \
739         src/shared/special.h \
740         src/shared/list.h \
741         src/shared/unaligned.h \
742         src/shared/macro.h \
743         src/shared/def.h \
744         src/shared/sparse-endian.h \
745         src/shared/refcnt.h \
746         src/shared/udev-util.h \
747         src/shared/device-nodes.c \
748         src/shared/device-nodes.h \
749         src/shared/util.c \
750         src/shared/util.h \
751         src/shared/virt.c \
752         src/shared/virt.h \
753         src/shared/architecture.c \
754         src/shared/architecture.h \
755         src/shared/efivars.c \
756         src/shared/efivars.h \
757         src/shared/fstab-util.c \
758         src/shared/fstab-util.h \
759         src/shared/path-util.c \
760         src/shared/path-util.h \
761         src/shared/time-util.c \
762         src/shared/time-util.h \
763         src/shared/locale-util.c \
764         src/shared/locale-util.h \
765         src/shared/mempool.c \
766         src/shared/mempool.h \
767         src/shared/hashmap.c \
768         src/shared/hashmap.h \
769         src/shared/siphash24.c \
770         src/shared/siphash24.h \
771         src/shared/set.h \
772         src/shared/fdset.c \
773         src/shared/fdset.h \
774         src/shared/prioq.c \
775         src/shared/prioq.h \
776         src/shared/sleep-config.c \
777         src/shared/sleep-config.h \
778         src/shared/strv.c \
779         src/shared/strv.h \
780         src/shared/env-util.c \
781         src/shared/env-util.h \
782         src/shared/strbuf.c \
783         src/shared/strbuf.h \
784         src/shared/strxcpyx.c \
785         src/shared/strxcpyx.h \
786         src/shared/conf-parser.c \
787         src/shared/conf-parser.h \
788         src/shared/log.c \
789         src/shared/log.h \
790         src/shared/ratelimit.h \
791         src/shared/ratelimit.c \
792         src/shared/exit-status.c \
793         src/shared/exit-status.h \
794         src/shared/utf8.c \
795         src/shared/utf8.h \
796         src/shared/gunicode.c \
797         src/shared/gunicode.h \
798         src/shared/pager.c \
799         src/shared/pager.h \
800         src/shared/socket-util.c \
801         src/shared/socket-util.h \
802         src/shared/in-addr-util.c \
803         src/shared/in-addr-util.h \
804         src/shared/ether-addr-util.h \
805         src/shared/conf-files.c \
806         src/shared/conf-files.h \
807         src/shared/cgroup-util.c \
808         src/shared/cgroup-util.h \
809         src/shared/cgroup-show.c \
810         src/shared/cgroup-show.h \
811         src/shared/unit-name.c \
812         src/shared/unit-name.h \
813         src/shared/watchdog.c \
814         src/shared/watchdog.h \
815         src/shared/spawn-ask-password-agent.c \
816         src/shared/spawn-ask-password-agent.h \
817         src/shared/replace-var.c \
818         src/shared/replace-var.h \
819         src/shared/spawn-polkit-agent.c \
820         src/shared/spawn-polkit-agent.h \
821         src/shared/clock-util.c \
822         src/shared/clock-util.h \
823         src/shared/calendarspec.c \
824         src/shared/calendarspec.h \
825         src/shared/fileio.c \
826         src/shared/fileio.h \
827         src/shared/output-mode.h \
828         src/shared/MurmurHash2.c \
829         src/shared/MurmurHash2.h \
830         src/shared/acpi-fpdt.h \
831         src/shared/acpi-fpdt.c \
832         src/shared/boot-timestamps.h \
833         src/shared/boot-timestamps.c \
834         src/shared/mkdir.c \
835         src/shared/mkdir.h \
836         src/shared/smack-util.c \
837         src/shared/smack-util.h \
838         src/shared/apparmor-util.c \
839         src/shared/apparmor-util.h \
840         src/shared/ima-util.c \
841         src/shared/ima-util.h \
842         src/shared/ptyfwd.c \
843         src/shared/ptyfwd.h \
844         src/shared/errno-list.c \
845         src/shared/errno-list.h \
846         src/shared/af-list.c \
847         src/shared/af-list.h \
848         src/shared/arphrd-list.c \
849         src/shared/arphrd-list.h \
850         src/shared/cap-list.c \
851         src/shared/cap-list.h \
852         src/shared/audit.c \
853         src/shared/audit.h \
854         src/shared/xml.c \
855         src/shared/xml.h \
856         src/shared/json.c \
857         src/shared/json.h \
858         src/shared/bus-label.c \
859         src/shared/bus-label.h \
860         src/shared/gpt.h \
861         src/shared/clean-ipc.h \
862         src/shared/clean-ipc.c \
863         src/shared/login-shared.c \
864         src/shared/login-shared.h \
865         src/shared/ring.c \
866         src/shared/ring.h \
867         src/shared/barrier.c \
868         src/shared/barrier.h \
869         src/shared/pty.c \
870         src/shared/pty.h \
871         src/shared/async.c \
872         src/shared/async.h \
873         src/shared/base-filesystem.c \
874         src/shared/base-filesystem.h \
875         src/shared/memfd-util.c \
876         src/shared/memfd-util.h \
877         src/shared/uid-range.c \
878         src/shared/uid-range.h \
879         src/shared/nss-util.h \
880         src/shared/verbs.c \
881         src/shared/verbs.h \
882         src/shared/sigbus.c \
883         src/shared/sigbus.h \
884         src/shared/build.h \
885         src/shared/import-util.c \
886         src/shared/import-util.h \
887         src/shared/sysctl-util.c \
888         src/shared/sysctl-util.h
889
890 nodist_libsystemd_shared_la_SOURCES = \
891         src/shared/errno-from-name.h \
892         src/shared/errno-to-name.h \
893         src/shared/af-from-name.h \
894         src/shared/af-to-name.h \
895         src/shared/arphrd-from-name.h \
896         src/shared/arphrd-to-name.h \
897         src/shared/cap-from-name.h \
898         src/shared/cap-to-name.h
899
900 libsystemd_shared_la_CFLAGS = \
901         $(AM_CFLAGS) \
902         $(CAP_CFLAGS) \
903         $(SECCOMP_CFLAGS) \
904         -pthread
905
906 libsystemd_shared_la_LIBADD = \
907         $(CAP_LIBS) \
908         -lm
909
910 # ------------------------------------------------------------------------------
911 noinst_LTLIBRARIES += \
912         libsystemd-units.la
913
914 libsystemd_units_la_SOURCES = \
915         src/shared/install.c \
916         src/shared/install.h \
917         src/shared/install-printf.c \
918         src/shared/install-printf.h \
919         src/shared/path-lookup.c \
920         src/shared/path-lookup.h \
921         src/shared/specifier.c \
922         src/shared/specifier.h
923
924 # ------------------------------------------------------------------------------
925 noinst_LTLIBRARIES += \
926         libsystemd-label.la
927
928 libsystemd_label_la_SOURCES = \
929         src/shared/socket-label.c \
930         src/shared/label.c \
931         src/shared/label.h \
932         src/shared/selinux-util.c \
933         src/shared/selinux-util.h \
934         src/shared/mkdir-label.c \
935         src/shared/ask-password-api.c \
936         src/shared/ask-password-api.h \
937         src/shared/switch-root.h \
938         src/shared/switch-root.c \
939         src/shared/fileio-label.c \
940         src/shared/fileio-label.h \
941         src/shared/dev-setup.c \
942         src/shared/dev-setup.h \
943         src/shared/dropin.c \
944         src/shared/dropin.h \
945         src/shared/condition.c \
946         src/shared/condition.h \
947         src/shared/generator.h \
948         src/shared/generator.c \
949         src/shared/btrfs-util.c \
950         src/shared/btrfs-util.h \
951         src/shared/btrfs-ctree.h \
952         src/shared/machine-image.c \
953         src/shared/machine-image.h \
954         src/shared/machine-pool.c \
955         src/shared/machine-pool.h \
956         src/shared/copy.c \
957         src/shared/copy.h
958
959 libsystemd_label_la_CFLAGS = \
960         $(AM_CFLAGS) \
961         $(SELINUX_CFLAGS)
962
963 libsystemd_label_la_LIBADD = \
964         $(SELINUX_LIBS)
965
966 # -----------------------------------------------------------------------------
967
968 if ENABLE_LDCONFIG
969 dist_systemunit_DATA += \
970         units/ldconfig.service
971
972 SYSINIT_TARGET_WANTS += \
973         ldconfig.service
974 endif
975
976 # ------------------------------------------------------------------------------
977
978 if HAVE_SECCOMP
979 noinst_LTLIBRARIES += \
980         libsystemd-seccomp.la
981
982 libsystemd_seccomp_la_SOURCES = \
983         src/shared/seccomp-util.h \
984         src/shared/seccomp-util.c
985
986 libsystemd_seccomp_la_CFLAGS = \
987         $(AM_CFLAGS) \
988         $(SECCOMP_CFLAGS)
989
990 libsystemd_seccomp_la_LIBADD = \
991         $(SECCOMP_LIBS)
992 endif
993
994 # ------------------------------------------------------------------------------
995 noinst_LTLIBRARIES += \
996         libsystemd-logs.la
997
998 libsystemd_logs_la_SOURCES = \
999         src/shared/logs-show.c \
1000         src/shared/logs-show.h
1001
1002 # ------------------------------------------------------------------------------
1003 if HAVE_ACL
1004 noinst_LTLIBRARIES += \
1005         libsystemd-acl.la
1006
1007 libsystemd_acl_la_SOURCES = \
1008         src/shared/acl-util.c \
1009         src/shared/acl-util.h
1010
1011 libsystemd_acl_la_CFLAGS = \
1012         $(AM_CFLAGS) \
1013         $(ACL_CFLAGS)
1014
1015 libsystemd_acl_la_LIBADD = \
1016         $(ACL_LIBS)
1017 endif
1018
1019 # ------------------------------------------------------------------------------
1020 noinst_LTLIBRARIES += \
1021         libsystemd-core.la
1022
1023 libsystemd_core_la_SOURCES = \
1024         src/core/unit.c \
1025         src/core/unit.h \
1026         src/core/unit-printf.c \
1027         src/core/unit-printf.h \
1028         src/core/job.c \
1029         src/core/job.h \
1030         src/core/manager.c \
1031         src/core/manager.h \
1032         src/core/transaction.c \
1033         src/core/transaction.h \
1034         src/core/load-fragment.c \
1035         src/core/load-fragment.h \
1036         src/core/service.c \
1037         src/core/service.h \
1038         src/core/socket.c \
1039         src/core/socket.h \
1040         src/core/busname.c \
1041         src/core/busname.h \
1042         src/core/bus-endpoint.c \
1043         src/core/bus-endpoint.h \
1044         src/core/bus-policy.c \
1045         src/core/bus-policy.h \
1046         src/core/target.c \
1047         src/core/target.h \
1048         src/core/snapshot.c \
1049         src/core/snapshot.h \
1050         src/core/device.c \
1051         src/core/device.h \
1052         src/core/mount.c \
1053         src/core/mount.h \
1054         src/core/automount.c \
1055         src/core/automount.h \
1056         src/core/swap.c \
1057         src/core/swap.h \
1058         src/core/timer.c \
1059         src/core/timer.h \
1060         src/core/path.c \
1061         src/core/path.h \
1062         src/core/slice.c \
1063         src/core/slice.h \
1064         src/core/scope.c \
1065         src/core/scope.h \
1066         src/core/load-dropin.c \
1067         src/core/load-dropin.h \
1068         src/core/execute.c \
1069         src/core/execute.h \
1070         src/core/kill.c \
1071         src/core/kill.h \
1072         src/core/dbus.c \
1073         src/core/dbus.h \
1074         src/core/dbus-manager.c \
1075         src/core/dbus-manager.h \
1076         src/core/dbus-unit.c \
1077         src/core/dbus-unit.h \
1078         src/core/dbus-job.c \
1079         src/core/dbus-job.h \
1080         src/core/dbus-service.c \
1081         src/core/dbus-service.h \
1082         src/core/dbus-socket.c \
1083         src/core/dbus-socket.h \
1084         src/core/dbus-busname.c \
1085         src/core/dbus-busname.h \
1086         src/core/dbus-target.c \
1087         src/core/dbus-target.h \
1088         src/core/dbus-snapshot.c \
1089         src/core/dbus-snapshot.h \
1090         src/core/dbus-device.c \
1091         src/core/dbus-device.h \
1092         src/core/dbus-mount.c \
1093         src/core/dbus-mount.h \
1094         src/core/dbus-automount.c \
1095         src/core/dbus-automount.h \
1096         src/core/dbus-swap.c \
1097         src/core/dbus-swap.h \
1098         src/core/dbus-timer.c \
1099         src/core/dbus-timer.h \
1100         src/core/dbus-path.c \
1101         src/core/dbus-path.h \
1102         src/core/dbus-slice.c \
1103         src/core/dbus-slice.h \
1104         src/core/dbus-scope.c \
1105         src/core/dbus-scope.h \
1106         src/core/dbus-execute.c \
1107         src/core/dbus-execute.h \
1108         src/core/dbus-kill.c \
1109         src/core/dbus-kill.h \
1110         src/core/dbus-cgroup.c \
1111         src/core/dbus-cgroup.h \
1112         src/core/cgroup.c \
1113         src/core/cgroup.h \
1114         src/core/selinux-access.c \
1115         src/core/selinux-access.h \
1116         src/core/selinux-setup.c \
1117         src/core/selinux-setup.h \
1118         src/core/smack-setup.c \
1119         src/core/smack-setup.h \
1120         src/core/ima-setup.c \
1121         src/core/ima-setup.h \
1122         src/core/locale-setup.h \
1123         src/core/locale-setup.c \
1124         src/core/hostname-setup.c \
1125         src/core/hostname-setup.h \
1126         src/core/machine-id-setup.c \
1127         src/core/machine-id-setup.h \
1128         src/core/mount-setup.c \
1129         src/core/mount-setup.h \
1130         src/core/kmod-setup.c \
1131         src/core/kmod-setup.h \
1132         src/core/loopback-setup.h \
1133         src/core/loopback-setup.c \
1134         src/core/namespace.c \
1135         src/core/namespace.h \
1136         src/core/killall.h \
1137         src/core/killall.c \
1138         src/core/audit-fd.c \
1139         src/core/audit-fd.h \
1140         src/core/show-status.c \
1141         src/core/show-status.h \
1142         src/core/failure-action.c \
1143         src/core/failure-action.h
1144
1145 nodist_libsystemd_core_la_SOURCES = \
1146         src/core/load-fragment-gperf.c \
1147         src/core/load-fragment-gperf-nulstr.c
1148
1149 libsystemd_core_la_CFLAGS = \
1150         $(AM_CFLAGS) \
1151         $(PAM_CFLAGS) \
1152         $(AUDIT_CFLAGS) \
1153         $(KMOD_CFLAGS) \
1154         $(APPARMOR_CFLAGS) \
1155         $(SECCOMP_CFLAGS) \
1156         $(MOUNT_CFLAGS) \
1157         -pthread
1158
1159 libsystemd_core_la_LIBADD = \
1160         libsystemd-units.la \
1161         libsystemd-label.la \
1162         libudev-internal.la \
1163         libsystemd-shared.la \
1164         libsystemd-internal.la \
1165         $(PAM_LIBS) \
1166         $(AUDIT_LIBS) \
1167         $(KMOD_LIBS) \
1168         $(APPARMOR_LIBS) \
1169         $(SECCOMP_LIBS) \
1170         $(MOUNT_LIBS)
1171
1172 if HAVE_SECCOMP
1173 libsystemd_core_la_LIBADD += \
1174         libsystemd-seccomp.la
1175 endif
1176
1177 src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
1178         $(AM_V_at)$(MKDIR_P) $(dir $@)
1179         $(AM_V_GEN)$(AWK) 'BEGIN{ keywords=0 ; FS="," ; print "extern const char load_fragment_gperf_nulstr[];" ; print "const char load_fragment_gperf_nulstr[] ="} ; keyword==1 { print "\"" $$1 "\\0\"" } ; /%%/ { keyword=1} ; END { print ";" }' < $< > $@
1180
1181 gperf_gperf_m4_sources = \
1182         src/core/load-fragment-gperf.gperf.m4
1183
1184 gperf_txt_sources = \
1185         src/shared/errno-list.txt \
1186         src/shared/af-list.txt \
1187         src/shared/arphrd-list.txt \
1188         src/shared/cap-list.txt
1189
1190 BUILT_SOURCES += \
1191         $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
1192         $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf-nulstr.c) \
1193         $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
1194         $(gperf_txt_sources:-list.txt=-from-name.h) \
1195         $(gperf_txt_sources:-list.txt=-to-name.h)
1196
1197 CLEANFILES += \
1198         $(gperf_txt_sources:-list.txt=-from-name.gperf)
1199 DISTCLEANFILES = \
1200         $(gperf_txt_sources)
1201
1202 EXTRA_DIST += \
1203         $(gperf_gperf_m4_sources) \
1204         $(gperf_gperf_sources) \
1205         $(gperf_txt_sources:-list.txt=-from-name.gperf)
1206
1207 CLEANFILES += \
1208         $(gperf_txt_sources)
1209
1210 %-from-name.gperf: %-list.txt
1211         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
1212
1213 %-from-name.h: %-from-name.gperf
1214         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
1215
1216
1217 src/shared/errno-list.txt:
1218         $(AM_V_at)$(MKDIR_P) $(dir $@)
1219         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
1220
1221 src/shared/errno-to-name.h: src/shared/errno-list.txt
1222         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
1223
1224
1225 src/shared/af-list.txt:
1226         $(AM_V_at)$(MKDIR_P) $(dir $@)
1227         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - </dev/null | grep -v AF_UNSPEC | grep -v AF_MAX | $(AWK) '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $$2; }' >$@
1228
1229 src/shared/af-to-name.h: src/shared/af-list.txt
1230         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
1231
1232
1233 src/shared/arphrd-list.txt:
1234         $(AM_V_at)$(MKDIR_P) $(dir $@)
1235         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include net/if_arp.h - </dev/null | $(AWK) '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $$2; }' | sed -e 's/ARPHRD_//' >$@
1236
1237 src/shared/arphrd-to-name.h: src/shared/arphrd-list.txt
1238         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const arphrd_names[] = { "} !/CISCO/ { printf "[ARPHRD_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
1239
1240 src/shared/arphrd-from-name.gperf: src/shared/arphrd-list.txt
1241         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@
1242
1243
1244 src/shared/cap-list.txt:
1245         $(AM_V_at)$(MKDIR_P) $(dir $@)
1246         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/capability.h -include missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
1247
1248 src/shared/cap-to-name.h: src/shared/cap-list.txt
1249         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@
1250
1251 src/shared/cap-from-name.gperf: src/shared/cap-list.txt
1252         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
1253
1254 src/shared/cap-from-name.h: src/shared/cap-from-name.gperf
1255         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@
1256
1257
1258 src/resolve/dns_type-list.txt: src/resolve/dns-type.h
1259         $(AM_V_at)$(MKDIR_P) $(dir $@)
1260         $(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@
1261
1262 src/resolve/dns_type-to-name.h: src/resolve/dns_type-list.txt
1263         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" } {printf "        case DNS_TYPE_%s: return ", $$1; sub(/_/, "-"); printf "\"%s\";\n", $$1 } END{ print "\ndefault: return NULL;\n\t}\n}\n" }' <$< >$@
1264
1265 src/resolve/dns_type-from-name.gperf: src/resolve/dns_type-list.txt
1266         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@
1267
1268 # ------------------------------------------------------------------------------
1269 systemd_SOURCES = \
1270         src/core/main.c
1271
1272 systemd_CFLAGS = \
1273         $(AM_CFLAGS) \
1274         $(SECCOMP_CFLAGS)
1275
1276 systemd_LDADD = \
1277         libsystemd-core.la \
1278         $(RT_LIBS)
1279
1280 dist_pkgsysconf_DATA += \
1281         src/core/system.conf \
1282         src/core/user.conf
1283
1284 dist_dbuspolicy_DATA += \
1285         src/core/org.freedesktop.systemd1.conf
1286
1287 dist_dbussystemservice_DATA += \
1288         src/core/org.freedesktop.systemd1.service
1289
1290 polkitpolicy_in_in_files += \
1291         src/core/org.freedesktop.systemd1.policy.in.in
1292
1293 pkgconfiglib_DATA += \
1294         src/core/systemd.pc
1295
1296 nodist_rpmmacros_DATA = \
1297         src/core/macros.systemd
1298
1299 EXTRA_DIST += \
1300         src/core/systemd.pc.in \
1301         src/core/macros.systemd.in
1302
1303 # ------------------------------------------------------------------------------
1304
1305 manual_tests += \
1306         test-ns \
1307         test-loopback \
1308         test-hostname \
1309         test-daemon \
1310         test-cgroup \
1311         test-install \
1312         test-watchdog \
1313         test-log \
1314         test-ipcrm \
1315         test-btrfs
1316
1317 if HAVE_KMOD
1318 manual_tests += \
1319         test-rtnl-manual
1320 endif
1321
1322 tests += \
1323         test-engine \
1324         test-cgroup-mask \
1325         test-job-type \
1326         test-env-replace \
1327         test-strbuf \
1328         test-strv \
1329         test-path \
1330         test-path-util \
1331         test-strxcpyx \
1332         test-unit-name \
1333         test-unit-file \
1334         test-utf8 \
1335         test-ellipsize \
1336         test-util \
1337         test-path-lookup \
1338         test-ring \
1339         test-barrier \
1340         test-pty \
1341         test-tmpfiles \
1342         test-namespace \
1343         test-date \
1344         test-sleep \
1345         test-replace-var \
1346         test-sched-prio \
1347         test-calendarspec \
1348         test-strip-tab-ansi \
1349         test-cgroup-util \
1350         test-fstab-util \
1351         test-prioq \
1352         test-fileio \
1353         test-time \
1354         test-hashmap \
1355         test-set \
1356         test-list \
1357         test-unaligned \
1358         test-tables \
1359         test-device-nodes \
1360         test-xml \
1361         test-json \
1362         test-architecture \
1363         test-socket-util \
1364         test-fdset \
1365         test-conf-files \
1366         test-capability \
1367         test-async \
1368         test-ratelimit \
1369         test-condition \
1370         test-uid-range \
1371         test-bus-policy \
1372         test-locale-util \
1373         test-execute \
1374         test-copy \
1375         test-cap-list \
1376         test-sigbus \
1377         test-verbs
1378
1379 EXTRA_DIST += \
1380         test/a.service \
1381         test/basic.target \
1382         test/b.service \
1383         test/c.service \
1384         test/daughter.service \
1385         test/d.service \
1386         test/end.service.in \
1387         test/e.service \
1388         test/f.service \
1389         test/grandchild.service \
1390         test/g.service \
1391         test/hello-after-sleep.target \
1392         test/hello.service \
1393         test/h.service \
1394         test/parent-deep.slice \
1395         test/parent.slice \
1396         test/paths.target \
1397         test/sched_idle_bad.service \
1398         test/sched_idle_ok.service \
1399         test/sched_rr_bad.service \
1400         test/sched_rr_change.service \
1401         test/sched_rr_ok.service \
1402         test/shutdown.target \
1403         test/sleep.service \
1404         test/sockets.target \
1405         test/son.service \
1406         test/sysinit.target \
1407         test/testsuite.target \
1408         test/timers.target \
1409         test/unstoppable.service \
1410         test/path-changed.service \
1411         test/path-directorynotempty.service \
1412         test/path-existsglob.service \
1413         test/path-exists.service \
1414         test/path-makedirectory.service \
1415         test/path-modified.service \
1416         test/path-mycustomunit.service \
1417         test/path-service.service \
1418         test/path-changed.path \
1419         test/path-directorynotempty.path \
1420         test/path-existsglob.path \
1421         test/path-exists.path \
1422         test/path-makedirectory.path \
1423         test/path-modified.path \
1424         test/path-unit.path \
1425         test/exec-environment-empty.service \
1426         test/exec-environment-multiple.service \
1427         test/exec-environment.service \
1428         test/exec-group.service \
1429         test/exec-ignoresigpipe-no.service \
1430         test/exec-ignoresigpipe-yes.service \
1431         test/exec-personality-x86-64.service \
1432         test/exec-personality-x86.service \
1433         test/exec-privatedevices-no.service \
1434         test/exec-privatedevices-yes.service \
1435         test/exec-privatetmp-no.service \
1436         test/exec-privatetmp-yes.service \
1437         test/exec-systemcallerrornumber.service \
1438         test/exec-systemcallfilter-failing2.service \
1439         test/exec-systemcallfilter-failing.service \
1440         test/exec-systemcallfilter-not-failing2.service \
1441         test/exec-systemcallfilter-not-failing.service \
1442         test/exec-user.service \
1443         test/exec-workingdirectory.service \
1444         test/exec-umask-0177.service \
1445         test/exec-umask-default.service \
1446         test/bus-policy/hello.conf \
1447         test/bus-policy/methods.conf \
1448         test/bus-policy/ownerships.conf \
1449         test/bus-policy/signals.conf \
1450         test/bus-policy/check-own-rules.conf \
1451         test/bus-policy/many-rules.conf \
1452         test/bus-policy/test.conf
1453
1454
1455 EXTRA_DIST += \
1456         src/test/test-helper.h
1457
1458 test_device_nodes_SOURCES = \
1459         src/test/test-device-nodes.c
1460
1461 test_device_nodes_LDADD = \
1462         libsystemd-shared.la
1463
1464 test_engine_SOURCES = \
1465         src/test/test-engine.c
1466
1467 test_engine_CFLAGS = \
1468         $(AM_CFLAGS) \
1469         $(SECCOMP_CFLAGS)
1470
1471 test_engine_LDADD = \
1472         libsystemd-core.la \
1473         $(RT_LIBS)
1474
1475 test_job_type_SOURCES = \
1476         src/test/test-job-type.c
1477
1478 test_job_type_CFLAGS = \
1479         $(AM_CFLAGS) \
1480         $(SECCOMP_CFLAGS)
1481
1482 test_job_type_LDADD = \
1483         libsystemd-core.la \
1484         $(RT_LIBS)
1485
1486 test_ns_SOURCES = \
1487         src/test/test-ns.c
1488
1489 test_ns_CFLAGS = \
1490         $(AM_CFLAGS) \
1491         $(SECCOMP_CFLAGS)
1492
1493 test_ns_LDADD = \
1494         libsystemd-core.la
1495
1496 test_loopback_SOURCES = \
1497         src/test/test-loopback.c
1498
1499 test_loopback_LDADD = \
1500         libsystemd-core.la
1501
1502 test_hostname_SOURCES = \
1503         src/test/test-hostname.c
1504
1505 test_hostname_LDADD = \
1506         libsystemd-core.la
1507
1508 if ENABLE_EFI
1509 manual_tests += \
1510         test-boot-timestamp
1511
1512 test_boot_timestamp_SOURCES = \
1513         src/test/test-boot-timestamps.c
1514
1515 test_boot_timestamp_LDADD = \
1516         libsystemd-shared.la
1517 endif
1518
1519 test_unit_name_SOURCES = \
1520         src/test/test-unit-name.c
1521
1522 test_unit_name_CFLAGS = \
1523         $(AM_CFLAGS) \
1524         $(SECCOMP_CFLAGS)
1525
1526 test_unit_name_LDADD = \
1527         libsystemd-core.la \
1528         $(RT_LIBS)
1529
1530 test_unit_file_SOURCES = \
1531         src/test/test-unit-file.c
1532
1533 test_unit_file_CFLAGS = \
1534         $(AM_CFLAGS) \
1535         $(SECCOMP_CFLAGS)
1536
1537 test_unit_file_LDADD = \
1538         libsystemd-core.la \
1539         $(RT_LIBS)
1540
1541 test_utf8_SOURCES = \
1542         src/test/test-utf8.c
1543
1544 test_utf8_LDADD = \
1545         libsystemd-shared.la
1546
1547 test_capability_SOURCES = \
1548         src/test/test-capability.c
1549
1550 test_capability_LDADD = \
1551         libsystemd-shared.la
1552
1553 test_async_SOURCES = \
1554         src/test/test-async.c
1555
1556 test_async_LDADD = \
1557         libsystemd-shared.la
1558
1559 test_locale_util_SOURCES = \
1560         src/test/test-locale-util.c
1561
1562 test_locale_util_LDADD = \
1563         libsystemd-shared.la
1564
1565 test_copy_SOURCES = \
1566         src/test/test-copy.c
1567
1568 test_copy_LDADD = \
1569         libsystemd-label.la \
1570         libsystemd-shared.la
1571
1572 test_sigbus_SOURCES = \
1573         src/test/test-sigbus.c
1574
1575 test_sigbus_LDADD = \
1576         libsystemd-shared.la
1577
1578 test_condition_SOURCES = \
1579         src/test/test-condition.c
1580
1581 test_condition_LDADD = \
1582         libsystemd-label.la \
1583         libsystemd-internal.la \
1584         libsystemd-shared.la
1585
1586 test_fdset_SOURCES = \
1587         src/test/test-fdset.c
1588
1589 test_fdset_LDADD = \
1590         libsystemd-shared.la \
1591         libsystemd-internal.la
1592
1593 test_fstab_util_SOURCES = \
1594         src/test/test-fstab-util.c
1595
1596 test_fstab_util_LDADD = \
1597         libsystemd-shared.la
1598
1599 test_ratelimit_SOURCES = \
1600         src/test/test-ratelimit.c
1601
1602 test_ratelimit_LDADD = \
1603         libsystemd-shared.la
1604
1605 test_util_SOURCES = \
1606         src/test/test-util.c
1607
1608 test_util_LDADD = \
1609         libsystemd-shared.la
1610
1611 test_path_lookup_SOURCES = \
1612         src/test/test-path-lookup.c
1613
1614 test_path_lookup_LDADD = \
1615         -lm \
1616         libsystemd-units.la \
1617         libsystemd-shared.la
1618
1619 test_uid_range_SOURCES = \
1620         src/test/test-uid-range.c
1621
1622 test_uid_range_LDADD = \
1623         libsystemd-shared.la
1624
1625 test_cap_list_SOURCES = \
1626         src/test/test-cap-list.c
1627
1628 test_cap_list_LDADD = \
1629         libsystemd-shared.la
1630
1631 test_socket_util_SOURCES = \
1632         src/test/test-socket-util.c
1633
1634 test_socket_util_LDADD = \
1635         libsystemd-shared.la
1636
1637 test_ring_SOURCES = \
1638         src/test/test-ring.c
1639
1640 test_ring_LDADD = \
1641         libsystemd-shared.la
1642
1643 test_barrier_SOURCES = \
1644         src/test/test-barrier.c
1645
1646 test_barrier_LDADD = \
1647         libsystemd-shared.la
1648
1649 test_pty_SOURCES = \
1650         src/test/test-pty.c
1651
1652 test_pty_LDADD = \
1653         libsystemd-core.la
1654
1655 test_tmpfiles_SOURCES = \
1656         src/test/test-tmpfiles.c
1657
1658 test_tmpfiles_LDADD = \
1659         libsystemd-shared.la
1660
1661 test_namespace_SOURCES = \
1662         src/test/test-namespace.c
1663
1664 test_verbs_SOURCES = \
1665         src/test/test-verbs.c
1666
1667 test_verbs_LDADD = \
1668         libsystemd-shared.la
1669
1670 test_namespace_LDADD = \
1671         libsystemd-core.la
1672
1673 BUILT_SOURCES += \
1674         src/test/test-hashmap-ordered.c
1675
1676 src/test/test-hashmap-ordered.c: src/test/test-hashmap-plain.c
1677         $(AM_V_at)$(MKDIR_P) $(dir $@)
1678         $(AM_V_GEN)$(AWK) 'BEGIN { print "/* GENERATED FILE */\n#define ORDERED" } \
1679                            { if (!match($$0, "^#include"))          \
1680                                  gsub(/hashmap/, "ordered_hashmap"); \
1681                              gsub(/HASHMAP/, "ORDERED_HASHMAP");     \
1682                              gsub(/Hashmap/, "OrderedHashmap");      \
1683                              print }' <$< >$@
1684
1685 nodist_test_hashmap_SOURCES = \
1686         src/test/test-hashmap-ordered.c
1687
1688 test_hashmap_SOURCES = \
1689         src/test/test-hashmap.c \
1690         src/test/test-hashmap-plain.c
1691
1692 test_hashmap_LDADD = \
1693         libsystemd-shared.la
1694
1695 test_set_SOURCES = \
1696         src/test/test-set.c
1697
1698 test_set_LDADD = \
1699         libsystemd-shared.la
1700
1701 test_xml_SOURCES = \
1702         src/test/test-xml.c
1703
1704 test_xml_LDADD = \
1705         libsystemd-shared.la
1706
1707 test_json_SOURCES = \
1708         src/test/test-json.c
1709
1710 test_json_LDADD = \
1711         libsystemd-shared.la
1712
1713 test_list_SOURCES = \
1714         src/test/test-list.c
1715
1716 test_list_LDADD = \
1717         libsystemd-shared.la
1718
1719 test_unaligned_LDADD = \
1720         libsystemd-shared.la
1721
1722 test_unaligned_SOURCES = \
1723         src/test/test-unaligned.c
1724
1725 test_tables_SOURCES = \
1726         src/test/test-tables.c \
1727         src/shared/test-tables.h \
1728         src/bus-proxyd/bus-xml-policy.c \
1729         src/bus-proxyd/bus-xml-policy.h \
1730         src/journal/journald-server.c \
1731         src/journal/journald-server.h
1732
1733 test_tables_CPPFLAGS = \
1734         $(AM_CPPFLAGS) \
1735         -I$(top_srcdir)/src/bus-proxyd
1736
1737 test_tables_CFLAGS = \
1738         $(AM_CFLAGS) \
1739         $(SECCOMP_CFLAGS)
1740
1741 test_tables_LDADD = \
1742         libsystemd-logs.la \
1743         libsystemd-journal-internal.la \
1744         libsystemd-journal-core.la \
1745         libsystemd-core.la \
1746         libudev-core.la \
1747         $(RT_LIBS)
1748
1749 test_prioq_SOURCES = \
1750         src/test/test-prioq.c
1751
1752 test_prioq_LDADD = \
1753         libsystemd-shared.la
1754
1755 test_fileio_SOURCES = \
1756         src/test/test-fileio.c
1757
1758 test_fileio_LDADD = \
1759         libsystemd-shared.la
1760
1761 test_time_SOURCES = \
1762         src/test/test-time.c
1763
1764 test_time_LDADD = \
1765         libsystemd-shared.la
1766
1767 test_architecture_SOURCES = \
1768         src/test/test-architecture.c
1769
1770 test_architecture_LDADD = \
1771         libsystemd-shared.la
1772
1773 test_log_SOURCES = \
1774         src/test/test-log.c
1775
1776 test_log_LDADD = \
1777         libsystemd-shared.la
1778
1779 test_ipcrm_SOURCES = \
1780         src/test/test-ipcrm.c
1781
1782 test_ipcrm_LDADD = \
1783         libsystemd-shared.la \
1784         -lrt
1785
1786 test_btrfs_SOURCES = \
1787         src/test/test-btrfs.c
1788
1789 test_btrfs_LDADD = \
1790         libsystemd-label.la \
1791         libsystemd-shared.la
1792
1793 test_rtnl_manual_SOURCES = \
1794         src/test/test-rtnl-manual.c
1795
1796 test_rtnl_manual_CFLAGS = \
1797         $(AM_CFLAGS) \
1798         $(KMOD_CFLAGS)
1799
1800 test_rtnl_manual_LDADD = \
1801         libsystemd-internal.la \
1802         libsystemd-shared.la \
1803         $(KMOD_LIBS)
1804
1805 test_ellipsize_SOURCES = \
1806         src/test/test-ellipsize.c
1807
1808 test_ellipsize_LDADD = \
1809         libsystemd-shared.la
1810
1811 test_date_SOURCES = \
1812         src/test/test-date.c
1813
1814 test_date_LDADD = \
1815         libsystemd-shared.la
1816
1817 test_sleep_SOURCES = \
1818         src/test/test-sleep.c
1819
1820 test_sleep_LDADD = \
1821         libsystemd-core.la
1822
1823 test_replace_var_SOURCES = \
1824         src/test/test-replace-var.c
1825
1826 test_replace_var_LDADD = \
1827         libsystemd-shared.la
1828
1829 test_calendarspec_SOURCES = \
1830         src/test/test-calendarspec.c
1831
1832 test_calendarspec_LDADD = \
1833         libsystemd-shared.la
1834
1835 test_strip_tab_ansi_SOURCES = \
1836         src/test/test-strip-tab-ansi.c
1837
1838 test_strip_tab_ansi_LDADD = \
1839         libsystemd-shared.la
1840
1841 test_daemon_SOURCES = \
1842         src/test/test-daemon.c
1843
1844 test_daemon_LDADD = \
1845         libsystemd-internal.la \
1846         libsystemd-shared.la
1847
1848 test_cgroup_SOURCES = \
1849         src/test/test-cgroup.c
1850
1851 test_cgroup_LDADD = \
1852         libsystemd-label.la \
1853         libsystemd-shared.la \
1854         libsystemd-internal.la
1855
1856 test_cgroup_mask_SOURCES = \
1857         src/test/test-cgroup-mask.c
1858
1859 test_cgroup_mask_CPPFLAGS = \
1860         $(AM_CPPFLAGS)
1861
1862 test_cgroup_mask_CFLAGS = \
1863         $(AM_CFLAGS) \
1864         $(SECCOMP_CFLAGS)
1865
1866 test_cgroup_mask_LDADD = \
1867         libsystemd-core.la \
1868         $(RT_LIBS)
1869
1870 test_cgroup_util_SOURCES = \
1871         src/test/test-cgroup-util.c
1872
1873 test_cgroup_util_LDADD = \
1874         libsystemd-label.la \
1875         libsystemd-internal.la \
1876         libsystemd-shared.la
1877
1878 test_env_replace_SOURCES = \
1879         src/test/test-env-replace.c
1880
1881 test_env_replace_LDADD = \
1882         libsystemd-shared.la
1883
1884 test_strbuf_SOURCES = \
1885         src/test/test-strbuf.c
1886
1887 test_strbuf_LDADD = \
1888         libsystemd-shared.la
1889
1890 test_strv_SOURCES = \
1891         src/test/test-strv.c
1892
1893 test_strv_LDADD = \
1894         libsystemd-units.la \
1895         libsystemd-internal.la \
1896         libsystemd-shared.la
1897
1898 test_path_util_SOURCES = \
1899         src/test/test-path-util.c
1900
1901 test_path_util_LDADD = \
1902         libsystemd-shared.la
1903
1904 test_path_SOURCES = \
1905         src/test/test-path.c
1906
1907 test_path_CFLAGS = \
1908         $(AM_CFLAGS)
1909
1910 test_path_LDADD = \
1911         libsystemd-core.la
1912
1913 test_execute_SOURCES = \
1914         src/test/test-execute.c
1915
1916 test_execute_CFLAGS = \
1917         $(AM_CFLAGS)
1918
1919 test_execute_LDADD = \
1920         libsystemd-core.la
1921
1922 test_strxcpyx_SOURCES = \
1923         src/test/test-strxcpyx.c
1924
1925 test_strxcpyx_LDADD = \
1926         libsystemd-shared.la
1927
1928 test_install_SOURCES = \
1929         src/test/test-install.c
1930
1931 test_install_LDADD = \
1932         libsystemd-units.la \
1933         libsystemd-label.la \
1934         libsystemd-shared.la \
1935         libsystemd-internal.la
1936
1937 test_watchdog_SOURCES = \
1938         src/test/test-watchdog.c
1939
1940 test_watchdog_LDADD = \
1941         libsystemd-shared.la
1942
1943 test_sched_prio_SOURCES = \
1944         src/test/test-sched-prio.c
1945
1946 test_sched_prio_CPPFLAGS = \
1947         $(AM_CPPFLAGS)
1948
1949 test_sched_prio_CFLAGS = \
1950         $(AM_CFLAGS) \
1951         $(SECCOMP_CFLAGS)
1952
1953 test_sched_prio_LDADD = \
1954         libsystemd-core.la \
1955         $(RT_LIBS)
1956
1957 test_conf_files_SOURCES = \
1958         src/test/test-conf-files.c
1959
1960 test_conf_files_LDADD = \
1961         libsystemd-shared.la
1962
1963 test_bus_policy_SOURCES = \
1964         src/bus-proxyd/test-bus-xml-policy.c
1965
1966 test_bus_policy_LDADD = \
1967         libsystemd-proxy.la \
1968         libsystemd-internal.la \
1969         libsystemd-shared.la
1970
1971 # ------------------------------------------------------------------------------
1972 ## .PHONY so it always rebuilds it
1973 .PHONY: coverage lcov-run lcov-report coverage-sync
1974
1975 # run lcov from scratch, always
1976 coverage: all
1977         $(MAKE) lcov-run
1978         $(MAKE) lcov-report
1979
1980 coverage_dir = coverage
1981 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
1982
1983 if ENABLE_COVERAGE
1984 # reset run coverage tests
1985 lcov-run:
1986         @rm -rf $(coverage_dir)
1987         lcov $(coverage_opts) --zerocounters
1988         -$(MAKE) check
1989
1990 # generate report based on current coverage data
1991 lcov-report:
1992         $(MKDIR_P) $(coverage_dir)
1993         lcov $(coverage_opts) --compat-libtool --capture --no-external \
1994                 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
1995         lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*'
1996         genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info
1997         @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
1998
1999 # lcov doesn't work properly with vpath builds, make sure that bad
2000 # output is not uploaded by mistake.
2001 coverage-sync: coverage
2002         test "$(builddir)" = "$(srcdir)"
2003         rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
2004
2005 else
2006 lcov-run lcov-report:
2007         echo "Need to reconfigure with --enable-coverage"
2008 endif
2009
2010 # ------------------------------------------------------------------------------
2011 systemd_analyze_SOURCES = \
2012         src/analyze/analyze.c \
2013         src/analyze/analyze-verify.c \
2014         src/analyze/analyze-verify.h
2015
2016 systemd_verify_CFLAGS = \
2017         $(AM_CFLAGS) \
2018         $(SECCOMP_CFLAGS)
2019
2020 systemd_analyze_LDADD = \
2021         libsystemd-core.la \
2022         libsystemd-internal.la \
2023         libsystemd-shared.la \
2024         $(RT_LIBS)
2025
2026 # ------------------------------------------------------------------------------
2027 systemd_initctl_SOURCES = \
2028         src/initctl/initctl.c
2029
2030 systemd_initctl_LDADD = \
2031         libsystemd-internal.la \
2032         libsystemd-shared.la
2033
2034 # ------------------------------------------------------------------------------
2035 systemd_update_done_SOURCES = \
2036         src/update-done/update-done.c
2037
2038 systemd_update_done_LDADD = \
2039         libsystemd-internal.la \
2040         libsystemd-label.la \
2041         libsystemd-shared.la
2042
2043 # ------------------------------------------------------------------------------
2044 systemd_shutdownd_SOURCES = \
2045         src/shutdownd/shutdownd.c
2046
2047 systemd_shutdownd_LDADD = \
2048         libsystemd-label.la \
2049         libsystemd-internal.la \
2050         libsystemd-shared.la
2051
2052 dist_doc_DATA += \
2053         src/systemd/sd-shutdown.h
2054
2055 # ------------------------------------------------------------------------------
2056 systemd_shutdown_SOURCES = \
2057         src/core/umount.c \
2058         src/core/umount.h \
2059         src/core/shutdown.c \
2060         src/core/mount-setup.c \
2061         src/core/mount-setup.h \
2062         src/core/killall.h \
2063         src/core/killall.c
2064
2065 systemd_shutdown_LDADD = \
2066         libsystemd-label.la \
2067         libudev-internal.la \
2068         libsystemd-internal.la \
2069         libsystemd-shared.la
2070
2071 # ------------------------------------------------------------------------------
2072 if HAVE_KMOD
2073 systemd_modules_load_SOURCES = \
2074         src/modules-load/modules-load.c
2075
2076 systemd_modules_load_CFLAGS = \
2077         $(AM_CFLAGS) \
2078         $(KMOD_CFLAGS)
2079
2080 systemd_modules_load_LDADD = \
2081         libsystemd-shared.la \
2082         $(KMOD_LIBS)
2083
2084 rootlibexec_PROGRAMS += \
2085         systemd-modules-load
2086
2087 nodist_systemunit_DATA += \
2088         units/systemd-modules-load.service
2089
2090 SYSINIT_TARGET_WANTS += \
2091         systemd-modules-load.service
2092
2093 if ENABLE_TMPFILES
2094 nodist_systemunit_DATA += \
2095         units/kmod-static-nodes.service
2096
2097 SYSINIT_TARGET_WANTS += \
2098         kmod-static-nodes.service
2099 endif
2100 endif
2101
2102 EXTRA_DIST += \
2103         units/systemd-modules-load.service.in \
2104         units/kmod-static-nodes.service.in
2105
2106 # ------------------------------------------------------------------------------
2107 if ENABLE_TMPFILES
2108 systemd_tmpfiles_SOURCES = \
2109         src/tmpfiles/tmpfiles.c
2110
2111 systemd_tmpfiles_LDADD = \
2112         libsystemd-units.la \
2113         libsystemd-label.la \
2114         libsystemd-internal.la \
2115         libsystemd-shared.la
2116
2117 if HAVE_ACL
2118 systemd_tmpfiles_LDADD += \
2119         libsystemd-acl.la
2120 endif
2121
2122 rootbin_PROGRAMS += \
2123         systemd-tmpfiles
2124
2125 dist_systemunit_DATA += \
2126         units/systemd-tmpfiles-clean.timer
2127
2128 nodist_systemunit_DATA += \
2129         units/systemd-tmpfiles-setup-dev.service \
2130         units/systemd-tmpfiles-setup.service \
2131         units/systemd-tmpfiles-clean.service
2132
2133 nodist_tmpfiles_DATA = \
2134         tmpfiles.d/systemd.conf \
2135         tmpfiles.d/etc.conf
2136
2137 dist_tmpfiles_DATA = \
2138         tmpfiles.d/systemd-nologin.conf \
2139         tmpfiles.d/tmp.conf \
2140         tmpfiles.d/x11.conf \
2141         tmpfiles.d/var.conf
2142
2143 SYSINIT_TARGET_WANTS += \
2144         systemd-tmpfiles-setup-dev.service \
2145         systemd-tmpfiles-setup.service
2146
2147 dist_zshcompletion_DATA += \
2148         shell-completion/zsh/_systemd-tmpfiles
2149
2150 TIMERS_TARGET_WANTS += \
2151         systemd-tmpfiles-clean.timer
2152
2153 INSTALL_DIRS += \
2154         $(tmpfilesdir) \
2155         $(sysconfdir)/tmpfiles.d
2156 endif
2157
2158 EXTRA_DIST += \
2159         tmpfiles.d/systemd.conf.m4 \
2160         tmpfiles.d/etc.conf.m4 \
2161         units/systemd-tmpfiles-setup-dev.service.in \
2162         units/systemd-tmpfiles-setup.service.in \
2163         units/systemd-tmpfiles-clean.service.in
2164
2165 # ------------------------------------------------------------------------------
2166 if ENABLE_SYSUSERS
2167 systemd_sysusers_SOURCES = \
2168         src/sysusers/sysusers.c
2169
2170 systemd_sysusers_LDADD = \
2171         libsystemd-units.la \
2172         libsystemd-label.la \
2173         libsystemd-internal.la \
2174         libsystemd-shared.la
2175
2176 rootbin_PROGRAMS += \
2177         systemd-sysusers
2178
2179 nodist_systemunit_DATA += \
2180         units/systemd-sysusers.service
2181
2182 SYSINIT_TARGET_WANTS += \
2183         systemd-sysusers.service
2184
2185 nodist_sysusers_DATA = \
2186         sysusers.d/systemd.conf \
2187         sysusers.d/basic.conf
2188
2189 EXTRA_DIST += \
2190         units/systemd-sysusers.service.in \
2191         sysusers.d/systemd.conf.m4 \
2192         sysusers.d/basic.conf.in
2193
2194 INSTALL_DIRS += \
2195         $(sysusersdir)
2196 endif
2197
2198 # ------------------------------------------------------------------------------
2199 dist_factory_etc_DATA = \
2200         factory/etc/nsswitch.conf
2201
2202 if HAVE_PAM
2203 dist_factory_pam_DATA = \
2204         factory/etc/pam.d/system-auth \
2205         factory/etc/pam.d/other
2206 endif
2207
2208 # ------------------------------------------------------------------------------
2209 if ENABLE_FIRSTBOOT
2210 systemd_firstboot_SOURCES = \
2211         src/firstboot/firstboot.c
2212
2213 systemd_firstboot_LDADD = \
2214         libsystemd-units.la \
2215         libsystemd-label.la \
2216         libsystemd-internal.la \
2217         libsystemd-shared.la \
2218         -lcrypt
2219
2220 rootbin_PROGRAMS += \
2221         systemd-firstboot
2222
2223 nodist_systemunit_DATA += \
2224         units/systemd-firstboot.service
2225
2226 EXTRA_DIST += \
2227         units/systemd-firstboot.service.in
2228
2229 SYSINIT_TARGET_WANTS += \
2230         systemd-firstboot.service
2231 endif
2232
2233 # ------------------------------------------------------------------------------
2234 systemd_machine_id_setup_SOURCES = \
2235         src/machine-id-setup/machine-id-setup-main.c \
2236         src/core/machine-id-setup.c \
2237         src/core/machine-id-setup.h
2238
2239 systemd_machine_id_setup_LDADD = \
2240         libsystemd-label.la \
2241         libsystemd-internal.la \
2242         libsystemd-shared.la
2243
2244 # ------------------------------------------------------------------------------
2245 systemd_sysctl_SOURCES = \
2246         src/sysctl/sysctl.c
2247
2248 systemd_sysctl_LDADD = \
2249         libsystemd-shared.la
2250
2251 # ------------------------------------------------------------------------------
2252 systemd_sleep_SOURCES = \
2253         src/sleep/sleep.c
2254
2255 systemd_sleep_LDADD = \
2256         libsystemd-shared.la
2257
2258 # ------------------------------------------------------------------------------
2259 systemd_fsck_SOURCES = \
2260         src/fsck/fsck.c
2261
2262 systemd_fsck_LDADD = \
2263         libsystemd-internal.la \
2264         libudev-internal.la \
2265         libsystemd-internal.la \
2266         libsystemd-shared.la
2267
2268 # ------------------------------------------------------------------------------
2269 systemd_fsckd_SOURCES = \
2270         src/fsckd/fsckd.c \
2271         src/fsckd/fsckd.h \
2272         $(NULL)
2273
2274 systemd_fsckd_LDADD = \
2275         libsystemd-internal.la \
2276         libsystemd-label.la \
2277         libsystemd-shared.la \
2278         libudev-internal.la \
2279         $(NULL)
2280
2281 # ------------------------------------------------------------------------------
2282 systemd_machine_id_commit_SOURCES = \
2283         src/machine-id-commit/machine-id-commit.c \
2284         src/core/machine-id-setup.c \
2285         src/core/machine-id-setup.h
2286
2287 systemd_machine_id_commit_LDADD = \
2288         libsystemd-label.la \
2289         libsystemd-internal.la \
2290         libsystemd-shared.la
2291
2292 SYSINIT_TARGET_WANTS += \
2293         systemd-machine-id-commit.service
2294
2295 # ------------------------------------------------------------------------------
2296 systemd_ac_power_SOURCES = \
2297         src/ac-power/ac-power.c
2298
2299 systemd_ac_power_LDADD = \
2300         libudev-internal.la \
2301         libsystemd-internal.la \
2302         libsystemd-shared.la
2303
2304 # ------------------------------------------------------------------------------
2305 systemd_detect_virt_SOURCES = \
2306         src/detect-virt/detect-virt.c
2307
2308 systemd_detect_virt_LDADD = \
2309         libsystemd-shared.la
2310
2311 INSTALL_EXEC_HOOKS += \
2312         systemd-detect-virt-install-hook
2313
2314 # ------------------------------------------------------------------------------
2315 systemd_delta_SOURCES = \
2316         src/delta/delta.c
2317
2318 systemd_delta_LDADD = \
2319         libsystemd-shared.la
2320
2321 # ------------------------------------------------------------------------------
2322 systemd_getty_generator_SOURCES = \
2323         src/getty-generator/getty-generator.c
2324
2325 systemd_getty_generator_LDADD = \
2326         libsystemd-label.la \
2327         libsystemd-shared.la
2328
2329 # ------------------------------------------------------------------------------
2330 systemd_debug_generator_SOURCES = \
2331         src/debug-generator/debug-generator.c
2332
2333 systemd_debug_generator_LDADD = \
2334         libsystemd-label.la \
2335         libsystemd-shared.la
2336
2337 # ------------------------------------------------------------------------------
2338 systemd_fstab_generator_SOURCES = \
2339         src/fstab-generator/fstab-generator.c \
2340         src/core/mount-setup.c
2341
2342 systemd_fstab_generator_LDADD = \
2343         libsystemd-label.la \
2344         libsystemd-shared.la
2345
2346 # ------------------------------------------------------------------------------
2347 systemd_system_update_generator_SOURCES = \
2348         src/system-update-generator/system-update-generator.c
2349
2350 systemd_system_update_generator_LDADD = \
2351         libsystemd-label.la \
2352         libsystemd-shared.la
2353
2354 # ------------------------------------------------------------------------------
2355 if ENABLE_HIBERNATE
2356 systemgenerator_PROGRAMS += \
2357         systemd-hibernate-resume-generator
2358
2359 rootlibexec_PROGRAMS += \
2360         systemd-hibernate-resume
2361
2362 systemd_hibernate_resume_SOURCES = \
2363         src/hibernate-resume/hibernate-resume.c
2364
2365 systemd_hibernate_resume_LDADD = \
2366         libsystemd-internal.la \
2367         libsystemd-shared.la
2368
2369 systemd_hibernate_resume_generator_SOURCES = \
2370         src/hibernate-resume/hibernate-resume-generator.c
2371
2372 systemd_hibernate_resume_generator_LDADD = \
2373         libsystemd-label.la \
2374         libsystemd-shared.la
2375
2376 EXTRA_DIST += \
2377         units/systemd-hibernate.service.in \
2378         units/systemd-hibernate-resume@.service.in \
2379         units/systemd-hybrid-sleep.service.in
2380
2381 dist_systemunit_DATA += \
2382         units/hibernate.target \
2383         units/hybrid-sleep.target
2384
2385 nodist_systemunit_DATA += \
2386         units/systemd-hibernate.service \
2387         units/systemd-hibernate-resume@.service \
2388         units/systemd-hybrid-sleep.service
2389 endif
2390
2391 # ------------------------------------------------------------------------------
2392 if ENABLE_EFI
2393 systemgenerator_PROGRAMS +=  \
2394         systemd-efi-boot-generator
2395
2396 systemd_efi_boot_generator_SOURCES = \
2397         src/efi-boot-generator/efi-boot-generator.c
2398
2399 systemd_efi_boot_generator_LDADD = \
2400         libsystemd-label.la \
2401         libsystemd-shared.la
2402
2403 # ------------------------------------------------------------------------------
2404 if HAVE_BLKID
2405 bootctl_SOURCES = \
2406         src/boot/bootctl.c
2407
2408 bootctl_CPPFLAGS = \
2409         $(AM_CPPFLAGS) \
2410         -DEFI_MACHINE_TYPE_NAME=\"$(EFI_MACHINE_TYPE_NAME)\" \
2411         -DBOOTLIBDIR=\"$(bootlibdir)\"
2412
2413 bootctl_CFLAGS = \
2414         $(AM_CFLAGS) \
2415         $(BLKID_CFLAGS)
2416
2417 bootctl_LDADD = \
2418         libsystemd-shared.la \
2419         libsystemd-internal.la \
2420         $(BLKID_LIBS)
2421
2422 bin_PROGRAMS += \
2423         bootctl
2424
2425 dist_bashcompletion_DATA += \
2426         shell-completion/bash/bootctl
2427
2428 dist_zshcompletion_DATA += \
2429         shell-completion/zsh/_bootctl
2430 endif
2431
2432 # ------------------------------------------------------------------------------
2433 if HAVE_GNUEFI
2434 efi_cppflags = \
2435         $(EFI_CPPFLAGS) \
2436         -I$(top_builddir) -include config.h \
2437         -I$(EFI_INC_DIR)/efi \
2438         -I$(EFI_INC_DIR)/efi/$(EFI_ARCH) \
2439         -DEFI_MACHINE_TYPE_NAME=\"$(EFI_MACHINE_TYPE_NAME)\"
2440
2441 efi_cflags = \
2442         $(EFI_CFLAGS) \
2443         -Wall \
2444         -Wextra \
2445         -std=gnu90 \
2446         -nostdinc \
2447         -ggdb -O0 \
2448         -fpic \
2449         -fshort-wchar \
2450         -nostdinc \
2451         -ffreestanding \
2452         -fno-strict-aliasing \
2453         -fno-stack-protector \
2454         -Wsign-compare \
2455         -Wno-missing-field-initializers \
2456         -mno-sse \
2457         -mno-mmx
2458
2459 if ARCH_X86_64
2460 efi_cflags += \
2461         -mno-red-zone \
2462         -DEFI_FUNCTION_WRAPPER \
2463         -DGNU_EFI_USE_MS_ABI
2464 endif
2465
2466 efi_ldflags = \
2467         $(EFI_LDFLAGS) \
2468         -T $(EFI_LDS_DIR)/elf_$(EFI_ARCH)_efi.lds \
2469         -shared \
2470         -Bsymbolic \
2471         -nostdlib \
2472         -znocombreloc \
2473         -L $(EFI_LIB_DIR) \
2474         $(EFI_LDS_DIR)/crt0-efi-$(EFI_ARCH).o
2475
2476 # ------------------------------------------------------------------------------
2477 systemd_boot_headers = \
2478         src/boot/efi/util.h \
2479         src/boot/efi/console.h \
2480         src/boot/efi/graphics.h \
2481         src/boot/efi/pefile.h
2482
2483 systemd_boot_sources = \
2484         src/boot/efi/util.c \
2485         src/boot/efi/console.c \
2486         src/boot/efi/graphics.c \
2487         src/boot/efi/pefile.c \
2488         src/boot/efi/boot.c
2489
2490 systemd_boot_objects = $(addprefix $(top_builddir)/,$(systemd_boot_sources:.c=.o))
2491 systemd_boot_solib = $(top_builddir)/src/boot/efi/systemd_boot.so
2492 systemd_boot = systemd-boot$(EFI_MACHINE_TYPE_NAME).efi
2493
2494 bootlib_DATA = $(systemd_boot)
2495 CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot)
2496 EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers)
2497
2498 $(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers))
2499         @$(MKDIR_P) $(top_builddir)/src/boot/efi/
2500         $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
2501
2502 $(systemd_boot_solib): $(systemd_boot_objects)
2503         $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \
2504                 -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
2505         nm -D -u $@ | grep ' U ' && exit 1 || :
2506
2507 $(systemd_boot): $(systemd_boot_solib)
2508         $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
2509           -j .dynsym -j .rel -j .rela -j .reloc \
2510           --target=efi-app-$(EFI_ARCH) $< $@
2511
2512 # ------------------------------------------------------------------------------
2513 stub_headers = \
2514         src/boot/efi/util.h \
2515         src/boot/efi/pefile.h \
2516         src/boot/efi/graphics.h \
2517         src/boot/efi/splash.h \
2518         src/boot/efi/linux.h
2519
2520 stub_sources = \
2521         src/boot/efi/util.c \
2522         src/boot/efi/pefile.c \
2523         src/boot/efi/graphics.c \
2524         src/boot/efi/splash.c \
2525         src/boot/efi/linux.c \
2526         src/boot/efi/stub.c
2527
2528 stub_objects = $(addprefix $(top_builddir)/,$(stub_sources:.c=.o))
2529 stub_solib = $(top_builddir)/src/boot/efi/stub.so
2530 stub = linux$(EFI_MACHINE_TYPE_NAME).efi.stub
2531
2532 bootlib_DATA += $(stub)
2533 CLEANFILES += $(stub_objects) $(stub_solib) $(stub)
2534 EXTRA_DIST += $(stub_sources) $(stub_headers)
2535
2536 $(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers))
2537         @$(MKDIR_P) $(top_builddir)/src/boot/efi/
2538         $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
2539
2540 $(stub_solib): $(stub_objects)
2541         $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
2542                 -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
2543         nm -D -u $@ | grep ' U ' && exit 1 || :
2544
2545 $(stub): $(stub_solib)
2546         $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
2547           -j .dynsym -j .rel -j .rela -j .reloc \
2548           --target=efi-app-$(EFI_ARCH) $< $@
2549
2550 # ------------------------------------------------------------------------------
2551 CLEANFILES += test-efi-disk.img
2552 EXTRA_DIST += test/test-efi-create-disk.sh
2553
2554 test-efi-disk.img: $(systemd_boot) $(stub) test/test-efi-create-disk.sh
2555         $(AM_V_GEN)test/test-efi-create-disk.sh
2556
2557 test-efi: test-efi-disk.img
2558         $(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img
2559 endif
2560 endif
2561
2562 # ------------------------------------------------------------------------------
2563 if HAVE_BLKID
2564 systemgenerator_PROGRAMS +=  \
2565         systemd-gpt-auto-generator
2566
2567 systemd_gpt_auto_generator_SOURCES = \
2568         src/gpt-auto-generator/gpt-auto-generator.c \
2569         src/shared/blkid-util.h
2570
2571 systemd_gpt_auto_generator_LDADD = \
2572         libsystemd-label.la \
2573         libudev-internal.la \
2574         libsystemd-internal.la \
2575         libsystemd-shared.la \
2576         $(BLKID_LIBS)
2577
2578 systemd_gpt_auto_generator_CFLAGS = \
2579         $(AM_CFLAGS) \
2580         $(BLKID_CFLAGS)
2581 endif
2582
2583 # ------------------------------------------------------------------------------
2584 if ENABLE_KDBUS
2585 systemgenerator_PROGRAMS +=  \
2586         systemd-dbus1-generator
2587
2588 systemd_dbus1_generator_SOURCES = \
2589         src/dbus1-generator/dbus1-generator.c
2590
2591 systemd_dbus1_generator_LDADD = \
2592         libsystemd-label.la \
2593         libsystemd-internal.la \
2594         libsystemd-shared.la
2595
2596 dbus1-generator-install-hook:
2597         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
2598         $(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2599         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2600
2601 dbus1-generator-uninstall-hook:
2602         rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2603
2604 dist_xinitrc_SCRIPTS = \
2605         xorg/50-systemd-user.sh
2606
2607 INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
2608 UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
2609 endif
2610
2611 # ------------------------------------------------------------------------------
2612 systemd_sysv_generator_SOURCES = \
2613         src/sysv-generator/sysv-generator.c
2614
2615 systemd_sysv_generator_LDADD = \
2616         libsystemd-core.la \
2617         libsystemd-label.la \
2618         libsystemd-shared.la
2619
2620 # ------------------------------------------------------------------------------
2621 systemd_rc_local_generator_SOURCES = \
2622         src/rc-local-generator/rc-local-generator.c
2623
2624 systemd_rc_local_generator_LDADD = \
2625         libsystemd-label.la \
2626         libsystemd-shared.la
2627
2628 # ------------------------------------------------------------------------------
2629 systemd_remount_fs_SOURCES = \
2630         src/remount-fs/remount-fs.c \
2631         src/core/mount-setup.c \
2632         src/core/mount-setup.h
2633
2634 systemd_remount_fs_LDADD = \
2635         libsystemd-label.la \
2636         libsystemd-shared.la
2637
2638 # ------------------------------------------------------------------------------
2639 systemd_cgroups_agent_SOURCES = \
2640         src/cgroups-agent/cgroups-agent.c
2641
2642 systemd_cgroups_agent_LDADD = \
2643         libsystemd-internal.la \
2644         libsystemd-shared.la
2645
2646 # ------------------------------------------------------------------------------
2647 systemd_escape_SOURCES = \
2648         src/escape/escape.c
2649
2650 systemd_escape_LDADD = \
2651         libsystemd-shared.la
2652
2653 # -----------------------------------------------------------------------------
2654 systemctl_SOURCES = \
2655         src/systemctl/systemctl.c
2656
2657 systemctl_LDADD = \
2658         libsystemd-units.la \
2659         libsystemd-label.la \
2660         libsystemd-internal.la \
2661         libsystemd-logs.la \
2662         libsystemd-journal-internal.la \
2663         libsystemd-shared.la
2664
2665 # ------------------------------------------------------------------------------
2666 systemd_notify_SOURCES = \
2667         src/notify/notify.c
2668
2669 systemd_notify_LDADD = \
2670         libsystemd-internal.la \
2671         libsystemd-shared.la
2672
2673 # ------------------------------------------------------------------------------
2674 systemd_path_SOURCES = \
2675         src/path/path.c
2676
2677 systemd_path_LDADD = \
2678         libsystemd-internal.la \
2679         libsystemd-shared.la
2680
2681 # ------------------------------------------------------------------------------
2682 systemd_ask_password_SOURCES = \
2683         src/ask-password/ask-password.c
2684
2685 systemd_ask_password_LDADD = \
2686         libsystemd-label.la \
2687         libsystemd-shared.la
2688
2689 # ------------------------------------------------------------------------------
2690 systemd_reply_password_SOURCES = \
2691         src/reply-password/reply-password.c
2692
2693 systemd_reply_password_LDADD = \
2694         libsystemd-shared.la
2695
2696 # ------------------------------------------------------------------------------
2697 systemd_cgls_SOURCES = \
2698         src/cgls/cgls.c
2699
2700 systemd_cgls_LDADD = \
2701         libsystemd-internal.la \
2702         libsystemd-shared.la
2703
2704 # ------------------------------------------------------------------------------
2705 systemd_cgtop_SOURCES = \
2706         src/cgtop/cgtop.c
2707
2708 systemd_cgtop_LDADD = \
2709         libsystemd-shared.la
2710
2711 # ------------------------------------------------------------------------------
2712 systemd_nspawn_SOURCES = \
2713         src/nspawn/nspawn.c \
2714         src/core/mount-setup.c \
2715         src/core/mount-setup.h \
2716         src/core/loopback-setup.c \
2717         src/core/loopback-setup.h
2718
2719 systemd_nspawn_CFLAGS = \
2720         $(AM_CFLAGS) \
2721         $(SECCOMP_CFLAGS) \
2722         $(BLKID_CFLAGS)
2723
2724 systemd_nspawn_LDADD = \
2725         libsystemd-label.la \
2726         libudev-internal.la \
2727         libsystemd-internal.la \
2728         libsystemd-shared.la \
2729         $(BLKID_LIBS)
2730
2731 if HAVE_SECCOMP
2732 systemd_nspawn_LDADD += \
2733         libsystemd-seccomp.la \
2734         $(SECCOMP_LIBS)
2735 endif
2736
2737 # ------------------------------------------------------------------------------
2738 systemd_run_SOURCES = \
2739         src/run/run.c
2740
2741 systemd_run_LDADD = \
2742         libsystemd-label.la \
2743         libsystemd-internal.la \
2744         libsystemd-shared.la
2745
2746 # ------------------------------------------------------------------------------
2747 noinst_LTLIBRARIES += \
2748         libsystemd-proxy.la
2749
2750 libsystemd_proxy_la_SOURCES = \
2751         src/bus-proxyd/bus-xml-policy.c \
2752         src/bus-proxyd/bus-xml-policy.h \
2753         src/bus-proxyd/driver.c \
2754         src/bus-proxyd/driver.h \
2755         src/bus-proxyd/proxy.c \
2756         src/bus-proxyd/proxy.h \
2757         src/bus-proxyd/synthesize.c \
2758         src/bus-proxyd/synthesize.h
2759
2760 libsystemd_proxy_la_CFLAGS = \
2761         $(AM_CFLAGS) \
2762         -pthread
2763
2764 libsystemd_proxy_la_LIBADD = \
2765         libsystemd-internal.la \
2766         libsystemd-shared.la
2767
2768 systemd_bus_proxyd_SOURCES = \
2769         src/bus-proxyd/bus-proxyd.c
2770
2771 systemd_bus_proxyd_CFLAGS = \
2772         $(AM_CFLAGS) \
2773         -pthread
2774
2775 systemd_bus_proxyd_LDADD = \
2776         libsystemd-proxy.la \
2777         libsystemd-internal.la \
2778         libsystemd-shared.la
2779
2780 systemd_stdio_bridge_SOURCES = \
2781         src/bus-proxyd/stdio-bridge.c
2782
2783 systemd_stdio_bridge_LDADD = \
2784         libsystemd-proxy.la \
2785         libsystemd-internal.la \
2786         libsystemd-shared.la
2787
2788 if ENABLE_KDBUS
2789 nodist_systemunit_DATA += \
2790         units/systemd-bus-proxyd.service
2791
2792 dist_systemunit_DATA += \
2793         units/systemd-bus-proxyd.socket
2794
2795 nodist_userunit_DATA += \
2796         units/user/systemd-bus-proxyd.service
2797
2798 dist_userunit_DATA += \
2799         units/user/systemd-bus-proxyd.socket
2800 endif
2801
2802 EXTRA_DIST += \
2803         units/systemd-bus-proxyd.service.m4.in \
2804         units/user/systemd-bus-proxyd.service.in
2805
2806 if HAVE_SMACK
2807 bus-proxyd-set-cap-hook:
2808         -$(SETCAP) cap_mac_admin+ei $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd
2809
2810 INSTALL_EXEC_HOOKS += bus-proxyd-set-cap-hook
2811 endif
2812
2813 # ------------------------------------------------------------------------------
2814 systemd_tty_ask_password_agent_SOURCES = \
2815         src/tty-ask-password-agent/tty-ask-password-agent.c
2816
2817 systemd_tty_ask_password_agent_LDADD = \
2818         libsystemd-label.la \
2819         libsystemd-shared.la
2820
2821 # ------------------------------------------------------------------------------
2822 libsystemd_internal_la_SOURCES = \
2823         src/systemd/sd-bus.h \
2824         src/systemd/sd-bus-protocol.h \
2825         src/systemd/sd-bus-vtable.h \
2826         src/systemd/sd-utf8.h \
2827         src/systemd/sd-event.h \
2828         src/systemd/sd-rtnl.h \
2829         src/systemd/sd-resolve.h \
2830         src/systemd/sd-login.h \
2831         src/systemd/sd-id128.h \
2832         src/systemd/sd-daemon.h \
2833         src/systemd/sd-path.h \
2834         src/systemd/sd-network.h \
2835         src/systemd/sd-hwdb.h \
2836         src/systemd/sd-device.h \
2837         src/libsystemd/sd-bus/sd-bus.c \
2838         src/libsystemd/sd-bus/bus-control.c \
2839         src/libsystemd/sd-bus/bus-control.h \
2840         src/libsystemd/sd-bus/bus-error.c \
2841         src/libsystemd/sd-bus/bus-error.h \
2842         src/libsystemd/sd-bus/bus-common-errors.h \
2843         src/libsystemd/sd-bus/bus-common-errors.c \
2844         src/libsystemd/sd-bus/bus-internal.c \
2845         src/libsystemd/sd-bus/bus-internal.h \
2846         src/libsystemd/sd-bus/bus-socket.c \
2847         src/libsystemd/sd-bus/bus-socket.h \
2848         src/libsystemd/sd-bus/bus-kernel.c \
2849         src/libsystemd/sd-bus/bus-kernel.h \
2850         src/libsystemd/sd-bus/bus-container.c \
2851         src/libsystemd/sd-bus/bus-container.h \
2852         src/libsystemd/sd-bus/bus-message.c \
2853         src/libsystemd/sd-bus/bus-message.h \
2854         src/libsystemd/sd-bus/bus-creds.c \
2855         src/libsystemd/sd-bus/bus-creds.h \
2856         src/libsystemd/sd-bus/bus-signature.c \
2857         src/libsystemd/sd-bus/bus-signature.h \
2858         src/libsystemd/sd-bus/bus-type.c \
2859         src/libsystemd/sd-bus/bus-type.h \
2860         src/libsystemd/sd-bus/bus-match.c \
2861         src/libsystemd/sd-bus/bus-match.h \
2862         src/libsystemd/sd-bus/bus-bloom.c \
2863         src/libsystemd/sd-bus/bus-bloom.h \
2864         src/libsystemd/sd-bus/bus-introspect.c \
2865         src/libsystemd/sd-bus/bus-introspect.h \
2866         src/libsystemd/sd-bus/bus-objects.c \
2867         src/libsystemd/sd-bus/bus-objects.h \
2868         src/libsystemd/sd-bus/bus-gvariant.c \
2869         src/libsystemd/sd-bus/bus-gvariant.h \
2870         src/libsystemd/sd-bus/bus-convenience.c \
2871         src/libsystemd/sd-bus/bus-track.c \
2872         src/libsystemd/sd-bus/bus-track.h \
2873         src/libsystemd/sd-bus/bus-util.c \
2874         src/libsystemd/sd-bus/bus-util.h \
2875         src/libsystemd/sd-bus/bus-slot.c \
2876         src/libsystemd/sd-bus/bus-slot.h \
2877         src/libsystemd/sd-bus/bus-protocol.h \
2878         src/libsystemd/sd-bus/kdbus.h \
2879         src/libsystemd/sd-utf8/sd-utf8.c \
2880         src/libsystemd/sd-event/sd-event.c \
2881         src/libsystemd/sd-event/event-util.h \
2882         src/libsystemd/sd-rtnl/sd-rtnl.c \
2883         src/libsystemd/sd-rtnl/rtnl-internal.h \
2884         src/libsystemd/sd-rtnl/rtnl-message.c \
2885         src/libsystemd/sd-rtnl/rtnl-types.h \
2886         src/libsystemd/sd-rtnl/rtnl-types.c \
2887         src/libsystemd/sd-rtnl/rtnl-util.h \
2888         src/libsystemd/sd-rtnl/rtnl-util.c \
2889         src/libsystemd/sd-rtnl/local-addresses.h \
2890         src/libsystemd/sd-rtnl/local-addresses.c \
2891         src/libsystemd/sd-id128/sd-id128.c \
2892         src/libsystemd/sd-daemon/sd-daemon.c \
2893         src/libsystemd/sd-login/sd-login.c \
2894         src/libsystemd/sd-path/sd-path.c \
2895         src/libsystemd/sd-network/sd-network.c \
2896         src/libsystemd/sd-network/network-util.h \
2897         src/libsystemd/sd-network/network-util.c \
2898         src/libsystemd/sd-hwdb/sd-hwdb.c \
2899         src/libsystemd/sd-hwdb/hwdb-util.h \
2900         src/libsystemd/sd-hwdb/hwdb-intenal.h \
2901         src/libsystemd/sd-device/device-internal.h \
2902         src/libsystemd/sd-device/device-util.h \
2903         src/libsystemd/sd-device/sd-device.c \
2904         src/libsystemd/sd-device/device-private.c \
2905         src/libsystemd/sd-device/device-private.h
2906
2907 nodist_libsystemd_internal_la_SOURCES = \
2908         src/libsystemd/libsystemd.sym
2909
2910 libsystemd_internal_la_CFLAGS = \
2911         $(AM_CFLAGS) \
2912         -pthread
2913
2914 libsystemd_internal_la_LIBADD = \
2915         $(RT_LIBS)
2916
2917 libsystemd_resolve_la_SOURCES = \
2918         src/libsystemd/sd-resolve/sd-resolve.c \
2919         src/libsystemd/sd-resolve/resolve-util.h
2920
2921 libsystemd_resolve_la_CFLAGS = \
2922         $(AM_CFLAGS) \
2923         -pthread
2924
2925 libsystemd_resolve_la_LIBADD = \
2926         -lresolv
2927
2928 noinst_LTLIBRARIES += \
2929         libsystemd-internal.la \
2930         libsystemd-resolve.la
2931
2932 libsystemd_dump_la_SOURCES = \
2933         src/libsystemd/sd-bus/bus-dump.c \
2934         src/libsystemd/sd-bus/bus-dump.h
2935
2936 noinst_LTLIBRARIES += \
2937         libsystemd-dump.la
2938
2939 EXTRA_DIST += \
2940         src/libsystemd/libsystemd.sym.m4 \
2941         src/libsystemd/libsystemd.pc.in \
2942         src/libsystemd/sd-bus/DIFFERENCES \
2943         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
2944
2945 BUILT_SOURCES += \
2946         src/libsystemd/libsystemd.sym
2947
2948 libsystemd_la_SOURCES = \
2949         $(libsystemd_internal_la_SOURCES) \
2950         $(libsystemd_resolve_la_SOURCES) \
2951         $(libsystemd_journal_internal_la_SOURCES)
2952
2953 nodist_libsystemd_la_SOURCES = \
2954         $(nodist_libsystemd_internal_la_SOURCES)
2955
2956 libsystemd_la_CFLAGS = \
2957         $(libsystemd_internal_la_CFLAGS) \
2958         $(libsystemd_resolve_la_CFLAGS) \
2959         $(libsystemd_journal_internal_la_CFLAGS)
2960
2961 libsystemd_la_LDFLAGS = \
2962         $(AM_LDFLAGS) \
2963         -version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
2964         -Wl,--version-script=$(top_builddir)/src/libsystemd/libsystemd.sym
2965
2966 libsystemd_la_LIBADD = \
2967         libsystemd-shared.la \
2968         $(libsystemd_internal_la_LIBADD) \
2969         $(libsystemd_journal_internal_la_LIBADD) \
2970         $(libsystemd_resolve_la_LIBADD)
2971
2972 libsystemd-install-hook:
2973         libname=libsystemd.so && $(move-to-rootlibdir)
2974
2975 libsystemd-uninstall-hook:
2976         rm -f $(DESTDIR)$(rootlibdir)/libsystemd.so*
2977
2978 INSTALL_EXEC_HOOKS += libsystemd-install-hook
2979 UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook
2980
2981 pkgconfiglib_DATA += \
2982         src/libsystemd/libsystemd.pc
2983
2984 pkginclude_HEADERS += \
2985         src/systemd/sd-login.h \
2986         src/systemd/sd-id128.h \
2987         src/systemd/sd-daemon.h
2988
2989 if ENABLE_KDBUS
2990 pkginclude_HEADERS += \
2991         src/systemd/sd-bus.h \
2992         src/systemd/sd-bus-protocol.h \
2993         src/systemd/sd-bus-vtable.h \
2994         src/systemd/sd-utf8.h \
2995         src/systemd/sd-event.h \
2996         src/systemd/sd-rtnl.h \
2997         src/systemd/sd-resolve.h \
2998         src/systemd/sd-path.h
2999 endif
3000
3001 lib_LTLIBRARIES += \
3002         libsystemd.la
3003
3004 tests += \
3005         test-bus-marshal \
3006         test-bus-signature \
3007         test-bus-chat \
3008         test-bus-cleanup \
3009         test-bus-server \
3010         test-bus-match \
3011         test-bus-kernel \
3012         test-bus-kernel-bloom \
3013         test-bus-kernel-benchmark \
3014         test-bus-zero-copy \
3015         test-bus-introspect \
3016         test-bus-objects \
3017         test-bus-error \
3018         test-bus-creds \
3019         test-bus-gvariant \
3020         test-event \
3021         test-rtnl \
3022         test-local-addresses \
3023         test-resolve
3024
3025 bin_PROGRAMS += \
3026         busctl
3027
3028 test_bus_marshal_SOURCES = \
3029         src/libsystemd/sd-bus/test-bus-marshal.c
3030
3031 test_bus_marshal_LDADD = \
3032         libsystemd-dump.la \
3033         libsystemd-internal.la \
3034         libsystemd-shared.la \
3035         $(GLIB_LIBS) \
3036         $(DBUS_LIBS)
3037
3038 test_bus_marshal_CFLAGS = \
3039         $(AM_CFLAGS) \
3040         $(GLIB_CFLAGS) \
3041         $(DBUS_CFLAGS)
3042
3043 test_bus_signature_SOURCES = \
3044         src/libsystemd/sd-bus/test-bus-signature.c
3045
3046 test_bus_signature_LDADD = \
3047         libsystemd-internal.la \
3048         libsystemd-shared.la
3049
3050 test_bus_chat_SOURCES = \
3051         src/libsystemd/sd-bus/test-bus-chat.c
3052
3053 test_bus_chat_CFLAGS = \
3054         $(AM_CFLAGS) \
3055         -pthread
3056
3057 test_bus_chat_LDADD = \
3058         libsystemd-internal.la \
3059         libsystemd-shared.la
3060
3061 test_bus_cleanup_SOURCES = \
3062         src/libsystemd/sd-bus/test-bus-cleanup.c
3063
3064 test_bus_cleanup_CFLAGS = \
3065         $(AM_CFLAGS) \
3066         $(SECCOMP_CFLAGS)
3067
3068 test_bus_cleanup_LDADD = \
3069         libsystemd-internal.la \
3070         libsystemd-shared.la
3071
3072 test_bus_server_SOURCES = \
3073         src/libsystemd/sd-bus/test-bus-server.c
3074
3075 test_bus_server_CFLAGS = \
3076         $(AM_CFLAGS) \
3077         -pthread
3078
3079 test_bus_server_LDADD = \
3080         libsystemd-internal.la \
3081         libsystemd-shared.la
3082
3083 test_bus_objects_SOURCES = \
3084         src/libsystemd/sd-bus/test-bus-objects.c
3085
3086 test_bus_objects_CFLAGS = \
3087         $(AM_CFLAGS) \
3088         -pthread
3089
3090 test_bus_objects_LDADD = \
3091         libsystemd-dump.la \
3092         libsystemd-internal.la \
3093         libsystemd-shared.la
3094
3095 test_bus_error_SOURCES = \
3096         src/libsystemd/sd-bus/test-bus-error.c
3097
3098 test_bus_error_LDADD = \
3099         libsystemd-internal.la \
3100         libsystemd-shared.la
3101
3102 test_bus_gvariant_SOURCES = \
3103         src/libsystemd/sd-bus/test-bus-gvariant.c
3104
3105 test_bus_gvariant_LDADD = \
3106         libsystemd-dump.la \
3107         libsystemd-internal.la \
3108         libsystemd-shared.la \
3109         $(GLIB_LIBS)
3110
3111 test_bus_gvariant_CFLAGS = \
3112         $(AM_CFLAGS) \
3113         $(GLIB_CFLAGS)
3114
3115 test_bus_creds_SOURCES = \
3116         src/libsystemd/sd-bus/test-bus-creds.c
3117
3118 test_bus_creds_LDADD = \
3119         libsystemd-dump.la \
3120         libsystemd-internal.la \
3121         libsystemd-shared.la
3122
3123 test_bus_match_SOURCES = \
3124         src/libsystemd/sd-bus/test-bus-match.c
3125
3126 test_bus_match_LDADD = \
3127         libsystemd-internal.la \
3128         libsystemd-shared.la
3129
3130 test_bus_kernel_SOURCES = \
3131         src/libsystemd/sd-bus/test-bus-kernel.c
3132
3133 test_bus_kernel_LDADD = \
3134         libsystemd-dump.la \
3135         libsystemd-internal.la \
3136         libsystemd-shared.la
3137
3138 test_bus_kernel_bloom_SOURCES = \
3139         src/libsystemd/sd-bus/test-bus-kernel-bloom.c
3140
3141 test_bus_kernel_bloom_LDADD = \
3142         libsystemd-internal.la \
3143         libsystemd-shared.la
3144
3145 test_bus_kernel_benchmark_SOURCES = \
3146         src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
3147
3148 test_bus_kernel_benchmark_LDADD = \
3149         libsystemd-internal.la \
3150         libsystemd-shared.la
3151
3152 test_bus_zero_copy_SOURCES = \
3153         src/libsystemd/sd-bus/test-bus-zero-copy.c
3154
3155 test_bus_zero_copy_LDADD = \
3156         libsystemd-dump.la \
3157         libsystemd-internal.la \
3158         libsystemd-shared.la
3159
3160 test_bus_introspect_SOURCES = \
3161         src/libsystemd/sd-bus/test-bus-introspect.c
3162
3163 test_bus_introspect_LDADD = \
3164         libsystemd-internal.la \
3165         libsystemd-shared.la
3166
3167 test_event_SOURCES = \
3168         src/libsystemd/sd-event/test-event.c
3169
3170 test_event_LDADD = \
3171         libsystemd-internal.la \
3172         libsystemd-shared.la
3173
3174 test_rtnl_SOURCES = \
3175         src/libsystemd/sd-rtnl/test-rtnl.c
3176
3177 test_rtnl_LDADD = \
3178         libsystemd-internal.la \
3179         libsystemd-shared.la
3180
3181 test_local_addresses_SOURCES = \
3182         src/libsystemd/sd-rtnl/test-local-addresses.c
3183
3184 test_local_addresses_LDADD = \
3185         libsystemd-internal.la \
3186         libsystemd-shared.la
3187
3188 test_resolve_SOURCES = \
3189         src/libsystemd/sd-resolve/test-resolve.c
3190
3191 test_resolve_LDADD = \
3192         libsystemd-resolve.la \
3193         libsystemd-internal.la \
3194         libsystemd-shared.la
3195
3196 test_resolve_CFLAGS = \
3197         $(AM_CFLAGS) \
3198         -pthread
3199
3200 busctl_SOURCES = \
3201         src/libsystemd/sd-bus/busctl.c \
3202         src/libsystemd/sd-bus/busctl-introspect.c \
3203         src/libsystemd/sd-bus/busctl-introspect.h
3204
3205 busctl_LDADD = \
3206         libsystemd-dump.la \
3207         libsystemd-internal.la \
3208         libsystemd-shared.la
3209
3210 # ------------------------------------------------------------------------------
3211 noinst_LTLIBRARIES += \
3212         libsystemd-network.la
3213
3214 libsystemd_network_la_CFLAGS = \
3215         $(AM_CFLAGS) \
3216         $(KMOD_CFLAGS)
3217
3218 libsystemd_network_la_SOURCES = \
3219         src/systemd/sd-dhcp-client.h \
3220         src/systemd/sd-dhcp-server.h \
3221         src/systemd/sd-dhcp-lease.h \
3222         src/systemd/sd-ipv4ll.h \
3223         src/systemd/sd-icmp6-nd.h \
3224         src/systemd/sd-dhcp6-client.h \
3225         src/systemd/sd-dhcp6-lease.h \
3226         src/systemd/sd-pppoe.h \
3227         src/systemd/sd-lldp.h \
3228         src/libsystemd-network/sd-dhcp-client.c \
3229         src/libsystemd-network/sd-dhcp-server.c \
3230         src/libsystemd-network/dhcp-network.c \
3231         src/libsystemd-network/dhcp-option.c \
3232         src/libsystemd-network/dhcp-packet.c \
3233         src/libsystemd-network/dhcp-internal.h \
3234         src/libsystemd-network/dhcp-server-internal.h \
3235         src/libsystemd-network/dhcp-protocol.h \
3236         src/libsystemd-network/dhcp-lease-internal.h \
3237         src/libsystemd-network/sd-dhcp-lease.c \
3238         src/libsystemd-network/sd-ipv4ll.c \
3239         src/libsystemd-network/ipv4ll-network.c \
3240         src/libsystemd-network/ipv4ll-packet.c \
3241         src/libsystemd-network/ipv4ll-internal.h \
3242         src/libsystemd-network/sd-pppoe.c \
3243         src/libsystemd-network/network-internal.c \
3244         src/libsystemd-network/network-internal.h \
3245         src/libsystemd-network/sd-icmp6-nd.c \
3246         src/libsystemd-network/sd-dhcp6-client.c \
3247         src/libsystemd-network/dhcp6-internal.h \
3248         src/libsystemd-network/dhcp6-protocol.h \
3249         src/libsystemd-network/dhcp6-network.c \
3250         src/libsystemd-network/dhcp6-option.c \
3251         src/libsystemd-network/dhcp6-lease-internal.h \
3252         src/libsystemd-network/sd-dhcp6-lease.c \
3253         src/libsystemd-network/dhcp-identifier.h \
3254         src/libsystemd-network/dhcp-identifier.c \
3255         src/libsystemd-network/lldp.h \
3256         src/libsystemd-network/lldp-tlv.h \
3257         src/libsystemd-network/lldp-tlv.c \
3258         src/libsystemd-network/lldp-network.h \
3259         src/libsystemd-network/lldp-network.c \
3260         src/libsystemd-network/lldp-port.h \
3261         src/libsystemd-network/lldp-port.c \
3262         src/libsystemd-network/lldp-internal.h \
3263         src/libsystemd-network/lldp-internal.c \
3264         src/libsystemd-network/lldp-util.h \
3265         src/libsystemd-network/sd-lldp.c
3266
3267 libsystemd_network_la_LIBADD = \
3268         libudev-internal.la \
3269         libsystemd-label.la \
3270         libsystemd-internal.la \
3271         libsystemd-shared.la \
3272         $(KMOD_LIBS)
3273
3274 test_dhcp_option_SOURCES = \
3275         src/libsystemd-network/dhcp-protocol.h \
3276         src/libsystemd-network/dhcp-internal.h \
3277         src/libsystemd-network/test-dhcp-option.c
3278
3279 test_dhcp_option_LDADD = \
3280         libsystemd-network.la \
3281         libsystemd-internal.la \
3282         libsystemd-shared.la
3283
3284 test_dhcp_client_SOURCES = \
3285         src/systemd/sd-dhcp-client.h \
3286         src/libsystemd-network/dhcp-protocol.h \
3287         src/libsystemd-network/dhcp-internal.h \
3288         src/libsystemd-network/test-dhcp-client.c
3289
3290 test_dhcp_client_LDADD = \
3291         libsystemd-network.la \
3292         libsystemd-label.la \
3293         libsystemd-internal.la \
3294         libsystemd-shared.la
3295
3296 test_dhcp_server_SOURCES = \
3297         src/libsystemd-network/test-dhcp-server.c
3298
3299 test_dhcp_server_LDADD = \
3300         libsystemd-network.la \
3301         libsystemd-internal.la \
3302         libsystemd-shared.la
3303
3304 test_ipv4ll_SOURCES = \
3305         src/systemd/sd-ipv4ll.h \
3306         src/libsystemd-network/ipv4ll-internal.h \
3307         src/libsystemd-network/test-ipv4ll.c
3308
3309 test_ipv4ll_LDADD = \
3310         libsystemd-network.la \
3311         libsystemd-label.la \
3312         libsystemd-internal.la \
3313         libsystemd-shared.la
3314
3315 test_pppoe_SOURCES = \
3316         src/systemd/sd-pppoe.h \
3317         src/libsystemd-network/test-pppoe.c
3318
3319 test_pppoe_LDADD = \
3320         libsystemd-network.la \
3321         libsystemd-shared.la
3322
3323 test_icmp6_rs_SOURCES = \
3324         src/systemd/sd-dhcp6-client.h \
3325         src/systemd/sd-icmp6-nd.h \
3326         src/libsystemd-network/dhcp6-internal.h \
3327         src/libsystemd-network/test-icmp6-rs.c \
3328         src/libsystemd-network/dhcp-identifier.h \
3329         src/libsystemd-network/dhcp-identifier.c
3330
3331 test_icmp6_rs_LDADD = \
3332         libsystemd-network.la \
3333         libsystemd-internal.la \
3334         libsystemd-shared.la
3335
3336 test_dhcp6_client_SOURCES = \
3337         src/systemd/sd-dhcp6-client.h \
3338         src/libsystemd-network/dhcp6-internal.h \
3339         src/libsystemd-network/test-dhcp6-client.c \
3340         src/libsystemd-network/dhcp-identifier.h \
3341         src/libsystemd-network/dhcp-identifier.c
3342
3343 test_dhcp6_client_LDADD = \
3344         libsystemd-network.la \
3345         libsystemd-internal.la \
3346         libsystemd-shared.la
3347
3348 test_lldp_SOURCES = \
3349        src/libsystemd-network/lldp.h \
3350        src/libsystemd-network/lldp-tlv.h \
3351        src/libsystemd-network/lldp-tlv.c \
3352        src/libsystemd-network/test-lldp.c
3353
3354 test_lldp_LDADD = \
3355         libsystemd-network.la \
3356         libsystemd-internal.la \
3357         libsystemd-shared.la
3358
3359 tests += \
3360         test-dhcp-option \
3361         test-dhcp-client \
3362         test-dhcp-server \
3363         test-ipv4ll \
3364         test-icmp6-rs \
3365         test-dhcp6-client \
3366         test-lldp
3367
3368 manual_tests += \
3369         test-pppoe
3370
3371 # ------------------------------------------------------------------------------
3372 if ENABLE_TERMINAL
3373 noinst_LTLIBRARIES += \
3374         libsystemd-terminal.la
3375
3376 rootlibexec_PROGRAMS += \
3377         systemd-consoled
3378
3379 noinst_PROGRAMS += \
3380         systemd-evcat \
3381         systemd-modeset \
3382         systemd-subterm
3383
3384 dist_pkgdata_DATA += \
3385        src/libsystemd-terminal/unifont-glyph-array.bin
3386
3387 nodist_userunit_DATA += \
3388         units/user/systemd-consoled.service
3389
3390 USER_DEFAULT_TARGET_WANTS += \
3391         systemd-consoled.service
3392
3393 tests += \
3394         test-term-page \
3395         test-term-parser \
3396         test-unifont
3397 endif
3398
3399 EXTRA_DIST += \
3400         units/user/systemd-consoled.service.in
3401
3402 libsystemd_terminal_la_CFLAGS = \
3403         $(AM_CFLAGS) \
3404         $(TERMINAL_CFLAGS)
3405
3406 libsystemd_terminal_la_SOURCES = \
3407         src/libsystemd-terminal/grdev.h \
3408         src/libsystemd-terminal/grdev-internal.h \
3409         src/libsystemd-terminal/grdev.c \
3410         src/libsystemd-terminal/grdev-drm.c \
3411         src/libsystemd-terminal/idev.h \
3412         src/libsystemd-terminal/idev-internal.h \
3413         src/libsystemd-terminal/idev.c \
3414         src/libsystemd-terminal/idev-evdev.c \
3415         src/libsystemd-terminal/idev-keyboard.c \
3416         src/libsystemd-terminal/sysview.h \
3417         src/libsystemd-terminal/sysview-internal.h \
3418         src/libsystemd-terminal/sysview.c \
3419         src/libsystemd-terminal/term.h \
3420         src/libsystemd-terminal/term-internal.h \
3421         src/libsystemd-terminal/term-charset.c \
3422         src/libsystemd-terminal/term-page.c \
3423         src/libsystemd-terminal/term-parser.c \
3424         src/libsystemd-terminal/term-screen.c \
3425         src/libsystemd-terminal/term-wcwidth.c \
3426         src/libsystemd-terminal/unifont.h \
3427         src/libsystemd-terminal/unifont-def.h \
3428         src/libsystemd-terminal/unifont.c
3429
3430 libsystemd_terminal_la_LIBADD = \
3431         libudev-internal.la \
3432         libsystemd-internal.la \
3433         libsystemd-shared.la \
3434         $(TERMINAL_LIBS)
3435
3436 systemd_consoled_CFLAGS = \
3437         $(AM_CFLAGS) \
3438         $(TERMINAL_CFLAGS)
3439
3440 systemd_consoled_SOURCES = \
3441         src/console/consoled.h \
3442         src/console/consoled.c \
3443         src/console/consoled-display.c \
3444         src/console/consoled-manager.c \
3445         src/console/consoled-session.c \
3446         src/console/consoled-terminal.c \
3447         src/console/consoled-workspace.c
3448
3449 systemd_consoled_LDADD = \
3450         libsystemd-terminal.la \
3451         libsystemd-internal.la \
3452         libsystemd-shared.la \
3453         $(TERMINAL_LIBS)
3454
3455 systemd_evcat_CFLAGS = \
3456         $(AM_CFLAGS) \
3457         $(TERMINAL_CFLAGS)
3458
3459 systemd_evcat_SOURCES = \
3460         src/libsystemd-terminal/evcat.c
3461
3462 systemd_evcat_LDADD = \
3463         libsystemd-terminal.la \
3464         libsystemd-internal.la \
3465         libsystemd-shared.la \
3466         $(TERMINAL_LIBS)
3467
3468 systemd_modeset_CFLAGS = \
3469         $(AM_CFLAGS) \
3470         $(TERMINAL_CFLAGS)
3471
3472 systemd_modeset_SOURCES = \
3473         src/libsystemd-terminal/modeset.c
3474
3475 systemd_modeset_LDADD = \
3476         libsystemd-terminal.la \
3477         libsystemd-internal.la \
3478         libsystemd-shared.la \
3479         $(TERMINAL_LIBS)
3480
3481 systemd_subterm_SOURCES = \
3482         src/libsystemd-terminal/subterm.c
3483
3484 systemd_subterm_LDADD = \
3485         libsystemd-terminal.la \
3486         libsystemd-internal.la \
3487         libsystemd-shared.la
3488
3489 test_term_page_SOURCES = \
3490         src/libsystemd-terminal/test-term-page.c
3491
3492 test_term_page_LDADD = \
3493         libsystemd-terminal.la \
3494         libsystemd-internal.la \
3495         libsystemd-shared.la
3496
3497 test_term_parser_SOURCES = \
3498         src/libsystemd-terminal/test-term-parser.c
3499
3500 test_term_parser_LDADD = \
3501         libsystemd-terminal.la \
3502         libsystemd-internal.la \
3503         libsystemd-shared.la
3504
3505 test_unifont_SOURCES = \
3506         src/libsystemd-terminal/test-unifont.c
3507
3508 test_unifont_LDADD = \
3509         libsystemd-terminal.la \
3510         libsystemd-internal.la \
3511         libsystemd-shared.la
3512
3513 src/libsystemd-terminal/unifont-glyph-array.bin: tools/compile-unifont.py $(UNIFONT)
3514         $(AM_V_GEN)$(PYTHON) $< <$(UNIFONT) >$@
3515
3516 # ------------------------------------------------------------------------------
3517 if ENABLE_GTK_DOC
3518 endif
3519
3520 include_HEADERS += \
3521         src/libudev/libudev.h
3522
3523 lib_LTLIBRARIES += \
3524         libudev.la
3525
3526 libudev_la_SOURCES =\
3527         src/libudev/libudev.sym \
3528         src/libudev/libudev-private.h \
3529         src/libudev/libudev-device-internal.h \
3530         src/libudev/libudev.c \
3531         src/libudev/libudev-list.c \
3532         src/libudev/libudev-util.c \
3533         src/libudev/libudev-device.c \
3534         src/libudev/libudev-device-private.c \
3535         src/libudev/libudev-enumerate.c \
3536         src/libudev/libudev-monitor.c \
3537         src/libudev/libudev-queue.c \
3538         src/libudev/libudev-hwdb.c
3539
3540 libudev_la_CFLAGS = \
3541         $(AM_CFLAGS) \
3542         -fvisibility=hidden
3543
3544 libudev_la_LDFLAGS = \
3545         $(AM_LDFLAGS) \
3546         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
3547         -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
3548
3549 libudev_la_LIBADD = \
3550         libsystemd-internal.la \
3551         libsystemd-shared.la
3552
3553 pkgconfiglib_DATA += \
3554         src/libudev/libudev.pc
3555
3556 EXTRA_DIST += \
3557         src/libudev/libudev.pc.in
3558
3559 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
3560 libudev-install-hook:
3561         libname=libudev.so && $(move-to-rootlibdir)
3562
3563 libudev-uninstall-hook:
3564         rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
3565
3566 INSTALL_EXEC_HOOKS += libudev-install-hook
3567 UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
3568
3569 # ------------------------------------------------------------------------------
3570 noinst_LTLIBRARIES += \
3571         libudev-internal.la
3572
3573 libudev_internal_la_SOURCES =\
3574         $(libudev_la_SOURCES)
3575
3576 libudev_internal_la_CFLAGS = \
3577         $(AM_CFLAGS) \
3578         -fvisibility=default
3579
3580 # ------------------------------------------------------------------------------
3581 INSTALL_DIRS += \
3582         $(sysconfdir)/udev/rules.d
3583
3584 dist_network_DATA = \
3585         network/99-default.link \
3586         network/80-container-host0.network \
3587         network/80-container-ve.network
3588
3589 dist_udevrules_DATA += \
3590         rules/42-usb-hid-pm.rules \
3591         rules/50-udev-default.rules \
3592         rules/60-block.rules \
3593         rules/60-drm.rules \
3594         rules/60-keyboard.rules \
3595         rules/60-persistent-storage-tape.rules \
3596         rules/60-persistent-input.rules \
3597         rules/60-persistent-alsa.rules \
3598         rules/60-persistent-storage.rules \
3599         rules/60-serial.rules \
3600         rules/64-btrfs.rules \
3601         rules/70-mouse.rules \
3602         rules/70-touchpad.rules \
3603         rules/75-net-description.rules \
3604         rules/78-sound-card.rules \
3605         rules/80-net-setup-link.rules
3606
3607 nodist_udevrules_DATA += \
3608         rules/99-systemd.rules
3609
3610 udevconfdir = $(sysconfdir)/udev
3611 dist_udevconf_DATA = \
3612         src/udev/udev.conf
3613
3614 sharepkgconfigdir = $(datadir)/pkgconfig
3615 sharepkgconfig_DATA = \
3616         src/udev/udev.pc
3617
3618 EXTRA_DIST += \
3619         rules/99-systemd.rules.in \
3620         src/udev/udev.pc.in
3621
3622 EXTRA_DIST += \
3623         units/systemd-udevd.service.in \
3624         units/systemd-udev-trigger.service.in \
3625         units/systemd-udev-settle.service.in
3626
3627 SOCKETS_TARGET_WANTS += \
3628         systemd-udevd-control.socket \
3629         systemd-udevd-kernel.socket
3630
3631 SYSINIT_TARGET_WANTS += \
3632         systemd-udevd.service \
3633         systemd-udev-trigger.service
3634
3635 rootbin_PROGRAMS += \
3636         udevadm
3637
3638 rootlibexec_PROGRAMS += \
3639         systemd-udevd
3640
3641 noinst_LTLIBRARIES += \
3642         libudev-core.la
3643
3644 src/udev/keyboard-keys-list.txt:
3645         $(AM_V_at)$(MKDIR_P) $(dir $@)
3646         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
3647
3648 src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys-list.txt
3649         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
3650
3651 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
3652         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
3653
3654 src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys-list.txt
3655         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
3656
3657 gperf_txt_sources += \
3658         src/udev/keyboard-keys-list.txt
3659
3660 libudev_core_la_SOURCES = \
3661         src/udev/udev.h \
3662         src/udev/udev-event.c \
3663         src/udev/udev-watch.c \
3664         src/udev/udev-node.c \
3665         src/udev/udev-rules.c \
3666         src/udev/udev-ctrl.c \
3667         src/udev/udev-builtin.c \
3668         src/udev/udev-builtin-btrfs.c \
3669         src/udev/udev-builtin-hwdb.c \
3670         src/udev/udev-builtin-input_id.c \
3671         src/udev/udev-builtin-keyboard.c \
3672         src/udev/udev-builtin-net_id.c \
3673         src/udev/udev-builtin-net_setup_link.c \
3674         src/udev/udev-builtin-path_id.c \
3675         src/udev/udev-builtin-usb_id.c \
3676         src/udev/net/link-config.h \
3677         src/udev/net/link-config.c \
3678         src/udev/net/ethtool-util.h \
3679         src/udev/net/ethtool-util.c
3680
3681 nodist_libudev_core_la_SOURCES = \
3682         src/udev/keyboard-keys-from-name.h \
3683         src/udev/keyboard-keys-to-name.h \
3684         src/udev/net/link-config-gperf.c
3685
3686 gperf_gperf_sources = \
3687         src/udev/net/link-config-gperf.gperf
3688
3689 libudev_core_la_CFLAGS = \
3690         $(AM_CFLAGS) \
3691         $(BLKID_CFLAGS) \
3692         $(KMOD_CFLAGS)
3693
3694 libudev_core_la_LIBADD = \
3695         libudev-internal.la \
3696         libsystemd-label.la \
3697         libsystemd-internal.la \
3698         libsystemd-network.la \
3699         libsystemd-shared.la \
3700         $(BLKID_LIBS) \
3701         $(KMOD_LIBS)
3702
3703 if HAVE_KMOD
3704 libudev_core_la_SOURCES += \
3705         src/udev/udev-builtin-kmod.c
3706
3707 dist_udevrules_DATA += \
3708         rules/80-drivers.rules
3709 endif
3710
3711 if HAVE_BLKID
3712 libudev_core_la_SOURCES += \
3713         src/udev/udev-builtin-blkid.c
3714 endif
3715
3716 if HAVE_ACL
3717 libudev_core_la_SOURCES += \
3718         src/udev/udev-builtin-uaccess.c \
3719         src/login/logind-acl.c \
3720         src/libsystemd/sd-login/sd-login.c \
3721         src/systemd/sd-login.h
3722
3723 libudev_core_la_LIBADD += \
3724         libsystemd-acl.la
3725 endif
3726
3727 systemd_udevd_SOURCES = \
3728         src/udev/udevd.c
3729
3730 systemd_udevd_LDADD = \
3731         libudev-core.la
3732
3733 udevadm_SOURCES = \
3734         src/udev/udevadm.c \
3735         src/udev/udevadm-info.c \
3736         src/udev/udevadm-control.c \
3737         src/udev/udevadm-monitor.c \
3738         src/udev/udevadm-hwdb.c \
3739         src/udev/udevadm-settle.c \
3740         src/udev/udevadm-trigger.c \
3741         src/udev/udevadm-test.c \
3742         src/udev/udevadm-test-builtin.c \
3743         src/udev/udevadm-util.c \
3744         src/udev/udevadm-util.h
3745
3746 udevadm_LDADD = \
3747         libudev-core.la
3748
3749 # ------------------------------------------------------------------------------
3750 if ENABLE_HWDB
3751 INSTALL_DIRS += \
3752         $(sysconfdir)/udev/hwdb.d
3753
3754 systemd_hwdb_SOURCES = \
3755         src/libsystemd/sd-hwdb/hwdb-internal.h \
3756         src/hwdb/hwdb.c
3757
3758 systemd_hwdb_LDADD = \
3759         libudev-internal.la \
3760         libsystemd-shared.la \
3761         libsystemd-internal.la
3762
3763 rootbin_PROGRAMS += \
3764         systemd-hwdb
3765
3766 dist_udevhwdb_DATA = \
3767         hwdb/20-pci-vendor-model.hwdb \
3768         hwdb/20-pci-classes.hwdb \
3769         hwdb/20-usb-vendor-model.hwdb \
3770         hwdb/20-usb-classes.hwdb \
3771         hwdb/20-sdio-vendor-model.hwdb \
3772         hwdb/20-sdio-classes.hwdb \
3773         hwdb/20-bluetooth-vendor-product.hwdb \
3774         hwdb/20-acpi-vendor.hwdb \
3775         hwdb/20-OUI.hwdb \
3776         hwdb/20-net-ifname.hwdb \
3777         hwdb/60-keyboard.hwdb \
3778         hwdb/70-mouse.hwdb \
3779         hwdb/70-touchpad.hwdb
3780
3781 EXTRA_DIST += \
3782         units/systemd-hwdb-update.service.in \
3783         hwdb/ids-update.pl \
3784         hwdb/sdio.ids
3785
3786 SYSINIT_TARGET_WANTS += \
3787         systemd-hwdb-update.service
3788
3789 # Update hwdb on installation. Do not bother if installing
3790 # in DESTDIR, since this is likely for packaging purposes.
3791 hwdb-update-hook:
3792         -test -n "$(DESTDIR)" || $(rootbindir)/systemd-hwdb update
3793
3794 INSTALL_DATA_HOOKS += \
3795         hwdb-update-hook
3796
3797 hwdb-remove-hook:
3798         -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
3799 endif
3800
3801 # ------------------------------------------------------------------------------
3802 TESTS += \
3803         test/udev-test.pl \
3804         $(NULL)
3805
3806 if HAVE_PYTHON
3807 TESTS += \
3808         test/rule-syntax-check.py \
3809         $(NULL)
3810
3811 endif
3812
3813 manual_tests += \
3814         test-libudev \
3815         test-udev
3816
3817 test_libudev_SOURCES = \
3818         src/test/test-libudev.c
3819
3820 test_libudev_LDADD = \
3821         libsystemd-label.la \
3822         libudev-internal.la \
3823         libsystemd-shared.la \
3824         libsystemd-internal.la
3825
3826 test_udev_SOURCES = \
3827         src/test/test-udev.c
3828
3829 test_udev_LDADD = \
3830         libudev-core.la  \
3831         $(BLKID_LIBS) \
3832         $(KMOD_LIBS) \
3833         $(SELINUX_LIBS)
3834
3835 if HAVE_ACL
3836 test_udev_LDADD += \
3837         libsystemd-acl.la
3838 endif
3839
3840 check_DATA += \
3841         test/sys
3842
3843 # packed sysfs test tree
3844 test/sys:
3845         $(AM_V_at)$(MKDIR_P) $(dir $@)
3846         $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
3847
3848 test-sys-distclean:
3849         -rm -rf test/sys
3850 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
3851
3852 EXTRA_DIST += \
3853         test/sys.tar.xz \
3854         test/udev-test.pl \
3855         test/rule-syntax-check.py \
3856         test/sysv-generator-test.py \
3857         $(NULL)
3858
3859
3860 # ------------------------------------------------------------------------------
3861 ata_id_SOURCES = \
3862         src/udev/ata_id/ata_id.c
3863
3864 ata_id_LDADD = \
3865         libudev-internal.la \
3866         libsystemd-internal.la \
3867         libsystemd-shared.la
3868
3869 udevlibexec_PROGRAMS += \
3870         ata_id
3871
3872 # ------------------------------------------------------------------------------
3873 cdrom_id_SOURCES = \
3874         src/udev/cdrom_id/cdrom_id.c
3875
3876 cdrom_id_LDADD = \
3877         libudev-internal.la \
3878         libsystemd-internal.la \
3879         libsystemd-shared.la
3880
3881 udevlibexec_PROGRAMS += \
3882         cdrom_id
3883
3884 dist_udevrules_DATA += \
3885         rules/60-cdrom_id.rules
3886
3887 # ------------------------------------------------------------------------------
3888 collect_SOURCES = \
3889         src/udev/collect/collect.c
3890
3891 collect_LDADD = \
3892         libudev-internal.la \
3893         libsystemd-internal.la \
3894         libsystemd-shared.la
3895
3896 udevlibexec_PROGRAMS += \
3897         collect
3898
3899 # ------------------------------------------------------------------------------
3900 scsi_id_SOURCES =\
3901         src/udev/scsi_id/scsi_id.c \
3902         src/udev/scsi_id/scsi_serial.c \
3903         src/udev/scsi_id/scsi.h \
3904         src/udev/scsi_id/scsi_id.h
3905
3906 scsi_id_LDADD = \
3907         libudev-internal.la \
3908         libsystemd-internal.la \
3909         libsystemd-shared.la
3910
3911 udevlibexec_PROGRAMS += \
3912         scsi_id
3913
3914 EXTRA_DIST += \
3915         src/udev/scsi_id/README
3916
3917 # ------------------------------------------------------------------------------
3918 v4l_id_SOURCES = \
3919         src/udev/v4l_id/v4l_id.c
3920
3921 v4l_id_LDADD = \
3922         libudev-internal.la \
3923         libsystemd-internal.la \
3924         libsystemd-shared.la
3925
3926 udevlibexec_PROGRAMS += \
3927         v4l_id
3928
3929 dist_udevrules_DATA += \
3930         rules/60-persistent-v4l.rules
3931
3932 # ------------------------------------------------------------------------------
3933 accelerometer_SOURCES = \
3934         src/udev/accelerometer/accelerometer.c
3935
3936 accelerometer_LDADD = \
3937         libudev-internal.la \
3938         libsystemd-internal.la \
3939         libsystemd-shared.la
3940
3941 udevlibexec_PROGRAMS += \
3942         accelerometer
3943
3944 dist_udevrules_DATA += \
3945         rules/61-accelerometer.rules
3946
3947 # ------------------------------------------------------------------------------
3948 if ENABLE_GUDEV
3949 if ENABLE_GTK_DOC
3950 endif
3951
3952 libgudev_includedir = \
3953         $(includedir)/gudev-1.0/gudev
3954
3955 libgudev_include_HEADERS = \
3956         src/gudev/gudev.h \
3957         src/gudev/gudevenums.h \
3958         src/gudev/gudevenumtypes.h \
3959         src/gudev/gudevtypes.h \
3960         src/gudev/gudevclient.h \
3961         src/gudev/gudevdevice.h \
3962         src/gudev/gudevenumerator.h
3963
3964 lib_LTLIBRARIES += libgudev-1.0.la
3965
3966 pkgconfiglib_DATA += \
3967         src/gudev/gudev-1.0.pc
3968
3969 libgudev_1_0_la_SOURCES = \
3970         src/gudev/libgudev-1.0.sym \
3971         src/gudev/gudevenums.h \
3972         src/gudev/gudevenumtypes.h \
3973         src/gudev/gudevenumtypes.h\
3974         src/gudev/gudevtypes.h \
3975         src/gudev/gudevclient.h \
3976         src/gudev/gudevclient.c \
3977         src/gudev/gudevdevice.h \
3978         src/gudev/gudevdevice.c \
3979         src/gudev/gudevenumerator.h \
3980         src/gudev/gudevenumerator.c \
3981         src/gudev/gudevprivate.h
3982
3983 nodist_libgudev_1_0_la_SOURCES = \
3984         src/gudev/gudevmarshal.h \
3985         src/gudev/gudevmarshal.c \
3986         src/gudev/gudevenumtypes.h \
3987         src/gudev/gudevenumtypes.c
3988
3989 BUILT_SOURCES += \
3990         $(nodist_libgudev_1_0_la_SOURCES)
3991
3992 libgudev_1_0_la_CPPFLAGS = \
3993         $(AM_CPPFLAGS) \
3994         -I$(top_builddir)/src\
3995         -I$(top_srcdir)/src\
3996         -I$(top_builddir)/src/gudev \
3997         -I$(top_srcdir)/src/gudev \
3998         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
3999         -D_GUDEV_COMPILATION \
4000         -DG_LOG_DOMAIN=\"GUdev\"
4001
4002 libgudev_1_0_la_CFLAGS = \
4003         $(AM_CFLAGS) \
4004         -fvisibility=default \
4005         $(GLIB_CFLAGS)
4006
4007 libgudev_1_0_la_LIBADD = \
4008         libudev.la \
4009         $(GLIB_LIBS)
4010
4011 libgudev_1_0_la_LDFLAGS = \
4012         $(AM_LDFLAGS) \
4013         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
4014         -export-dynamic \
4015         -no-undefined \
4016         -Wl,--version-script=$(top_srcdir)/src/gudev/libgudev-1.0.sym
4017
4018 src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
4019         $(AM_V_at)$(MKDIR_P) $(dir $@)
4020         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
4021
4022 src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
4023         $(AM_V_at)$(MKDIR_P) $(dir $@)
4024         $(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
4025         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
4026
4027 src/gudev/gudevenumtypes.%: src/gudev/gudevenumtypes.%.template src/gudev/gudevenums.h
4028         $(AM_V_at)$(MKDIR_P) $(dir $@)
4029         $(AM_V_GEN)glib-mkenums --template $^ > $@
4030
4031 if HAVE_INTROSPECTION
4032 -include $(INTROSPECTION_MAKEFILE)
4033
4034 src/gudev/GUdev-1.0.gir: libgudev-1.0.la
4035
4036 src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
4037
4038 src_gudev_GUdev_1_0_gir_CFLAGS = \
4039         $(AM_CFLAGS) \
4040         $(INCLUDES) \
4041         -D_GUDEV_COMPILATION \
4042         -D_GUDEV_WORK_AROUND_DEV_T_BUG \
4043         -I$(top_srcdir)/src \
4044         -I$(top_builddir)/src \
4045         -I$(top_srcdir)/src/gudev \
4046         -I$(top_builddir)/src/gudev
4047
4048 src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
4049
4050 src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
4051         --pkg-export=gudev-1.0 \
4052         --warn-all
4053
4054 src_gudev_GUdev_1_0_gir_FILES = \
4055         src/gudev/gudev.h \
4056         src/gudev/gudevtypes.h \
4057         src/gudev/gudevenums.h \
4058         src/gudev/gudevenumtypes.h \
4059         src/gudev/gudevclient.h \
4060         src/gudev/gudevdevice.h \
4061         src/gudev/gudevenumerator.h \
4062         src/gudev/gudevclient.c \
4063         src/gudev/gudevdevice.c \
4064         src/gudev/gudevenumerator.c
4065
4066 INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
4067 INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
4068
4069 girdir = $(datadir)/gir-1.0
4070 gir_DATA = \
4071         src/gudev/GUdev-1.0.gir
4072
4073 typelibsdir = $(libdir)/girepository-1.0
4074 typelibs_DATA = \
4075         src/gudev/GUdev-1.0.typelib
4076
4077 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
4078 endif # HAVE_INTROSPECTION
4079 endif
4080
4081 EXTRA_DIST += \
4082         src/gudev/gudev-1.0.pc.in \
4083         src/gudev/gudevmarshal.list \
4084         src/gudev/gudevenumtypes.h.template \
4085         src/gudev/gudevenumtypes.c.template \
4086         src/gudev/gjs-example.js \
4087         src/gudev/seed-example-enum.js \
4088         src/gudev/seed-example.js
4089
4090 # ------------------------------------------------------------------------------
4091 mtd_probe_SOURCES =  \
4092         src/udev/mtd_probe/mtd_probe.c \
4093         src/udev/mtd_probe/mtd_probe.h \
4094         src/udev/mtd_probe/probe_smartmedia.c
4095
4096 dist_udevrules_DATA += \
4097         rules/75-probe_mtd.rules
4098
4099 udevlibexec_PROGRAMS += \
4100         mtd_probe
4101
4102 # ------------------------------------------------------------------------------
4103 test_id128_SOURCES = \
4104         src/test/test-id128.c
4105
4106 test_id128_LDADD = \
4107         libsystemd-internal.la \
4108         libsystemd-shared.la
4109
4110 tests += \
4111         test-id128
4112
4113 # ------------------------------------------------------------------------------
4114
4115 rootlibexec_PROGRAMS += \
4116         systemd-activate
4117
4118 systemd_activate_SOURCES = \
4119         src/activate/activate.c
4120
4121 systemd_activate_LDADD = \
4122         libsystemd-label.la \
4123         libsystemd-internal.la \
4124         libsystemd-shared.la
4125
4126 # ------------------------------------------------------------------------------
4127 systemd_journald_SOURCES = \
4128         src/journal/journald.c \
4129         src/journal/journald-server.h
4130
4131 systemd_journald_LDADD = \
4132         libsystemd-journal-core.la \
4133         libsystemd-internal.la \
4134         libsystemd-shared.la
4135
4136 systemd_cat_SOURCES = \
4137         src/journal/cat.c
4138
4139 systemd_cat_LDADD = \
4140         libsystemd-journal-core.la
4141
4142 if HAVE_MICROHTTPD
4143 rootlibexec_PROGRAMS += \
4144         systemd-journal-remote
4145
4146 systemd_journal_remote_SOURCES = \
4147         src/journal-remote/journal-remote-parse.h \
4148         src/journal-remote/journal-remote-parse.c \
4149         src/journal-remote/journal-remote-write.h \
4150         src/journal-remote/journal-remote-write.c \
4151         src/journal-remote/journal-remote.h \
4152         src/journal-remote/journal-remote.c
4153
4154 systemd_journal_remote_LDADD = \
4155         libsystemd-internal.la \
4156         libsystemd-journal-core.la
4157
4158 systemd_journal_remote_SOURCES += \
4159         src/journal-remote/microhttpd-util.h \
4160         src/journal-remote/microhttpd-util.c
4161
4162 systemd_journal_remote_CFLAGS = \
4163         $(AM_CFLAGS) \
4164         $(MICROHTTPD_CFLAGS)
4165
4166 systemd_journal_remote_LDADD += \
4167         $(MICROHTTPD_LIBS)
4168
4169 if ENABLE_SYSUSERS
4170 dist_sysusers_DATA += \
4171         sysusers.d/systemd-remote.conf
4172 endif
4173
4174 if ENABLE_TMPFILES
4175 dist_tmpfiles_DATA += \
4176         tmpfiles.d/systemd-remote.conf
4177 endif
4178
4179 if HAVE_GNUTLS
4180 systemd_journal_remote_LDADD += \
4181         $(GNUTLS_LIBS)
4182
4183 # systemd-journal-remote make sense mostly with full crypto stack
4184 dist_systemunit_DATA += \
4185         units/systemd-journal-remote.socket
4186
4187 nodist_systemunit_DATA += \
4188         units/systemd-journal-remote.service
4189
4190 EXTRA_DIST += \
4191         units/systemd-journal-remote.service.in
4192
4193 journal-remote-install-hook: journal-install-hook
4194         -$(MKDIR_P) $(DESTDIR)/var/log/journal/remote
4195         -chown 0:0 $(DESTDIR)/var/log/journal/remote
4196         -chmod 755 $(DESTDIR)/var/log/journal/remote
4197
4198 INSTALL_EXEC_HOOKS += journal-remote-install-hook
4199
4200 endif
4201
4202 nodist_pkgsysconf_DATA += \
4203         src/journal-remote/journal-remote.conf
4204
4205 EXTRA_DIST += \
4206         src/journal-remote/journal-remote.conf.in
4207
4208 endif
4209
4210 if HAVE_LIBCURL
4211 rootlibexec_PROGRAMS += \
4212         systemd-journal-upload
4213
4214 systemd_journal_upload_SOURCES = \
4215         src/journal-remote/journal-upload.h \
4216         src/journal-remote/journal-upload.c \
4217         src/journal-remote/journal-upload-journal.c
4218
4219 systemd_journal_upload_CFLAGS = \
4220         $(AM_CFLAGS) \
4221         $(LIBCURL_CFLAGS)
4222
4223 systemd_journal_upload_LDADD = \
4224         libsystemd-internal.la \
4225         libsystemd-journal-internal.la \
4226         libsystemd-shared.la \
4227         $(LIBCURL_LIBS)
4228
4229 nodist_systemunit_DATA += \
4230         units/systemd-journal-upload.service
4231
4232 EXTRA_DIST += \
4233         units/systemd-journal-upload.service.in
4234
4235 nodist_pkgsysconf_DATA += \
4236         src/journal-remote/journal-upload.conf
4237
4238 EXTRA_DIST += \
4239         src/journal-remote/journal-upload.conf.in
4240 endif
4241
4242 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
4243 journalctl_CFLAGS = \
4244         $(AM_CFLAGS)
4245
4246 journalctl_SOURCES = \
4247         src/journal/journalctl.c
4248
4249 journalctl_LDADD = \
4250         libsystemd-journal-internal.la \
4251         libsystemd-internal.la \
4252         libsystemd-logs.la \
4253         libsystemd-shared.la
4254
4255 if HAVE_ACL
4256 journalctl_LDADD += \
4257         libsystemd-acl.la
4258 endif
4259
4260 if HAVE_QRENCODE
4261 journalctl_SOURCES += \
4262         src/journal/journal-qrcode.c \
4263         src/journal/journal-qrcode.h
4264
4265 journalctl_CFLAGS += \
4266         $(QRENCODE_CFLAGS)
4267
4268 journalctl_LDADD += \
4269         $(QRENCODE_LIBS)
4270 endif
4271
4272 test_journal_SOURCES = \
4273         src/journal/test-journal.c
4274
4275 test_journal_LDADD = \
4276         libsystemd-journal-core.la
4277
4278 test_journal_send_SOURCES = \
4279         src/journal/test-journal-send.c
4280
4281 test_journal_send_LDADD = \
4282         libsystemd-journal-core.la
4283
4284 test_journal_syslog_SOURCES = \
4285         src/journal/test-journal-syslog.c
4286
4287 test_journal_syslog_LDADD = \
4288         libsystemd-journal-core.la
4289
4290 test_journal_match_SOURCES = \
4291         src/journal/test-journal-match.c
4292
4293 test_journal_match_LDADD = \
4294         libsystemd-journal-core.la
4295
4296 test_journal_enum_SOURCES = \
4297         src/journal/test-journal-enum.c
4298
4299 test_journal_enum_LDADD = \
4300         libsystemd-journal-core.la
4301
4302 test_journal_stream_SOURCES = \
4303         src/journal/test-journal-stream.c
4304
4305 test_journal_stream_LDADD = \
4306         libsystemd-journal-core.la
4307
4308 test_journal_flush_SOURCES = \
4309         src/journal/test-journal-flush.c
4310
4311 test_journal_flush_LDADD = \
4312         libsystemd-journal-core.la
4313
4314 test_journal_init_SOURCES = \
4315         src/journal/test-journal-init.c
4316
4317 test_journal_init_LDADD = \
4318         libsystemd-journal-core.la
4319
4320 test_journal_verify_SOURCES = \
4321         src/journal/test-journal-verify.c
4322
4323 test_journal_verify_LDADD = \
4324         libsystemd-journal-core.la
4325
4326 test_journal_interleaving_SOURCES = \
4327         src/journal/test-journal-interleaving.c
4328
4329 test_journal_interleaving_LDADD = \
4330         libsystemd-journal-core.la
4331
4332 test_mmap_cache_SOURCES = \
4333         src/journal/test-mmap-cache.c
4334
4335 test_mmap_cache_LDADD = \
4336         libsystemd-journal-core.la
4337
4338 test_catalog_SOURCES = \
4339         src/journal/test-catalog.c
4340
4341 test_catalog_CPPFLAGS = \
4342         $(AM_CPPFLAGS) \
4343         -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
4344
4345 test_catalog_LDADD = \
4346         libsystemd-journal-core.la
4347
4348 test_compress_SOURCES = \
4349         src/journal/test-compress.c
4350
4351 test_compress_LDADD = \
4352         libsystemd-journal-internal.la \
4353         libsystemd-shared.la
4354
4355 test_compress_benchmark_SOURCES = \
4356         src/journal/test-compress-benchmark.c
4357
4358 test_compress_benchmark_LDADD = \
4359         libsystemd-journal-internal.la \
4360         libsystemd-shared.la
4361
4362 libsystemd_journal_core_la_SOURCES = \
4363         src/journal/journald-kmsg.c \
4364         src/journal/journald-kmsg.h \
4365         src/journal/journald-syslog.c \
4366         src/journal/journald-syslog.h \
4367         src/journal/journald-stream.c \
4368         src/journal/journald-stream.h \
4369         src/journal/journald-server.c \
4370         src/journal/journald-server.h \
4371         src/journal/journald-console.c \
4372         src/journal/journald-console.h \
4373         src/journal/journald-wall.c \
4374         src/journal/journald-wall.h \
4375         src/journal/journald-native.c \
4376         src/journal/journald-native.h \
4377         src/journal/journald-audit.c \
4378         src/journal/journald-audit.h \
4379         src/journal/journald-rate-limit.c \
4380         src/journal/journald-rate-limit.h \
4381         src/journal/journal-internal.h
4382
4383 nodist_libsystemd_journal_core_la_SOURCES = \
4384         src/journal/journald-gperf.c
4385
4386 libsystemd_journal_core_la_LIBADD = \
4387         libsystemd-journal-internal.la \
4388         libudev-internal.la \
4389         libsystemd-label.la \
4390         libsystemd-internal.la \
4391         libsystemd-shared.la
4392
4393 if HAVE_ACL
4394 libsystemd_journal_core_la_LIBADD += \
4395         libsystemd-acl.la
4396 endif
4397
4398 noinst_LTLIBRARIES += \
4399         libsystemd-journal-core.la
4400
4401 journal-install-hook:
4402         -$(MKDIR_P) $(DESTDIR)/var/log/journal
4403         -chown 0:0 $(DESTDIR)/var/log/journal
4404         -chmod 755 $(DESTDIR)/var/log/journal
4405         -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
4406         -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
4407
4408 journal-uninstall-hook:
4409         -rmdir $(DESTDIR)/var/log/journal/remote
4410         -rmdir $(DESTDIR)/var/log/journal/
4411
4412 INSTALL_EXEC_HOOKS += journal-install-hook
4413 UNINSTALL_EXEC_HOOKS += journal-uninstall-hook
4414
4415 # ------------------------------------------------------------------------------
4416 # Update catalog on installation. Do not bother if installing
4417 # in DESTDIR, since this is likely for packaging purposes.
4418 catalog-update-hook:
4419         -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
4420
4421 INSTALL_DATA_HOOKS += \
4422         catalog-update-hook
4423
4424 catalog-remove-hook:
4425         -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
4426
4427 UNINSTALL_DATA_HOOKS += \
4428         catalog-remove-hook
4429
4430 manual_tests += \
4431         test-journal-enum
4432
4433 tests += \
4434         test-journal \
4435         test-journal-send \
4436         test-journal-syslog \
4437         test-journal-match \
4438         test-journal-stream \
4439         test-journal-init \
4440         test-journal-verify \
4441         test-journal-interleaving \
4442         test-journal-flush \
4443         test-mmap-cache \
4444         test-catalog
4445
4446 if HAVE_COMPRESSION
4447 tests += \
4448         test-compress \
4449         test-compress-benchmark
4450 endif
4451
4452 pkginclude_HEADERS += \
4453         src/systemd/sd-journal.h \
4454         src/systemd/sd-messages.h \
4455         src/systemd/_sd-common.h
4456
4457 libsystemd_journal_internal_la_SOURCES = \
4458         src/journal/sd-journal.c \
4459         src/systemd/sd-journal.h \
4460         src/systemd/_sd-common.h \
4461         src/journal/journal-file.c \
4462         src/journal/journal-file.h \
4463         src/journal/journal-vacuum.c \
4464         src/journal/journal-vacuum.h \
4465         src/journal/journal-verify.c \
4466         src/journal/journal-verify.h \
4467         src/journal/lookup3.c \
4468         src/journal/lookup3.h \
4469         src/journal/journal-send.c \
4470         src/journal/journal-def.h \
4471         src/journal/compress.h \
4472         src/journal/catalog.c \
4473         src/journal/catalog.h \
4474         src/journal/mmap-cache.c \
4475         src/journal/mmap-cache.h \
4476         src/journal/compress.c
4477
4478 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
4479 libsystemd_journal_internal_la_CFLAGS = \
4480         $(AM_CFLAGS)
4481
4482 libsystemd_journal_internal_la_LIBADD = \
4483         libsystemd-label.la
4484
4485 if HAVE_XZ
4486 libsystemd_journal_internal_la_CFLAGS += \
4487         $(XZ_CFLAGS)
4488
4489 libsystemd_journal_internal_la_LIBADD += \
4490         $(XZ_LIBS)
4491 endif
4492
4493 if HAVE_LZ4
4494 libsystemd_journal_internal_la_LIBADD += \
4495         -llz4
4496 endif
4497
4498 if HAVE_GCRYPT
4499 libsystemd_journal_internal_la_SOURCES += \
4500         src/journal/journal-authenticate.c \
4501         src/journal/journal-authenticate.h \
4502         src/journal/fsprg.c \
4503         src/journal/fsprg.h
4504
4505 libsystemd_journal_internal_la_LIBADD += \
4506         $(GCRYPT_LIBS)
4507
4508 # fsprg.c is a drop-in file using void pointer arithmetic
4509 libsystemd_journal_internal_la_CFLAGS += \
4510         $(GCRYPT_CFLAGS) \
4511         -Wno-pointer-arith
4512 endif
4513
4514 noinst_LTLIBRARIES += \
4515         libsystemd-journal-internal.la
4516
4517 rootlibexec_PROGRAMS += \
4518         systemd-journald
4519
4520 rootbin_PROGRAMS += \
4521         journalctl
4522
4523 bin_PROGRAMS += \
4524         systemd-cat
4525
4526 dist_systemunit_DATA += \
4527         units/systemd-journald.socket \
4528         units/systemd-journald-dev-log.socket \
4529         units/systemd-journald-audit.socket
4530
4531 nodist_systemunit_DATA += \
4532         units/systemd-journald.service \
4533         units/systemd-journal-flush.service \
4534         units/systemd-journal-catalog-update.service
4535
4536 dist_pkgsysconf_DATA += \
4537         src/journal/journald.conf
4538
4539 dist_catalog_DATA = \
4540         catalog/systemd.fr.catalog \
4541         catalog/systemd.it.catalog \
4542         catalog/systemd.pl.catalog \
4543         catalog/systemd.pt_BR.catalog \
4544         catalog/systemd.ru.catalog \
4545         catalog/systemd.catalog
4546
4547 SOCKETS_TARGET_WANTS += \
4548         systemd-journald.socket \
4549         systemd-journald-dev-log.socket \
4550         systemd-journald-audit.socket
4551
4552 SYSINIT_TARGET_WANTS += \
4553         systemd-journald.service \
4554         systemd-journal-flush.service \
4555         systemd-journal-catalog-update.service
4556
4557 EXTRA_DIST += \
4558         units/systemd-journald.service.in \
4559         units/systemd-journal-flush.service.in \
4560         units/systemd-journal-catalog-update.service.in
4561
4562 gperf_gperf_sources += \
4563         src/journal/journald-gperf.gperf
4564
4565 # ------------------------------------------------------------------------------
4566 if HAVE_MICROHTTPD
4567 gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
4568
4569 rootlibexec_PROGRAMS += \
4570         systemd-journal-gatewayd
4571
4572 systemd_journal_gatewayd_SOURCES = \
4573         src/journal-remote/journal-gatewayd.c \
4574         src/journal-remote/microhttpd-util.h \
4575         src/journal-remote/microhttpd-util.c
4576
4577 systemd_journal_gatewayd_LDADD = \
4578         libsystemd-logs.la \
4579         libsystemd-journal-internal.la \
4580         libsystemd-internal.la \
4581         libsystemd-shared.la \
4582         $(MICROHTTPD_LIBS)
4583
4584 if HAVE_GNUTLS
4585 systemd_journal_gatewayd_LDADD += \
4586         $(GNUTLS_LIBS)
4587 endif
4588
4589 systemd_journal_gatewayd_CFLAGS = \
4590         $(AM_CFLAGS) \
4591         $(MICROHTTPD_CFLAGS)
4592
4593 systemd_journal_gatewayd_CPPFLAGS = \
4594         $(AM_CPPFLAGS) \
4595         -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
4596
4597 dist_systemunit_DATA += \
4598         units/systemd-journal-gatewayd.socket
4599
4600 nodist_systemunit_DATA += \
4601         units/systemd-journal-gatewayd.service
4602
4603 dist_gatewayddocumentroot_DATA = \
4604         src/journal-remote/browse.html
4605
4606 endif
4607
4608 EXTRA_DIST += \
4609         units/systemd-journal-gatewayd.service.in
4610
4611 # ------------------------------------------------------------------------------
4612
4613 systemd_socket_proxyd_SOURCES = \
4614         src/socket-proxy/socket-proxyd.c
4615
4616 systemd_socket_proxyd_LDADD = \
4617         libsystemd-logs.la \
4618         libsystemd-internal.la \
4619         libsystemd-journal-internal.la \
4620         libsystemd-shared.la \
4621         libsystemd-resolve.la
4622
4623 # ------------------------------------------------------------------------------
4624 if ENABLE_COREDUMP
4625 systemd_coredump_SOURCES = \
4626         src/journal/coredump.c \
4627         src/journal/coredump-vacuum.c \
4628         src/journal/coredump-vacuum.h
4629
4630 systemd_coredump_LDADD = \
4631         libsystemd-journal-internal.la \
4632         libsystemd-label.la \
4633         libsystemd-internal.la \
4634         libsystemd-shared.la
4635
4636 if HAVE_ELFUTILS
4637 systemd_coredump_SOURCES += \
4638         src/journal/stacktrace.c \
4639         src/journal/stacktrace.h
4640
4641 systemd_coredump_LDADD += \
4642         $(ELFUTILS_LIBS)
4643 endif
4644
4645 rootlibexec_PROGRAMS += \
4646         systemd-coredump
4647
4648 dist_pkgsysconf_DATA += \
4649         src/journal/coredump.conf
4650
4651 if HAVE_ACL
4652 systemd_coredump_LDADD += \
4653         libsystemd-acl.la
4654 endif
4655
4656 coredumpctl_SOURCES = \
4657         src/journal/coredumpctl.c
4658
4659 coredumpctl_LDADD = \
4660         libsystemd-journal-internal.la \
4661         libsystemd-internal.la \
4662         libsystemd-shared.la
4663
4664 bin_PROGRAMS += \
4665         coredumpctl
4666
4667 manual_tests += \
4668         test-coredump-vacuum
4669
4670 test_coredump_vacuum_SOURCES = \
4671         src/journal/test-coredump-vacuum.c  \
4672         src/journal/coredump-vacuum.c \
4673         src/journal/coredump-vacuum.h
4674
4675 test_coredump_vacuum_LDADD = \
4676         libsystemd-internal.la \
4677         libsystemd-shared.la
4678
4679 dist_bashcompletion_DATA += \
4680         shell-completion/bash/coredumpctl
4681
4682 dist_zshcompletion_DATA += \
4683         shell-completion/zsh/_coredumpctl
4684
4685 nodist_sysctl_DATA = \
4686         sysctl.d/50-coredump.conf
4687
4688 CLEANFILES += \
4689         sysctl.d/50-coredump.conf
4690 endif
4691
4692 EXTRA_DIST += \
4693         sysctl.d/50-coredump.conf.in
4694
4695 # ------------------------------------------------------------------------------
4696 if ENABLE_BINFMT
4697 systemd_binfmt_SOURCES = \
4698         src/binfmt/binfmt.c
4699
4700 systemd_binfmt_LDADD = \
4701         libsystemd-shared.la
4702
4703 rootlibexec_PROGRAMS += \
4704         systemd-binfmt
4705
4706 dist_systemunit_DATA += \
4707         units/proc-sys-fs-binfmt_misc.automount \
4708         units/proc-sys-fs-binfmt_misc.mount
4709
4710 nodist_systemunit_DATA += \
4711         units/systemd-binfmt.service
4712
4713 INSTALL_DIRS += \
4714         $(prefix)/lib/binfmt.d \
4715         $(sysconfdir)/binfmt.d
4716
4717 SYSINIT_TARGET_WANTS += \
4718         systemd-binfmt.service \
4719         proc-sys-fs-binfmt_misc.automount
4720
4721 endif
4722
4723 EXTRA_DIST += \
4724         units/systemd-binfmt.service.in
4725
4726 # ------------------------------------------------------------------------------
4727 if ENABLE_VCONSOLE
4728 systemd_vconsole_setup_SOURCES = \
4729         src/vconsole/vconsole-setup.c
4730
4731 systemd_vconsole_setup_LDADD = \
4732         libsystemd-shared.la
4733
4734 rootlibexec_PROGRAMS += \
4735         systemd-vconsole-setup
4736
4737 nodist_udevrules_DATA += \
4738         src/vconsole/90-vconsole.rules
4739
4740 nodist_systemunit_DATA += \
4741         units/systemd-vconsole-setup.service
4742
4743 SYSINIT_TARGET_WANTS += \
4744         systemd-vconsole-setup.service
4745 endif
4746
4747 EXTRA_DIST += \
4748         src/vconsole/90-vconsole.rules.in \
4749         units/systemd-vconsole-setup.service.in
4750
4751 # ------------------------------------------------------------------------------
4752 if ENABLE_BOOTCHART
4753 systemd_bootchart_SOURCES = \
4754         src/bootchart/bootchart.c \
4755         src/bootchart/bootchart.h \
4756         src/bootchart/store.c \
4757         src/bootchart/store.h \
4758         src/bootchart/svg.c \
4759         src/bootchart/svg.h
4760
4761 systemd_bootchart_LDADD = \
4762         libsystemd-journal-internal.la \
4763         libsystemd-shared.la
4764
4765 rootlibexec_PROGRAMS += \
4766         systemd-bootchart
4767
4768 dist_pkgsysconf_DATA += \
4769         src/bootchart/bootchart.conf
4770
4771 nodist_systemunit_DATA += \
4772         units/systemd-bootchart.service
4773
4774 EXTRA_DIST += \
4775         units/systemd-bootchart.service.in
4776 endif
4777
4778 # ------------------------------------------------------------------------------
4779 if ENABLE_QUOTACHECK
4780 rootlibexec_PROGRAMS += \
4781         systemd-quotacheck
4782
4783 nodist_systemunit_DATA += \
4784         units/systemd-quotacheck.service
4785
4786 systemd_quotacheck_SOURCES = \
4787         src/quotacheck/quotacheck.c
4788
4789 systemd_quotacheck_LDADD = \
4790         libsystemd-shared.la
4791 endif
4792
4793 EXTRA_DIST += \
4794         units/systemd-quotacheck.service.in
4795
4796 nodist_systemunit_DATA += \
4797         units/quotaon.service
4798
4799 # ------------------------------------------------------------------------------
4800 if ENABLE_RANDOMSEED
4801 rootlibexec_PROGRAMS += \
4802         systemd-random-seed
4803
4804 nodist_systemunit_DATA += \
4805         units/systemd-random-seed.service
4806
4807 systemd_random_seed_SOURCES = \
4808         src/random-seed/random-seed.c
4809
4810 systemd_random_seed_LDADD = \
4811         libsystemd-label.la \
4812         libsystemd-shared.la
4813
4814 SYSINIT_TARGET_WANTS += \
4815         systemd-random-seed.service
4816
4817 endif
4818
4819 EXTRA_DIST += \
4820         units/systemd-random-seed.service.in
4821
4822 # ------------------------------------------------------------------------------
4823 if ENABLE_BACKLIGHT
4824 rootlibexec_PROGRAMS += \
4825         systemd-backlight
4826
4827 nodist_systemunit_DATA += \
4828         units/systemd-backlight@.service
4829
4830 systemd_backlight_SOURCES = \
4831         src/backlight/backlight.c
4832
4833 systemd_backlight_LDADD = \
4834         libsystemd-label.la \
4835         libudev-internal.la \
4836         libsystemd-internal.la \
4837         libsystemd-shared.la
4838 endif
4839
4840 EXTRA_DIST += \
4841         units/systemd-backlight@.service.in
4842
4843 # ------------------------------------------------------------------------------
4844 if ENABLE_RFKILL
4845 rootlibexec_PROGRAMS += \
4846         systemd-rfkill
4847
4848 nodist_systemunit_DATA += \
4849         units/systemd-rfkill@.service
4850
4851 systemd_rfkill_SOURCES = \
4852         src/rfkill/rfkill.c
4853
4854 systemd_rfkill_LDADD = \
4855         libsystemd-label.la \
4856         libudev-internal.la \
4857         libsystemd-internal.la \
4858         libsystemd-shared.la
4859 endif
4860
4861 EXTRA_DIST += \
4862         units/systemd-rfkill@.service.in
4863
4864 # ------------------------------------------------------------------------------
4865 if HAVE_LIBCRYPTSETUP
4866 rootlibexec_PROGRAMS += \
4867         systemd-cryptsetup
4868
4869 systemgenerator_PROGRAMS += \
4870         systemd-cryptsetup-generator
4871
4872 dist_systemunit_DATA += \
4873         units/cryptsetup.target \
4874         units/cryptsetup-pre.target
4875
4876 systemd_cryptsetup_SOURCES = \
4877         src/cryptsetup/cryptsetup.c
4878
4879 systemd_cryptsetup_CFLAGS = \
4880         $(AM_CFLAGS) \
4881         $(LIBCRYPTSETUP_CFLAGS)
4882
4883 systemd_cryptsetup_LDADD = \
4884         libsystemd-label.la \
4885         libudev-internal.la \
4886         libsystemd-internal.la \
4887         libsystemd-shared.la \
4888         $(LIBCRYPTSETUP_LIBS)
4889
4890 systemd_cryptsetup_generator_SOURCES = \
4891         src/cryptsetup/cryptsetup-generator.c
4892
4893 systemd_cryptsetup_generator_LDADD = \
4894         libsystemd-label.la \
4895         libsystemd-shared.la
4896
4897 SYSINIT_TARGET_WANTS += \
4898         cryptsetup.target
4899
4900 endif
4901
4902 # ------------------------------------------------------------------------------
4903 if ENABLE_HOSTNAMED
4904 systemd_hostnamed_SOURCES = \
4905         src/hostname/hostnamed.c
4906
4907 systemd_hostnamed_LDADD = \
4908         libsystemd-label.la \
4909         libsystemd-internal.la \
4910         libsystemd-shared.la
4911
4912 rootlibexec_PROGRAMS += \
4913         systemd-hostnamed
4914
4915 nodist_systemunit_DATA += \
4916         units/systemd-hostnamed.service
4917
4918 dist_systemunit_DATA_busnames += \
4919         units/org.freedesktop.hostname1.busname
4920
4921 dist_dbuspolicy_DATA += \
4922         src/hostname/org.freedesktop.hostname1.conf
4923
4924 dist_dbussystemservice_DATA += \
4925         src/hostname/org.freedesktop.hostname1.service
4926
4927 polkitpolicy_files += \
4928         src/hostname/org.freedesktop.hostname1.policy
4929
4930 SYSTEM_UNIT_ALIASES += \
4931         systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
4932
4933 BUSNAMES_TARGET_WANTS += \
4934         org.freedesktop.hostname1.busname
4935
4936 hostnamectl_SOURCES = \
4937         src/hostname/hostnamectl.c
4938
4939 hostnamectl_LDADD = \
4940         libsystemd-internal.la \
4941         libsystemd-shared.la
4942
4943 bin_PROGRAMS += \
4944         hostnamectl
4945
4946 dist_bashcompletion_DATA += \
4947         shell-completion/bash/hostnamectl
4948
4949 dist_zshcompletion_DATA += \
4950         shell-completion/zsh/_hostnamectl
4951
4952 endif
4953
4954 polkitpolicy_in_files += \
4955         src/hostname/org.freedesktop.hostname1.policy.in
4956
4957 EXTRA_DIST += \
4958         units/systemd-hostnamed.service.in
4959
4960 # ------------------------------------------------------------------------------
4961 dist_systemunit_DATA_busnames += \
4962         units/org.freedesktop.systemd1.busname
4963
4964 BUSNAMES_TARGET_WANTS += \
4965         org.freedesktop.systemd1.busname
4966
4967 # ------------------------------------------------------------------------------
4968 if ENABLE_LOCALED
4969 systemd_localed_SOURCES = \
4970         src/locale/localed.c
4971
4972 systemd_localed_LDADD = \
4973         libsystemd-label.la \
4974         libsystemd-internal.la \
4975         libsystemd-shared.la \
4976         $(XKBCOMMON_LIBS)
4977
4978 systemd_localed_CFLAGS = \
4979         $(AM_CFLAGS) \
4980         $(XKBCOMMON_CFLAGS)
4981
4982 nodist_systemunit_DATA += \
4983         units/systemd-localed.service
4984
4985 dist_systemunit_DATA_busnames += \
4986         units/org.freedesktop.locale1.busname
4987
4988 rootlibexec_PROGRAMS += \
4989         systemd-localed
4990
4991 dist_dbuspolicy_DATA += \
4992         src/locale/org.freedesktop.locale1.conf
4993
4994 dist_dbussystemservice_DATA += \
4995         src/locale/org.freedesktop.locale1.service
4996
4997 polkitpolicy_files += \
4998         src/locale/org.freedesktop.locale1.policy
4999
5000 SYSTEM_UNIT_ALIASES += \
5001         systemd-localed.service dbus-org.freedesktop.locale1.service
5002
5003 BUSNAMES_TARGET_WANTS += \
5004         org.freedesktop.locale1.busname
5005
5006 dist_pkgdata_DATA += \
5007         src/locale/kbd-model-map \
5008         src/locale/language-fallback-map
5009
5010 localectl_SOURCES = \
5011         src/locale/localectl.c
5012
5013 localectl_LDADD = \
5014         libsystemd-internal.la \
5015         libsystemd-shared.la
5016
5017 bin_PROGRAMS += \
5018         localectl
5019
5020 dist_bashcompletion_DATA += \
5021         shell-completion/bash/localectl
5022
5023 dist_zshcompletion_DATA += \
5024         shell-completion/zsh/_localectl
5025
5026 endif
5027
5028 .PHONY: update-kbd-model-map
5029
5030 polkitpolicy_in_files += \
5031         src/locale/org.freedesktop.locale1.policy.in
5032
5033 EXTRA_DIST += \
5034         units/systemd-localed.service.in
5035
5036 # ------------------------------------------------------------------------------
5037 if ENABLE_TIMEDATED
5038 systemd_timedated_SOURCES = \
5039         src/timedate/timedated.c
5040
5041 systemd_timedated_LDADD = \
5042         libsystemd-label.la \
5043         libsystemd-internal.la \
5044         libsystemd-shared.la
5045
5046 rootlibexec_PROGRAMS += \
5047         systemd-timedated
5048
5049 dist_dbussystemservice_DATA += \
5050         src/timedate/org.freedesktop.timedate1.service
5051
5052 dist_dbuspolicy_DATA += \
5053         src/timedate/org.freedesktop.timedate1.conf
5054
5055 nodist_systemunit_DATA += \
5056         units/systemd-timedated.service
5057
5058 dist_systemunit_DATA_busnames += \
5059         units/org.freedesktop.timedate1.busname
5060
5061 polkitpolicy_files += \
5062         src/timedate/org.freedesktop.timedate1.policy
5063
5064 SYSTEM_UNIT_ALIASES += \
5065         systemd-timedated.service dbus-org.freedesktop.timedate1.service
5066
5067 BUSNAMES_TARGET_WANTS += \
5068         org.freedesktop.timedate1.busname
5069
5070 timedatectl_SOURCES = \
5071         src/timedate/timedatectl.c
5072
5073 timedatectl_LDADD = \
5074         libsystemd-internal.la \
5075         libsystemd-shared.la
5076
5077 bin_PROGRAMS += \
5078         timedatectl
5079
5080 dist_bashcompletion_DATA += \
5081         shell-completion/bash/timedatectl
5082
5083 dist_zshcompletion_DATA += \
5084         shell-completion/zsh/_timedatectl
5085 endif
5086
5087 polkitpolicy_in_files += \
5088         src/timedate/org.freedesktop.timedate1.policy.in
5089
5090 EXTRA_DIST += \
5091         units/systemd-timedated.service.in
5092
5093 # ------------------------------------------------------------------------------
5094 if ENABLE_TIMESYNCD
5095 systemd_timesyncd_SOURCES = \
5096         src/timesync/timesyncd.c \
5097         src/timesync/timesyncd-manager.c \
5098         src/timesync/timesyncd-manager.h \
5099         src/timesync/timesyncd-conf.c \
5100         src/timesync/timesyncd-conf.h \
5101         src/timesync/timesyncd-server.c \
5102         src/timesync/timesyncd-server.h
5103
5104 nodist_systemd_timesyncd_SOURCES = \
5105         src/timesync/timesyncd-gperf.c
5106
5107 gperf_gperf_sources += \
5108         src/timesync/timesyncd-gperf.gperf
5109
5110 systemd_timesyncd_LDADD = \
5111         libsystemd-resolve.la \
5112         libsystemd-network.la \
5113         libsystemd-label.la \
5114         libsystemd-internal.la \
5115         libsystemd-shared.la
5116
5117 rootlibexec_PROGRAMS += \
5118         systemd-timesyncd
5119
5120 nodist_systemunit_DATA += \
5121         units/systemd-timesyncd.service
5122
5123 GENERAL_ALIASES += \
5124         $(systemunitdir)/systemd-timesyncd.service $(pkgsysconfdir)/system/sysinit.target.wants/systemd-timesyncd.service
5125
5126 EXTRA_DIST += \
5127         units/systemd-timesyncd.service.in
5128
5129 nodist_pkgsysconf_DATA += \
5130         src/timesync/timesyncd.conf
5131
5132 EXTRA_DIST += \
5133         src/timesync/timesyncd.conf.in
5134 endif
5135
5136 # ------------------------------------------------------------------------------
5137 if HAVE_MYHOSTNAME
5138 libnss_myhostname_la_SOURCES = \
5139         src/nss-myhostname/nss-myhostname.sym \
5140         src/nss-myhostname/nss-myhostname.c
5141
5142 libnss_myhostname_la_LDFLAGS = \
5143         $(AM_LDFLAGS) \
5144         -module \
5145         -export-dynamic \
5146         -avoid-version \
5147         -shared \
5148         -shrext .so.2 \
5149         -Wl,--version-script=$(top_srcdir)/src/nss-myhostname/nss-myhostname.sym
5150
5151 libnss_myhostname_la_LIBADD = \
5152         libsystemd-shared.la \
5153         libsystemd-internal.la
5154
5155 lib_LTLIBRARIES += \
5156         libnss_myhostname.la
5157 endif
5158
5159 # ------------------------------------------------------------------------------
5160 if ENABLE_MACHINED
5161 systemd_machined_SOURCES = \
5162         src/machine/machined.c \
5163         src/machine/machined.h
5164
5165 systemd_machined_LDADD = \
5166         libsystemd-machine-core.la
5167
5168 rootlibexec_PROGRAMS += \
5169         systemd-machined
5170
5171 libsystemd_machine_core_la_SOURCES = \
5172         src/machine/machine.c \
5173         src/machine/machine.h \
5174         src/machine/machined-dbus.c \
5175         src/machine/machine-dbus.c \
5176         src/machine/machine-dbus.h \
5177         src/machine/image-dbus.c \
5178         src/machine/image-dbus.h
5179
5180 libsystemd_machine_core_la_LIBADD = \
5181         libsystemd-label.la \
5182         libudev-internal.la \
5183         libsystemd-internal.la \
5184         libsystemd-shared.la
5185
5186 noinst_LTLIBRARIES += \
5187         libsystemd-machine-core.la
5188
5189 machinectl_SOURCES = \
5190         src/machine/machinectl.c
5191
5192 machinectl_LDADD = \
5193         libsystemd-internal.la \
5194         libsystemd-logs.la \
5195         libsystemd-journal-internal.la \
5196         libsystemd-shared.la
5197
5198 rootbin_PROGRAMS += \
5199         machinectl
5200
5201 dist_bashcompletion_DATA += \
5202         shell-completion/bash/machinectl
5203
5204 test_machine_tables_SOURCES = \
5205         src/machine/test-machine-tables.c
5206
5207 test_machine_tables_LDADD = \
5208         libsystemd-machine-core.la
5209
5210 tests += \
5211         test-machine-tables
5212
5213 nodist_systemunit_DATA += \
5214         units/systemd-machined.service
5215
5216 dist_systemunit_DATA += \
5217         units/machine.slice
5218
5219 dist_systemunit_DATA_busnames += \
5220         units/org.freedesktop.machine1.busname
5221
5222 dist_dbussystemservice_DATA += \
5223         src/machine/org.freedesktop.machine1.service
5224
5225 dist_dbuspolicy_DATA += \
5226         src/machine/org.freedesktop.machine1.conf
5227
5228 polkitpolicy_files += \
5229         src/machine/org.freedesktop.machine1.policy
5230
5231 polkitpolicy_in_files += \
5232         src/machine/org.freedesktop.machine1.policy.in
5233
5234 dist_zshcompletion_DATA += \
5235         shell-completion/zsh/_machinectl \
5236         shell-completion/zsh/_sd_machines
5237
5238 SYSTEM_UNIT_ALIASES += \
5239         systemd-machined.service dbus-org.freedesktop.machine1.service
5240
5241 BUSNAMES_TARGET_WANTS += \
5242         org.freedesktop.machine1.busname
5243
5244 EXTRA_DIST += \
5245         units/systemd-machined.service.in
5246
5247 libnss_mymachines_la_SOURCES = \
5248         src/nss-mymachines/nss-mymachines.sym \
5249         src/nss-mymachines/nss-mymachines.c
5250
5251 libnss_mymachines_la_LDFLAGS = \
5252         $(AM_LDFLAGS) \
5253         -module \
5254         -export-dynamic \
5255         -avoid-version \
5256         -shared \
5257         -shrext .so.2 \
5258         -Wl,--version-script=$(top_srcdir)/src/nss-mymachines/nss-mymachines.sym
5259
5260 libnss_mymachines_la_LIBADD = \
5261         libsystemd-shared.la \
5262         libsystemd-internal.la
5263
5264 lib_LTLIBRARIES += \
5265         libnss_mymachines.la
5266
5267 endif
5268
5269 # ------------------------------------------------------------------------------
5270 if ENABLE_IMPORTD
5271
5272 if HAVE_LIBCURL
5273 if HAVE_XZ
5274 if HAVE_ZLIB
5275 if HAVE_BZIP2
5276 if HAVE_GCRYPT
5277
5278 rootlibexec_PROGRAMS += \
5279         systemd-importd \
5280         systemd-pull \
5281         systemd-import \
5282         systemd-export
5283
5284 systemd_importd_SOURCES = \
5285         src/import/importd.c
5286
5287 systemd_importd_CFLAGS = \
5288         $(AM_CFLAGS) \
5289         -D SYSTEMD_PULL_PATH=\"$(rootlibexecdir)/systemd-pull\" \
5290         -D SYSTEMD_IMPORT_PATH=\"$(rootlibexecdir)/systemd-import\" \
5291         -D SYSTEMD_EXPORT_PATH=\"$(rootlibexecdir)/systemd-export\"
5292
5293 systemd_importd_LDADD = \
5294         libsystemd-internal.la \
5295         libsystemd-label.la \
5296         libsystemd-shared.la
5297
5298 systemd_pull_SOURCES = \
5299         src/import/pull.c \
5300         src/import/pull-raw.c \
5301         src/import/pull-raw.h \
5302         src/import/pull-tar.c \
5303         src/import/pull-tar.h \
5304         src/import/pull-dkr.c \
5305         src/import/pull-dkr.h \
5306         src/import/pull-job.c \
5307         src/import/pull-job.h \
5308         src/import/pull-common.c \
5309         src/import/pull-common.h \
5310         src/import/import-common.c \
5311         src/import/import-common.h \
5312         src/import/import-compress.c \
5313         src/import/import-compress.h \
5314         src/import/curl-util.c \
5315         src/import/curl-util.h \
5316         src/import/aufs-util.c \
5317         src/import/aufs-util.h \
5318         src/import/qcow2-util.c \
5319         src/import/qcow2-util.h
5320
5321 systemd_pull_CFLAGS = \
5322         $(AM_CFLAGS) \
5323         $(LIBCURL_CFLAGS) \
5324         $(XZ_CFLAGS) \
5325         $(ZLIB_CFLAGS) \
5326         $(GCRYPT_CFLAGS) \
5327         -D VENDOR_KEYRING_PATH=\"$(rootlibexecdir)/import-pubring.gpg\" \
5328         -D USER_KEYRING_PATH=\"$(pkgsysconfdir)/import-pubring.gpg\"
5329
5330 systemd_pull_LDADD = \
5331         libsystemd-internal.la \
5332         libsystemd-label.la \
5333         libsystemd-shared.la \
5334         $(LIBCURL_LIBS) \
5335         $(XZ_LIBS) \
5336         $(ZLIB_LIBS) \
5337         -lbz2 \
5338         $(GCRYPT_LIBS)
5339
5340 systemd_import_SOURCES = \
5341         src/import/import.c \
5342         src/import/import-raw.c \
5343         src/import/import-raw.h \
5344         src/import/import-tar.c \
5345         src/import/import-tar.h \
5346         src/import/import-common.c \
5347         src/import/import-common.h \
5348         src/import/import-compress.c \
5349         src/import/import-compress.h \
5350         src/import/qcow2-util.c \
5351         src/import/qcow2-util.h
5352
5353 systemd_import_CFLAGS = \
5354         $(AM_CFLAGS) \
5355         $(XZ_CFLAGS) \
5356         $(ZLIB_CFLAGS)
5357
5358 systemd_import_LDADD = \
5359         libsystemd-internal.la \
5360         libsystemd-label.la \
5361         libsystemd-shared.la \
5362         $(XZ_LIBS) \
5363         $(ZLIB_LIBS) \
5364         -lbz2
5365
5366 systemd_export_SOURCES = \
5367         src/import/export.c \
5368         src/import/export-tar.c \
5369         src/import/export-tar.h \
5370         src/import/export-raw.c \
5371         src/import/export-raw.h \
5372         src/import/import-common.c \
5373         src/import/import-common.h \
5374         src/import/import-compress.c \
5375         src/import/import-compress.h
5376
5377 systemd_export_CFLAGS = \
5378         $(AM_CFLAGS) \
5379         $(XZ_CFLAGS) \
5380         $(ZLIB_CFLAGS)
5381
5382 systemd_export_LDADD = \
5383         libsystemd-internal.la \
5384         libsystemd-label.la \
5385         libsystemd-shared.la \
5386         $(XZ_LIBS) \
5387         $(ZLIB_LIBS) \
5388         -lbz2
5389
5390 dist_rootlibexec_DATA = \
5391         src/import/import-pubring.gpg
5392
5393 nodist_systemunit_DATA += \
5394         units/systemd-importd.service
5395
5396 EXTRA_DIST += \
5397         units/systemd-importd.service.in
5398
5399 dist_systemunit_DATA_busnames += \
5400         units/org.freedesktop.import1.busname
5401
5402 BUSNAMES_TARGET_WANTS += \
5403         org.freedesktop.import1.busname
5404
5405 SYSTEM_UNIT_ALIASES += \
5406         systemd-importd.service dbus-org.freedesktop.import1.service
5407
5408 dist_dbussystemservice_DATA += \
5409         src/import/org.freedesktop.import1.service
5410
5411 dist_dbuspolicy_DATA += \
5412         src/import/org.freedesktop.import1.conf
5413
5414 polkitpolicy_files += \
5415         src/import/org.freedesktop.import1.policy
5416
5417 polkitpolicy_in_files += \
5418         src/import/org.freedesktop.import1.policy.in
5419
5420 manual_tests += \
5421         test-qcow2
5422
5423 test_qcow2_SOURCES = \
5424         src/import/test-qcow2.c \
5425         src/import/qcow2-util.c \
5426         src/import/qcow2-util.h
5427
5428 test_qcow2_CFLAGS = \
5429         $(AM_CFLAGS) \
5430         $(ZLIB_CFLAGS)
5431
5432 test_qcow2_LDADD = \
5433         libsystemd-internal.la \
5434         libsystemd-label.la \
5435         libsystemd-shared.la \
5436         $(ZLIB_LIBS)
5437
5438 endif
5439 endif
5440 endif
5441 endif
5442 endif
5443
5444 endif
5445
5446 # ------------------------------------------------------------------------------
5447 if ENABLE_RESOLVED
5448 systemd_resolved_SOURCES = \
5449         src/resolve/resolved.c \
5450         src/resolve/resolved-manager.c \
5451         src/resolve/resolved-manager.h \
5452         src/resolve/resolved-conf.c \
5453         src/resolve/resolved-conf.h \
5454         src/resolve/resolved-bus.c \
5455         src/resolve/resolved-bus.h \
5456         src/resolve/resolved-link.h \
5457         src/resolve/resolved-link.c \
5458         src/resolve/resolved-def.h \
5459         src/resolve/resolved-dns-domain.h \
5460         src/resolve/resolved-dns-domain.c \
5461         src/resolve/resolved-dns-rr.h \
5462         src/resolve/resolved-dns-rr.c \
5463         src/resolve/resolved-dns-question.h \
5464         src/resolve/resolved-dns-question.c \
5465         src/resolve/resolved-dns-answer.h \
5466         src/resolve/resolved-dns-answer.c \
5467         src/resolve/resolved-dns-packet.h \
5468         src/resolve/resolved-dns-packet.c \
5469         src/resolve/resolved-dns-query.h \
5470         src/resolve/resolved-dns-query.c \
5471         src/resolve/resolved-dns-transaction.h \
5472         src/resolve/resolved-dns-transaction.c \
5473         src/resolve/resolved-dns-scope.h \
5474         src/resolve/resolved-dns-scope.c \
5475         src/resolve/resolved-dns-server.h \
5476         src/resolve/resolved-dns-server.c \
5477         src/resolve/resolved-dns-cache.h \
5478         src/resolve/resolved-dns-cache.c \
5479         src/resolve/resolved-dns-zone.h \
5480         src/resolve/resolved-dns-zone.c \
5481         src/resolve/resolved-dns-stream.h \
5482         src/resolve/resolved-dns-stream.c \
5483         src/resolve/dns-type.c \
5484         src/resolve/dns-type.h \
5485         src/resolve/dns_type-from-name.h \
5486         src/resolve/dns_type-to-name.h
5487
5488 nodist_systemd_resolved_SOURCES = \
5489         src/resolve/resolved-gperf.c
5490
5491 gperf_gperf_sources += \
5492         src/resolve/resolved-gperf.gperf
5493
5494 gperf_txt_sources += \
5495         src/resolve/dns_type-list.txt
5496
5497 systemd_resolved_LDADD = \
5498         libsystemd-network.la \
5499         libsystemd-label.la \
5500         libsystemd-internal.la \
5501         libsystemd-shared.la \
5502         $(LIBIDN_LIBS)
5503
5504 rootlibexec_PROGRAMS += \
5505         systemd-resolved
5506
5507 nodist_systemunit_DATA += \
5508         units/systemd-resolved.service
5509
5510 dist_systemunit_DATA_busnames += \
5511         units/org.freedesktop.resolve1.busname
5512
5513 dist_dbuspolicy_DATA += \
5514         src/resolve/org.freedesktop.resolve1.conf
5515
5516 dist_dbussystemservice_DATA += \
5517         src/resolve/org.freedesktop.resolve1.service
5518
5519 EXTRA_DIST += \
5520         units/systemd-resolved.service.m4.in
5521
5522 SYSTEM_UNIT_ALIASES += \
5523         systemd-resolved.service dbus-org.freedesktop.resolve1.service
5524
5525 BUSNAMES_TARGET_WANTS += \
5526         org.freedesktop.resolve1.busname
5527
5528 GENERAL_ALIASES += \
5529         $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service
5530
5531 nodist_pkgsysconf_DATA += \
5532         src/resolve/resolved.conf
5533
5534 EXTRA_DIST += \
5535         src/resolve/resolved.conf.in
5536
5537 tests += \
5538         test-dns-domain
5539
5540 test_dns_domain_SOURCES = \
5541         src/resolve/resolved-dns-domain.h \
5542         src/resolve/resolved-dns-domain.c \
5543         src/resolve/test-dns-domain.c
5544
5545 test_dns_domain_LDADD = \
5546         libsystemd-network.la \
5547         libsystemd-label.la \
5548         libsystemd-internal.la \
5549         libsystemd-shared.la \
5550         $(LIBIDN_LIBS)
5551
5552 libnss_resolve_la_SOURCES = \
5553         src/nss-resolve/nss-resolve.sym \
5554         src/nss-resolve/nss-resolve.c
5555
5556 libnss_resolve_la_LDFLAGS = \
5557         $(AM_LDFLAGS) \
5558         -module \
5559         -export-dynamic \
5560         -avoid-version \
5561         -shared \
5562         -shrext .so.2 \
5563         -Wl,--version-script=$(top_srcdir)/src/nss-resolve/nss-resolve.sym
5564
5565 libnss_resolve_la_LIBADD = \
5566         libsystemd-internal.la \
5567         libsystemd-shared.la
5568
5569 lib_LTLIBRARIES += \
5570         libnss_resolve.la
5571
5572 systemd_resolve_host_SOURCES = \
5573         src/resolve-host/resolve-host.c \
5574         src/resolve/resolved-dns-packet.c \
5575         src/resolve/resolved-dns-packet.h \
5576         src/resolve/resolved-dns-rr.c \
5577         src/resolve/resolved-dns-rr.h \
5578         src/resolve/resolved-dns-answer.c \
5579         src/resolve/resolved-dns-answer.h \
5580         src/resolve/resolved-dns-question.c \
5581         src/resolve/resolved-dns-question.h \
5582         src/resolve/resolved-dns-domain.c \
5583         src/resolve/resolved-dns-domain.h \
5584         src/resolve/dns-type.c \
5585         src/resolve/dns-type.h \
5586         src/resolve/dns_type-from-name.h \
5587         src/resolve/dns_type-to-name.h
5588
5589 systemd_resolve_host_LDADD = \
5590         libsystemd-internal.la \
5591         libsystemd-shared.la \
5592         $(LIBIDN_LIBS)
5593
5594 rootlibexec_PROGRAMS += \
5595         systemd-resolve-host
5596
5597 endif
5598
5599 # ------------------------------------------------------------------------------
5600 if ENABLE_NETWORKD
5601 rootlibexec_PROGRAMS += \
5602         systemd-networkd
5603
5604 systemd_networkd_SOURCES = \
5605         src/network/networkd.c
5606
5607 systemd_networkd_LDADD = \
5608         libsystemd-networkd-core.la
5609
5610 noinst_LTLIBRARIES += \
5611         libsystemd-networkd-core.la
5612
5613 libsystemd_networkd_core_la_CFLAGS = \
5614         $(AM_CFLAGS)
5615
5616 libsystemd_networkd_core_la_SOURCES = \
5617         src/libsystemd-network/network-internal.h \
5618         src/network/networkd.h \
5619         src/network/networkd-link.h \
5620         src/network/networkd-netdev.h \
5621         src/network/networkd-netdev-tunnel.h \
5622         src/network/networkd-netdev-veth.h \
5623         src/network/networkd-netdev-vxlan.h \
5624         src/network/networkd-netdev-vlan.h \
5625         src/network/networkd-netdev-macvlan.h \
5626         src/network/networkd-netdev-ipvlan.h \
5627         src/network/networkd-netdev-dummy.h \
5628         src/network/networkd-netdev-tuntap.h \
5629         src/network/networkd-netdev-bond.h \
5630         src/network/networkd-netdev-bridge.h \
5631         src/network/networkd-netdev.c \
5632         src/network/networkd-netdev-tunnel.c \
5633         src/network/networkd-netdev-veth.c \
5634         src/network/networkd-netdev-vxlan.c \
5635         src/network/networkd-netdev-vlan.c \
5636         src/network/networkd-netdev-macvlan.c \
5637         src/network/networkd-netdev-ipvlan.c \
5638         src/network/networkd-netdev-dummy.c \
5639         src/network/networkd-netdev-tuntap.c \
5640         src/network/networkd-netdev-bond.c \
5641         src/network/networkd-netdev-bridge.c \
5642         src/network/networkd-link.c \
5643         src/network/networkd-link-bus.c \
5644         src/network/networkd-ipv4ll.c \
5645         src/network/networkd-dhcp4.c \
5646         src/network/networkd-dhcp6.c \
5647         src/network/networkd-network.c \
5648         src/network/networkd-network-bus.c \
5649         src/network/networkd-address.c \
5650         src/network/networkd-route.c \
5651         src/network/networkd-manager.c \
5652         src/network/networkd-manager-bus.c \
5653         src/network/networkd-fdb.c \
5654         src/network/networkd-address-pool.c
5655
5656 nodist_libsystemd_networkd_core_la_SOURCES = \
5657         src/network/networkd-network-gperf.c \
5658         src/network/networkd-netdev-gperf.c
5659
5660 libsystemd_networkd_core_la_LIBADD = \
5661         libudev-internal.la \
5662         libsystemd-internal.la \
5663         libsystemd-network.la \
5664         libsystemd-label.la \
5665         libsystemd-shared.la
5666
5667 rootlibexec_PROGRAMS += \
5668         systemd-networkd-wait-online
5669
5670 systemd_networkd_wait_online_CFLAGS = \
5671         $(AM_CFLAGS)
5672
5673 systemd_networkd_wait_online_SOURCES = \
5674         src/libsystemd-network/network-internal.h \
5675         src/network/networkd-wait-online.h \
5676         src/network/networkd-wait-online-link.h \
5677         src/network/networkd-wait-online.c \
5678         src/network/networkd-wait-online-manager.c \
5679         src/network/networkd-wait-online-link.c
5680
5681 systemd_networkd_wait_online_LDADD = \
5682         libsystemd-network.la \
5683         libudev-internal.la \
5684         libsystemd-internal.la \
5685         libsystemd-shared.la
5686
5687 rootbin_PROGRAMS += \
5688         networkctl
5689
5690 networkctl_SOURCES = \
5691         src/network/networkctl.c
5692
5693 networkctl_LDADD = \
5694         libudev-internal.la \
5695         libsystemd-internal.la \
5696         libsystemd-shared.la \
5697         libsystemd-network.la
5698
5699 test_network_SOURCES = \
5700         src/network/test-network.c
5701
5702 test_network_LDADD = \
5703         libsystemd-networkd-core.la
5704
5705 test_network_tables_SOURCES = \
5706         src/network/test-network-tables.c \
5707         src/shared/test-tables.h
5708
5709 test_network_tables_LDADD = \
5710         libsystemd-networkd-core.la \
5711         libudev-core.la
5712
5713 tests += \
5714         test-network \
5715         test-network-tables
5716
5717 dist_systemunit_DATA += \
5718         units/systemd-networkd.socket
5719
5720 nodist_systemunit_DATA += \
5721         units/systemd-networkd.service \
5722         units/systemd-networkd-wait-online.service
5723
5724 dist_systemunit_DATA_busnames += \
5725         units/org.freedesktop.network1.busname
5726
5727 dist_dbussystemservice_DATA += \
5728         src/network/org.freedesktop.network1.service
5729
5730 dist_dbuspolicy_DATA += \
5731         src/network/org.freedesktop.network1.conf
5732
5733 GENERAL_ALIASES += \
5734         $(systemunitdir)/systemd-networkd.socket $(pkgsysconfdir)/system/sockets.target.wants/systemd-networkd.socket \
5735         $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \
5736         $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service
5737
5738 SYSTEM_UNIT_ALIASES += \
5739         systemd-networkd.service dbus-org.freedesktop.network1.service
5740
5741 BUSNAMES_TARGET_WANTS += \
5742         org.freedesktop.network1.busname
5743
5744 gperf_gperf_sources += \
5745         src/network/networkd-network-gperf.gperf \
5746         src/network/networkd-netdev-gperf.gperf
5747
5748 EXTRA_DIST += \
5749         units/systemd-networkd.service.in \
5750         units/systemd-networkd-wait-online.service.in
5751
5752 endif
5753
5754 # ------------------------------------------------------------------------------
5755 if ENABLE_LOGIND
5756 systemd_logind_SOURCES = \
5757         src/login/logind.c \
5758         src/login/logind.h
5759
5760 nodist_systemd_logind_SOURCES = \
5761         src/login/logind-gperf.c
5762
5763 systemd_logind_LDADD = \
5764         libsystemd-logind-core.la
5765
5766 libsystemd_logind_core_la_SOURCES = \
5767         src/login/logind-core.c \
5768         src/login/logind-device.c \
5769         src/login/logind-device.h \
5770         src/login/logind-button.c \
5771         src/login/logind-button.h \
5772         src/login/logind-action.c \
5773         src/login/logind-action.h \
5774         src/login/logind-seat.c \
5775         src/login/logind-seat.h \
5776         src/login/logind-session.c \
5777         src/login/logind-session.h \
5778         src/login/logind-session-device.c \
5779         src/login/logind-session-device.h \
5780         src/login/logind-user.c \
5781         src/login/logind-user.h \
5782         src/login/logind-inhibit.c \
5783         src/login/logind-inhibit.h \
5784         src/login/logind-dbus.c \
5785         src/login/logind-session-dbus.c \
5786         src/login/logind-seat-dbus.c \
5787         src/login/logind-user-dbus.c \
5788         src/login/logind-acl.h
5789
5790 libsystemd_logind_core_la_LIBADD = \
5791         libsystemd-label.la \
5792         libudev-internal.la \
5793         libsystemd-internal.la \
5794         libsystemd-shared.la
5795
5796 if HAVE_ACL
5797 libsystemd_logind_core_la_SOURCES += \
5798         src/login/logind-acl.c
5799
5800 libsystemd_logind_core_la_LIBADD += \
5801         libsystemd-acl.la
5802 endif
5803
5804 noinst_LTLIBRARIES += \
5805         libsystemd-logind-core.la
5806
5807 rootlibexec_PROGRAMS += \
5808         systemd-logind
5809
5810 loginctl_SOURCES = \
5811         src/login/loginctl.c \
5812         src/login/sysfs-show.h \
5813         src/login/sysfs-show.c
5814
5815 loginctl_LDADD = \
5816         libudev-internal.la \
5817         libsystemd-internal.la \
5818         libsystemd-logs.la \
5819         libsystemd-journal-internal.la \
5820         libsystemd-shared.la
5821
5822 rootbin_PROGRAMS += \
5823         loginctl
5824
5825 dist_bashcompletion_DATA += \
5826         shell-completion/bash/loginctl
5827
5828 dist_zshcompletion_DATA += \
5829         shell-completion/zsh/_loginctl \
5830         shell-completion/zsh/_systemd-inhibit
5831
5832 systemd_inhibit_SOURCES = \
5833         src/login/inhibit.c
5834
5835 systemd_inhibit_LDADD = \
5836         libsystemd-internal.la \
5837         libsystemd-shared.la
5838
5839 rootbin_PROGRAMS += \
5840         systemd-inhibit
5841
5842 test_login_SOURCES = \
5843         src/libsystemd/sd-login/test-login.c
5844
5845 test_login_LDADD = \
5846         libsystemd-internal.la \
5847         libsystemd-shared.la
5848
5849 test_login_shared_SOURCES = \
5850         src/login/test-login-shared.c
5851
5852 test_login_shared_LDADD = \
5853         libsystemd-internal.la \
5854         libsystemd-shared.la
5855
5856 test_inhibit_SOURCES = \
5857         src/login/test-inhibit.c
5858
5859 test_inhibit_LDADD = \
5860         libsystemd-internal.la \
5861         libsystemd-shared.la
5862
5863 test_login_tables_SOURCES = \
5864         src/login/test-login-tables.c
5865
5866 test_login_tables_LDADD = \
5867         libsystemd-logind-core.la
5868
5869 manual_tests += \
5870         test-login \
5871         test-inhibit
5872
5873 tests += \
5874         test-login-tables \
5875         test-login-shared
5876
5877 if HAVE_PAM
5878 pam_systemd_la_SOURCES = \
5879         src/login/pam_systemd.sym \
5880         src/login/pam_systemd.c
5881
5882 pam_systemd_la_CFLAGS = \
5883         $(AM_CFLAGS) \
5884         $(PAM_CFLAGS) \
5885         -fvisibility=hidden
5886
5887 pam_systemd_la_LDFLAGS = \
5888         $(AM_LDFLAGS) \
5889         -module \
5890         -export-dynamic \
5891         -avoid-version \
5892         -shared \
5893         -Wl,--version-script=$(top_srcdir)/src/login/pam_systemd.sym
5894
5895 pam_systemd_la_LIBADD = \
5896         libsystemd-internal.la \
5897         libsystemd-shared.la \
5898         $(PAM_LIBS)
5899
5900 pamlib_LTLIBRARIES = \
5901         pam_systemd.la
5902
5903 dist_pamconf_DATA = \
5904         src/login/systemd-user
5905
5906 endif
5907
5908 nodist_systemunit_DATA += \
5909         units/systemd-logind.service
5910
5911 dist_systemunit_DATA += \
5912         units/user.slice
5913
5914 dist_systemunit_DATA_busnames += \
5915         units/org.freedesktop.login1.busname
5916
5917 dist_dbussystemservice_DATA += \
5918         src/login/org.freedesktop.login1.service
5919
5920 dist_dbuspolicy_DATA += \
5921         src/login/org.freedesktop.login1.conf
5922
5923 dist_pkgsysconf_DATA += \
5924         src/login/logind.conf
5925
5926 polkitpolicy_files += \
5927         src/login/org.freedesktop.login1.policy
5928
5929 INSTALL_DIRS += \
5930         $(systemdstatedir)
5931
5932 MULTI_USER_TARGET_WANTS += \
5933         systemd-logind.service
5934
5935 SYSTEM_UNIT_ALIASES += \
5936         systemd-logind.service dbus-org.freedesktop.login1.service
5937
5938 BUSNAMES_TARGET_WANTS += \
5939         org.freedesktop.login1.busname
5940
5941 dist_udevrules_DATA += \
5942         src/login/70-uaccess.rules \
5943         src/login/70-power-switch.rules
5944
5945 nodist_udevrules_DATA += \
5946         src/login/71-seat.rules \
5947         src/login/73-seat-late.rules
5948
5949 endif
5950
5951 polkitpolicy_in_files += \
5952         src/login/org.freedesktop.login1.policy.in
5953
5954 gperf_gperf_sources += \
5955         src/login/logind-gperf.gperf
5956
5957 EXTRA_DIST += \
5958         src/login/71-seat.rules.in \
5959         src/login/73-seat-late.rules.in \
5960         units/systemd-logind.service.in
5961
5962 # ------------------------------------------------------------------------------
5963 if HAVE_PAM
5964
5965 systemd_user_sessions_SOURCES = \
5966         src/user-sessions/user-sessions.c
5967
5968 systemd_user_sessions_LDADD = \
5969         libsystemd-shared.la
5970
5971 rootlibexec_PROGRAMS += \
5972         systemd-user-sessions
5973
5974 nodist_systemunit_DATA += \
5975         units/systemd-user-sessions.service
5976
5977 EXTRA_DIST += \
5978         units/systemd-user-sessions.service.in
5979
5980 MULTI_USER_TARGET_WANTS += \
5981         systemd-user-sessions.service
5982
5983 endif
5984
5985 # ------------------------------------------------------------------------------
5986
5987 if HAVE_PYTHON_DEVEL
5988 pkgpyexec_LTLIBRARIES = \
5989         _journal.la \
5990         id128.la \
5991         _daemon.la \
5992         _reader.la \
5993         login.la
5994
5995 _journal_la_SOURCES = \
5996         src/python-systemd/_journal.c
5997
5998 _journal_la_CFLAGS = \
5999         $(AM_CFLAGS) \
6000         -fvisibility=default \
6001         $(PYTHON_DEVEL_CFLAGS)
6002
6003 _journal_la_LDFLAGS = \
6004         $(AM_LDFLAGS) \
6005         -shared \
6006         -module \
6007         -avoid-version
6008
6009 _journal_la_LIBADD = \
6010         $(PYTHON_DEVEL_LIBS) \
6011         libsystemd.la
6012
6013 id128_la_SOURCES = \
6014         src/python-systemd/id128.c \
6015         src/python-systemd/pyutil.c \
6016         src/python-systemd/pyutil.h
6017
6018 nodist_id128_la_SOURCES = \
6019         src/python-systemd/id128-constants.h
6020
6021 id128_la_CFLAGS = \
6022         $(AM_CFLAGS) \
6023         -fvisibility=default \
6024         $(PYTHON_DEVEL_CFLAGS) \
6025         -I$(top_builddir)/src/python-systemd
6026
6027 id128_la_LDFLAGS = \
6028         $(AM_LDFLAGS) \
6029         -shared \
6030         -module \
6031         -avoid-version
6032
6033 id128_la_LIBADD = \
6034         $(PYTHON_DEVEL_LIBS) \
6035         libsystemd-shared.la \
6036         libsystemd.la
6037
6038 _daemon_la_SOURCES = \
6039         src/python-systemd/_daemon.c \
6040         src/python-systemd/pyutil.c \
6041         src/python-systemd/pyutil.h
6042
6043 _daemon_la_CFLAGS = \
6044         $(AM_CFLAGS) \
6045         -fvisibility=default \
6046         $(PYTHON_DEVEL_CFLAGS) \
6047         -I$(top_builddir)/src/python-systemd
6048
6049 _daemon_la_LDFLAGS = \
6050         $(AM_LDFLAGS) \
6051         -shared \
6052         -module \
6053         -avoid-version
6054
6055 _daemon_la_LIBADD = \
6056         $(PYTHON_DEVEL_LIBS) \
6057         libsystemd-shared.la \
6058         libsystemd.la
6059
6060 _reader_la_SOURCES = \
6061         src/python-systemd/_reader.c \
6062         src/python-systemd/pyutil.c \
6063         src/python-systemd/pyutil.h
6064
6065 _reader_la_CFLAGS = \
6066         $(AM_CFLAGS) \
6067         -fvisibility=default \
6068         $(PYTHON_DEVEL_CFLAGS)
6069
6070 _reader_la_LDFLAGS = \
6071         $(AM_LDFLAGS) \
6072         -shared \
6073         -module \
6074         -avoid-version
6075
6076 _reader_la_LIBADD = \
6077         $(PYTHON_DEVEL_LIBS) \
6078         libsystemd-shared.la \
6079         libsystemd.la
6080
6081 login_la_SOURCES = \
6082         src/python-systemd/login.c \
6083         src/python-systemd/pyutil.c \
6084         src/python-systemd/pyutil.h
6085
6086 login_la_CFLAGS = \
6087         $(AM_CFLAGS) \
6088         -fvisibility=default \
6089         $(PYTHON_DEVEL_CFLAGS)
6090
6091 login_la_LDFLAGS = \
6092         $(AM_LDFLAGS) \
6093         -shared \
6094         -module \
6095         -avoid-version
6096
6097 login_la_LIBADD = \
6098         $(PYTHON_DEVEL_LIBS) \
6099         libsystemd-shared.la \
6100         libsystemd.la
6101
6102 dist_pkgpyexec_PYTHON = \
6103         src/python-systemd/journal.py \
6104         src/python-systemd/daemon.py \
6105         src/python-systemd/__init__.py
6106
6107 src/python-systemd/id128-constants.h: src/systemd/sd-messages.h
6108         $(AM_V_at)$(MKDIR_P) $(dir $@)
6109         $(AM_V_GEN)$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
6110
6111 BUILT_SOURCES += \
6112         $(nodist_id128_la_SOURCES)
6113
6114 SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
6115 sphinx-%:
6116         $(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
6117         $(AM_V_GEN)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) $(top_srcdir)/src/python-systemd/docs $(top_builddir)/docs/html/python-systemd/
6118         $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/html/python-systemd/
6119
6120 python-shell:
6121         $(AM_V_at)echo "Starting python with $(DESTDIR)$(pyexecdir)"
6122         $(AM_V_at)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(PYTHON)
6123
6124 destdir-sphinx: all
6125         dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
6126                 $(MAKE) DESTDIR="$$dir" install && \
6127                 $(MAKE) DESTDIR="$$dir" sphinx-html && \
6128                 rm -rf "$$dir"
6129
6130 endif
6131
6132 CLEAN_LOCAL_HOOKS += clean-sphinx
6133
6134 .PHONY: python-shell destdir-sphinx clean-sphinx clean-python
6135
6136 clean-sphinx:
6137         -rm -rf docs/html/python-systemd/
6138
6139 # Remove Python stuff, e.g. to force rebuilding for a different Python version.
6140 clean-python:
6141         -rm -rf src/python-systemd/.libs src/python-systemd/*.l[ao]
6142         -rm -f _daemon.la id128.la _journal.la login.la _reader.la
6143
6144 # ------------------------------------------------------------------------------
6145 if ENABLE_COMPAT_LIBS
6146 EXTRA_DIST += \
6147         src/compat-libs/linkwarning.h
6148
6149 libsystemd-%.c: src/compat-libs/libsystemd-%.sym
6150         $(AM_V_at)$(MKDIR_P) $(dir $@)
6151         $(AM_V_GEN)sed -r -n 's/^ +(sd_.*);/obsolete_lib(\1,$(notdir $(basename $<)));/p' <$< >$@
6152
6153 BUILT_SOURCES += \
6154         libsystemd-journal.c \
6155         libsystemd-login.c \
6156         libsystemd-id128.c \
6157         libsystemd-daemon.c
6158
6159 libsystemd_journal_la_SOURCES = \
6160         libsystemd-journal.c \
6161         src/compat-libs/libsystemd-journal.sym
6162
6163 libsystemd_journal_la_CPPFLAGS = \
6164         $(AM_CFLAGS) \
6165         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
6166
6167 libsystemd_journal_la_LDFLAGS = \
6168         $(AM_LDFLAGS) \
6169         -version-info $(LIBSYSTEMD_JOURNAL_CURRENT):$(LIBSYSTEMD_JOURNAL_REVISION):$(LIBSYSTEMD_JOURNAL_AGE) \
6170         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-journal.sym
6171
6172 libsystemd_journal_la_LIBADD = \
6173         libsystemd-journal-internal.la \
6174         libsystemd-internal.la \
6175         libsystemd-shared.la
6176
6177 libsystemd_login_la_SOURCES = \
6178         libsystemd-login.c \
6179         src/compat-libs/libsystemd-login.sym
6180
6181 libsystemd_login_la_CPPFLAGS = \
6182         $(AM_CFLAGS) \
6183         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
6184
6185 libsystemd_login_la_LDFLAGS = \
6186         $(AM_LDFLAGS) \
6187         -version-info $(LIBSYSTEMD_LOGIN_CURRENT):$(LIBSYSTEMD_LOGIN_REVISION):$(LIBSYSTEMD_LOGIN_AGE) \
6188         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-login.sym
6189
6190 libsystemd_login_la_LIBADD = \
6191         libsystemd-internal.la \
6192         libsystemd-shared.la
6193
6194 libsystemd_id128_la_SOURCES = \
6195         libsystemd-id128.c \
6196         src/compat-libs/libsystemd-id128.sym
6197
6198 libsystemd_id128_la_CPPFLAGS = \
6199         $(AM_CFLAGS) \
6200         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
6201
6202 libsystemd_id128_la_LDFLAGS = \
6203         $(AM_LDFLAGS) \
6204         -version-info $(LIBSYSTEMD_ID128_CURRENT):$(LIBSYSTEMD_ID128_REVISION):$(LIBSYSTEMD_ID128_AGE) \
6205         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-id128.sym
6206
6207 libsystemd_id128_la_LIBADD = \
6208         libsystemd-internal.la \
6209         libsystemd-shared.la
6210
6211 libsystemd_daemon_la_SOURCES = \
6212         libsystemd-daemon.c \
6213         src/compat-libs/libsystemd-daemon.sym
6214
6215 libsystemd_daemon_la_CPPFLAGS = \
6216         $(AM_CFLAGS) \
6217         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
6218
6219 libsystemd_daemon_la_LDFLAGS = \
6220         $(AM_LDFLAGS) \
6221         -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
6222         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-daemon.sym
6223
6224 libsystemd_daemon_la_LIBADD = \
6225         libsystemd-internal.la \
6226         libsystemd-shared.la
6227
6228 lib_LTLIBRARIES += \
6229         libsystemd-journal.la \
6230         libsystemd-login.la \
6231         libsystemd-id128.la \
6232         libsystemd-daemon.la
6233
6234 pkgconfiglib_DATA += \
6235         src/compat-libs/libsystemd-journal.pc \
6236         src/compat-libs/libsystemd-login.pc \
6237         src/compat-libs/libsystemd-id128.pc \
6238         src/compat-libs/libsystemd-daemon.pc
6239
6240 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
6241 compat-lib-install-hook:
6242         libname=libsystemd-login.so && $(move-to-rootlibdir)
6243         libname=libsystemd-journal.so && $(move-to-rootlibdir)
6244         libname=libsystemd-id128.so && $(move-to-rootlibdir)
6245         libname=libsystemd-daemon.so && $(move-to-rootlibdir)
6246
6247 compat-lib-uninstall-hook:
6248         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-login.so*
6249         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so*
6250         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-id128.so*
6251         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so*
6252
6253 INSTALL_EXEC_HOOKS += compat-lib-install-hook
6254 UNINSTALL_EXEC_HOOKS += compat-lib-uninstall-hook
6255 endif
6256
6257 EXTRA_DIST += \
6258         src/compat-libs/libsystemd-journal.pc.in \
6259         src/compat-libs/libsystemd-login.pc.in \
6260         src/compat-libs/libsystemd-id128.pc.in \
6261         src/compat-libs/libsystemd-daemon.pc.in
6262
6263 # ------------------------------------------------------------------------------
6264 substitutions = \
6265        '|rootlibexecdir=$(rootlibexecdir)|' \
6266        '|rootbindir=$(rootbindir)|' \
6267        '|bindir=$(bindir)|' \
6268        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
6269        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
6270        '|pkgsysconfdir=$(pkgsysconfdir)|' \
6271        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
6272        '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
6273        '|pkgdatadir=$(pkgdatadir)|' \
6274        '|systemunitdir=$(systemunitdir)|' \
6275        '|userunitdir=$(userunitdir)|' \
6276        '|systempresetdir=$(systempresetdir)|' \
6277        '|userpresetdir=$(userpresetdir)|' \
6278        '|udevhwdbdir=$(udevhwdbdir)|' \
6279        '|udevrulesdir=$(udevrulesdir)|' \
6280        '|catalogdir=$(catalogdir)|' \
6281        '|tmpfilesdir=$(tmpfilesdir)|' \
6282        '|sysusersdir=$(sysusersdir)|' \
6283        '|sysctldir=$(sysctldir)|' \
6284        '|systemgeneratordir=$(systemgeneratordir)|' \
6285        '|usergeneratordir=$(usergeneratordir)|' \
6286        '|CERTIFICATEROOT=$(CERTIFICATEROOT)|' \
6287        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
6288        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
6289        '|PACKAGE_URL=$(PACKAGE_URL)|' \
6290        '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
6291        '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
6292        '|prefix=$(prefix)|' \
6293        '|exec_prefix=$(exec_prefix)|' \
6294        '|libdir=$(libdir)|' \
6295        '|includedir=$(includedir)|' \
6296        '|VERSION=$(VERSION)|' \
6297        '|rootprefix=$(rootprefix)|' \
6298        '|udevlibexecdir=$(udevlibexecdir)|' \
6299        '|SUSHELL=$(SUSHELL)|' \
6300        '|SULOGIN=$(SULOGIN)|' \
6301        '|DEBUGTTY=$(DEBUGTTY)|' \
6302        '|KILL=$(KILL)|' \
6303        '|KMOD=$(KMOD)|' \
6304        '|MKDIR_P=$(MKDIR_P)|' \
6305        '|QUOTAON=$(QUOTAON)|' \
6306        '|QUOTACHECK=$(QUOTACHECK)|' \
6307        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
6308        '|VARLOGDIR=$(varlogdir)|' \
6309        '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
6310        '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
6311        '|PYTHON=$(PYTHON)|' \
6312        '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
6313        '|NTP_SERVERS=$(NTP_SERVERS)|' \
6314        '|DNS_SERVERS=$(DNS_SERVERS)|' \
6315        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
6316        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
6317        '|TTY_GID=$(TTY_GID)|' \
6318        '|systemsleepdir=$(systemsleepdir)|' \
6319        '|systemshutdowndir=$(systemshutdowndir)|' \
6320        '|binfmtdir=$(binfmtdir)|' \
6321        '|modulesloaddir=$(modulesloaddir)|'
6322
6323 SED_PROCESS = \
6324         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
6325         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
6326                 < $< > $@
6327
6328 units/%: units/%.in
6329         $(SED_PROCESS)
6330
6331 man/%: man/%.in
6332         $(SED_PROCESS)
6333
6334 sysctl.d/%: sysctl.d/%.in
6335         $(SED_PROCESS)
6336
6337 %.pc: %.pc.in
6338         $(SED_PROCESS)
6339
6340 %.conf: %.conf.in
6341         $(SED_PROCESS)
6342
6343 src/core/macros.%: src/core/macros.%.in
6344         $(SED_PROCESS)
6345
6346 src/%.policy.in: src/%.policy.in.in
6347         $(SED_PROCESS)
6348
6349 shell-completion/%: shell-completion/%.in
6350         $(SED_PROCESS)
6351
6352 %.rules: %.rules.in
6353         $(SED_PROCESS)
6354
6355 %.conf: %.conf.in
6356         $(SED_PROCESS)
6357
6358 %.sh: %.sh.in
6359         $(SED_PROCESS)
6360         $(AM_V_GEN)chmod +x $@
6361
6362 src/%.c: src/%.gperf
6363         $(AM_V_at)$(MKDIR_P) $(dir $@)
6364         $(AM_V_GPERF)$(GPERF) < $< > $@
6365
6366 src/%: src/%.m4
6367         $(AM_V_at)$(MKDIR_P) $(dir $@)
6368         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
6369
6370 sysusers.d/%: sysusers.d/%.m4
6371         $(AM_V_at)$(MKDIR_P) $(dir $@)
6372         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
6373
6374 tmpfiles.d/%: tmpfiles.d/%.m4
6375         $(AM_V_at)$(MKDIR_P) $(dir $@)
6376         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
6377
6378
6379 units/%: units/%.m4
6380         $(AM_V_at)$(MKDIR_P) $(dir $@)
6381         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
6382
6383 units/user/%: units/user/%.m4
6384         $(AM_V_at)$(MKDIR_P) $(dir $@)
6385         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
6386
6387 if ENABLE_POLKIT
6388 nodist_polkitpolicy_DATA = \
6389         $(polkitpolicy_files) \
6390         $(polkitpolicy_in_in_files:.policy.in.in=.policy)
6391 endif
6392
6393 EXTRA_DIST += \
6394         $(polkitpolicy_in_files) \
6395         $(polkitpolicy_in_in_files)
6396
6397 # ------------------------------------------------------------------------------
6398 if ENABLE_MANPAGES
6399 man/custom-entities.ent: configure.ac
6400         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
6401         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
6402          printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
6403          > $@ # '
6404
6405 DISTCLEANFILES += \
6406         man/custom-entities.ent
6407
6408 XSLTPROC_FLAGS = \
6409         --nonet \
6410         --xinclude \
6411         --stringparam man.output.quietly 1 \
6412         --stringparam funcsynopsis.style ansi \
6413         --stringparam man.authors.section.enabled 0 \
6414         --stringparam man.copyright.section.enabled 0 \
6415         --stringparam systemd.version $(VERSION) \
6416         --path '$(builddir)/man:$(srcdir)/man'
6417
6418 XSLTPROC_PROCESS_MAN = \
6419         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
6420
6421 XSLTPROC_PROCESS_HTML = \
6422         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
6423
6424 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
6425         $(XSLTPROC_PROCESS_MAN)
6426
6427 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
6428         $(XSLTPROC_PROCESS_MAN)
6429
6430 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
6431         $(XSLTPROC_PROCESS_MAN)
6432
6433 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
6434         $(XSLTPROC_PROCESS_MAN)
6435
6436 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
6437         $(XSLTPROC_PROCESS_MAN)
6438
6439 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
6440         $(XSLTPROC_PROCESS_HTML)
6441
6442 define html-alias
6443         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
6444 endef
6445
6446 endif
6447
6448 EXTRA_DIST += \
6449         man/custom-html.xsl \
6450         man/custom-man.xsl
6451
6452 # ------------------------------------------------------------------------------
6453 EXTRA_DIST += \
6454         docs/sysvinit/README.in \
6455         docs/var-log/README.in
6456
6457 SOCKETS_TARGET_WANTS += \
6458         systemd-initctl.socket \
6459         systemd-shutdownd.socket
6460
6461 SYSINIT_TARGET_WANTS += \
6462         systemd-update-done.service
6463
6464 LOCAL_FS_TARGET_WANTS += \
6465         systemd-remount-fs.service \
6466         tmp.mount \
6467         var-lib-machines.mount
6468
6469 MULTI_USER_TARGET_WANTS += \
6470         getty.target \
6471         systemd-ask-password-wall.path
6472
6473 SYSINIT_TARGET_WANTS += \
6474         dev-hugepages.mount \
6475         dev-mqueue.mount \
6476         sys-kernel-config.mount \
6477         sys-kernel-debug.mount \
6478         sys-fs-fuse-connections.mount \
6479         systemd-sysctl.service \
6480         systemd-ask-password-console.path
6481
6482 SYSTEM_UNIT_ALIASES += \
6483         graphical.target default.target \
6484         reboot.target ctrl-alt-del.target \
6485         getty@.service autovt@.service
6486
6487 USER_UNIT_ALIASES += \
6488         $(systemunitdir)/shutdown.target shutdown.target \
6489         $(systemunitdir)/sockets.target sockets.target \
6490         $(systemunitdir)/timers.target timers.target \
6491         $(systemunitdir)/paths.target paths.target \
6492         $(systemunitdir)/bluetooth.target bluetooth.target \
6493         $(systemunitdir)/printer.target printer.target \
6494         $(systemunitdir)/sound.target sound.target \
6495         $(systemunitdir)/smartcard.target smartcard.target
6496
6497 if ENABLE_KDBUS
6498 USER_UNIT_ALIASES += \
6499         $(systemunitdir)/busnames.target busnames.target
6500 endif
6501
6502 GENERAL_ALIASES += \
6503         $(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
6504         $(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \
6505         $(pkgsysconfdir)/user $(sysconfdir)/xdg/systemd/user \
6506         $(dbussystemservicedir)/org.freedesktop.systemd1.service $(dbussessionservicedir)/org.freedesktop.systemd1.service
6507
6508 INSTALL_DIRS += \
6509         $(prefix)/lib/modules-load.d \
6510         $(sysconfdir)/modules-load.d \
6511         $(prefix)/lib/systemd/network \
6512         $(sysconfdir)/systemd/network \
6513         $(prefix)/lib/sysctl.d \
6514         $(sysconfdir)/sysctl.d \
6515         $(prefix)/lib/kernel/install.d \
6516         $(sysconfdir)/kernel/install.d \
6517         $(systemshutdowndir) \
6518         $(systemsleepdir) \
6519         $(systemgeneratordir) \
6520         $(usergeneratordir) \
6521         \
6522         $(userunitdir) \
6523         $(pkgsysconfdir)/system \
6524         $(pkgsysconfdir)/system/multi-user.target.wants \
6525         $(pkgsysconfdir)/system/getty.target.wants \
6526         $(pkgsysconfdir)/user \
6527         $(dbussessionservicedir) \
6528         $(sysconfdir)/xdg/systemd
6529
6530 install-exec-hook: $(INSTALL_EXEC_HOOKS)
6531
6532 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
6533
6534 install-data-hook: $(INSTALL_DATA_HOOKS)
6535
6536 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
6537
6538 clean-local: $(CLEAN_LOCAL_HOOKS)
6539         rm -rf $(abs_srcdir)/install-tree
6540         rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
6541               $(abs_srcdir)/hwdb/iab.txt
6542
6543 DISTCHECK_CONFIGURE_FLAGS = \
6544         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
6545         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
6546         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
6547         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
6548         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
6549         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
6550         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
6551         --with-rootprefix=$$dc_install_base \
6552         --disable-split-usr \
6553         --enable-kdbus \
6554         --enable-compat-libs
6555
6556 DISTCHECK_CONFIGURE_FLAGS += \
6557         --with-sysvinit-path= \
6558         --with-sysvrcnd-path=
6559
6560 if HAVE_PYTHON
6561 DISTCHECK_CONFIGURE_FLAGS += \
6562         --with-python
6563 endif
6564
6565 if ENABLE_GTK_DOC
6566 DISTCHECK_CONFIGURE_FLAGS += \
6567         --enable-gtk-doc
6568 endif
6569
6570 #
6571 # Require python when making dist
6572 #
6573 .PHONY: dist-check-python dist-check-compat-libs dist-check-help
6574 dist-check-python:
6575 if !HAVE_PYTHON
6576         @echo "*** python and python-lxml module must be installed and enabled in order to make dist"
6577         @false
6578 endif
6579
6580 dist-check-compat-libs:
6581 if !ENABLE_COMPAT_LIBS
6582         @echo "*** compat-libs must be enabled in order to make dist"
6583         @false
6584 endif
6585
6586 dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS)
6587         for i in $(abspath $^); do                                             \
6588             if $$i  --help | grep -v 'default:' | grep -E -q '.{80}.' ; then   \
6589                 echo "$(basename $$i) --help output is too wide:";             \
6590                 $$i  --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
6591                 exit 1;                                                        \
6592             fi; done
6593
6594 dist: dist-check-python dist-check-compat-libs
6595
6596 # check "broken" platforms limited toolchains for link breakage before we release
6597 .PHONY: linkcheck
6598 linkcheck:
6599         $(MAKE) CFLAGS='-fno-lto' LDFLAGS='-Wl,-fuse-ld=gold -Wl,--as-needed -Wl,--no-gc-sections' distcheck
6600
6601 .PHONY: hwdb-update
6602 hwdb-update:
6603         ( cd $(top_srcdir)/hwdb && \
6604         wget -N http://www.linux-usb.org/usb.ids \
6605                 http://pci-ids.ucw.cz/v2.2/pci.ids \
6606                 http://standards.ieee.org/develop/regauth/oui/oui.txt \
6607                 http://standards.ieee.org/develop/regauth/iab/iab.txt && \
6608         ./ids-update.pl )
6609
6610 .PHONY: kdbus-update
6611 kdbus-update:
6612         ( cd $(top_srcdir)/src/libsystemd/sd-bus/ && \
6613         wget -N https://d-bus.googlecode.com/git/kdbus.h )
6614
6615 .PHONY: git-tag
6616 git-tag:
6617         git tag -s "v$(VERSION)" -m "systemd $(VERSION)"
6618
6619 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
6620 .PHONY: upload
6621 upload: all check dist
6622         scp systemd-$(VERSION).tar.xz $(www_target)
6623
6624 .PHONY: doc-sync
6625 doc-sync: all destdir-sphinx
6626         gtkdoc-rebase --html-dir=docs/libudev/html --online
6627         rsync -rlv --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
6628         gtkdoc-rebase --html-dir=docs/gudev/html --online
6629         rsync -rlv --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
6630         rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
6631         rsync -rlv --delete --omit-dir-times docs/html/python-systemd/ $(www_target)/python-systemd/
6632
6633 .PHONY: gardel
6634 gardel: upload
6635         scp man/*.html gardel:public/systemd-man/
6636
6637 .PHONY: lennart-fedora
6638 lennart-fedora:
6639         cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
6640
6641 .PHONY: install-tree
6642 install-tree: all
6643         rm -rf $(abs_srcdir)/install-tree
6644         $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
6645         tree $(abs_srcdir)/install-tree
6646
6647 # Let's run all tests of the test suite, but under valgrind. Let's
6648 # exclude the one perl script we have in there
6649 .PHONY: valgrind-tests
6650 valgrind-tests: $(TESTS)
6651         $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
6652                 if file $$f | grep -q shell; then \
6653                 echo -e "$${x}Skipping non-binary $$f"; else \
6654                 echo -e "$${x}Running $$f"; \
6655                 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
6656                 x="\n\n"; \
6657         done
6658
6659 exported-%: %
6660         $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
6661
6662 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
6663         $(AM_V_GEN)cat $^ > $@
6664
6665 .PHONY: check-api-docs
6666 check-api-docs: exported man
6667         $(AM_V_GEN)for symbol in `cat exported` ; do \
6668                 if test -f $(builddir)/man/$$symbol.html ; then \
6669                         echo "  Symbol $$symbol() is documented." ; \
6670                 else \
6671                         echo "‣ Symbol $$symbol() lacks documentation." ; \
6672                 fi ; \
6673         done
6674
6675 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
6676 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
6677
6678 undefined defined: $(ALL_OBJECTS)
6679         $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
6680                 $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
6681         done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
6682
6683 CLEANFILES += \
6684         defined \
6685         undefined
6686
6687 .PHONY: check-api-unused
6688 check-api-unused: defined undefined exported
6689         ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
6690
6691 .PHONY: check-includes
6692 check-includes: $(top_srcdir)/tools/check-includes.pl
6693         $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
6694                 | xargs $(top_srcdir)/tools/check-includes.pl
6695
6696 EXTRA_DIST += \
6697         $(top_srcdir)/tools/check-includes.pl
6698
6699 # Stupid test that everything purported to be exported really is
6700 define generate-sym-test
6701         $(AM_V_at)$(MKDIR_P) $(dir $@)
6702         $(AM_V_at)printf '#include <stdio.h>\n' > $@
6703         $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
6704         $(AM_V_at)printf 'void* functions[] = {\n' >> $@
6705         $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
6706         $(AM_V_at)printf '};\nint main(void) {\n' >> $@
6707         $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
6708         $(AM_V_at)printf 'return 0; }\n' >> $@
6709 endef
6710
6711 test-libsystemd-sym.c: \
6712                 $(top_builddir)/src/libsystemd/libsystemd.sym \
6713                 src/systemd/sd-journal.h \
6714                 src/systemd/sd-daemon.h \
6715                 src/systemd/sd-login.h \
6716                 src/systemd/sd-bus.h \
6717                 src/systemd/sd-utf8.h \
6718                 src/systemd/sd-resolve.h \
6719                 src/systemd/sd-path.h
6720         $(generate-sym-test)
6721
6722 test-libudev-sym.c: \
6723                 src/libudev/libudev.sym \
6724                 src/udev/udev.h
6725         $(generate-sym-test)
6726
6727 test_libsystemd_sym_SOURCES = \
6728         test-libsystemd-sym.c
6729 test_libsystemd_sym_LDADD = \
6730         libsystemd.la
6731
6732 test_libudev_sym_SOURCES = \
6733         test-libudev-sym.c
6734 test_libudev_sym_CFLAGS = \
6735         $(AM_CFLAGS) \
6736         -Wno-deprecated-declarations
6737 test_libudev_sym_LDADD = \
6738         libudev.la
6739
6740 BUILT_SOURCES += \
6741         $(test_libsystemd_sym_SOURCES) \
6742         $(test_libudev_sym_SOURCES)
6743
6744 tests += \
6745         test-libsystemd-sym \
6746         test-libudev-sym
6747
6748 .PHONY: cppcheck
6749 cppcheck:
6750         cppcheck --enable=all -q $(top_srcdir)
6751
6752 # Used to extract compile flags for YCM.
6753 print-%:
6754         @echo $($*)
6755
6756 git-contrib:
6757         @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u
6758
6759 EXTRA_DIST += \
6760         tools/gdb-sd_dump_hashmaps.py
6761
6762 list-keys:
6763         gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
6764
6765 add-key:
6766         gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -