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