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