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