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