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