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