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