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