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