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