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