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