chiark / gitweb /
bus: always consider well-known names sender credentials as attached to messages
[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 SUBDIRS = . po
28
29 # remove targets if the command fails
30 .DELETE_ON_ERROR:
31
32 # keep intermediate files
33 .SECONDARY:
34
35 # Keep the test-suite.log
36 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
37
38 LIBUDEV_CURRENT=5
39 LIBUDEV_REVISION=0
40 LIBUDEV_AGE=4
41
42 LIBGUDEV_CURRENT=1
43 LIBGUDEV_REVISION=3
44 LIBGUDEV_AGE=1
45
46 LIBSYSTEMD_LOGIN_CURRENT=9
47 LIBSYSTEMD_LOGIN_REVISION=1
48 LIBSYSTEMD_LOGIN_AGE=9
49
50 LIBSYSTEMD_DAEMON_CURRENT=0
51 LIBSYSTEMD_DAEMON_REVISION=10
52 LIBSYSTEMD_DAEMON_AGE=0
53
54 LIBSYSTEMD_ID128_CURRENT=0
55 LIBSYSTEMD_ID128_REVISION=26
56 LIBSYSTEMD_ID128_AGE=0
57
58 LIBSYSTEMD_JOURNAL_CURRENT=11
59 LIBSYSTEMD_JOURNAL_REVISION=3
60 LIBSYSTEMD_JOURNAL_AGE=11
61
62 LIBSYSTEMD_BUS_CURRENT=0
63 LIBSYSTEMD_BUS_REVISION=0
64 LIBSYSTEMD_BUS_AGE=0
65
66 # Dirs of external packages
67 dbuspolicydir=@dbuspolicydir@
68 dbussessionservicedir=@dbussessionservicedir@
69 dbussystemservicedir=@dbussystemservicedir@
70 pamlibdir=@pamlibdir@
71 pamconfdir=@pamconfdir@
72 pkgconfigdatadir=$(datadir)/pkgconfig
73 pkgconfiglibdir=$(libdir)/pkgconfig
74 polkitpolicydir=$(datadir)/polkit-1/actions
75 bashcompletiondir=@bashcompletiondir@
76 zshcompletiondir=@zshcompletiondir@
77 rpmmacrosdir=$(prefix)/lib/rpm/macros.d
78 sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
79 sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
80 varlogdir=$(localstatedir)/log
81 systemdstatedir=$(localstatedir)/lib/systemd
82 catalogstatedir=$(systemdstatedir)/catalog
83
84 # Our own, non-special dirs
85 pkgsysconfdir=$(sysconfdir)/systemd
86 userunitdir=$(prefix)/lib/systemd/user
87 userpresetdir=$(prefix)/lib/systemd/user-preset
88 tmpfilesdir=$(prefix)/lib/tmpfiles.d
89 sysctldir=$(prefix)/lib/sysctl.d
90 networkdir=$(prefix)/lib/systemd/network
91 pkgincludedir=$(includedir)/systemd
92 systemgeneratordir=$(rootlibexecdir)/system-generators
93 usergeneratordir=$(prefix)/lib/systemd/user-generators
94 systemshutdowndir=$(rootlibexecdir)/system-shutdown
95 systemsleepdir=$(rootlibexecdir)/system-sleep
96 systemunitdir=$(rootprefix)/lib/systemd/system
97 systempresetdir=$(rootprefix)/lib/systemd/system-preset
98 udevlibexecdir=$(rootprefix)/lib/udev
99 udevhomedir=$(udevlibexecdir)
100 udevrulesdir=$(udevlibexecdir)/rules.d
101 udevhwdbdir=$(udevlibexecdir)/hwdb.d
102 catalogdir=$(prefix)/lib/systemd/catalog
103 kernelinstalldir = $(prefix)/lib/kernel/install.d
104
105 # And these are the special ones for /
106 rootprefix=@rootprefix@
107 rootbindir=$(rootprefix)/bin
108 rootlibexecdir=$(rootprefix)/lib/systemd
109
110 CLEANFILES = $(BUILT_SOURCES)
111 DISTCLEANFILES =
112 EXTRA_DIST =
113 BUILT_SOURCES =
114 INSTALL_EXEC_HOOKS =
115 UNINSTALL_EXEC_HOOKS =
116 INSTALL_DATA_HOOKS =
117 UNINSTALL_DATA_HOOKS =
118 DISTCLEAN_LOCAL_HOOKS =
119 CLEAN_LOCAL_HOOKS =
120 pkginclude_HEADERS =
121 noinst_LTLIBRARIES =
122 lib_LTLIBRARIES =
123 include_HEADERS =
124 noinst_DATA =
125 pkgconfiglib_DATA =
126 polkitpolicy_in_in_files =
127 polkitpolicy_in_files =
128 polkitpolicy_files =
129 dist_udevrules_DATA =
130 nodist_udevrules_DATA =
131 dist_pkgsysconf_DATA =
132 dist_pkgdata_DATA =
133 dist_dbuspolicy_DATA =
134 dist_dbussystemservice_DATA =
135 check_PROGRAMS =
136 check_DATA =
137 tests=
138 manual_tests =
139 if ENABLE_TESTS
140 noinst_PROGRAMS = $(manual_tests) $(tests)
141 TESTS = $(tests)
142 else
143 noinst_PROGRAMS =
144 TESTS =
145 endif
146 udevlibexec_PROGRAMS =
147
148 AM_CPPFLAGS = \
149         -include $(top_builddir)/config.h \
150         -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
151         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
152         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
153         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
154         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
155         -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
156         -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
157         -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
158         -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
159         -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
160         -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
161         -DSYSTEMD_SLEEP_BINARY_PATH=\"$(rootlibexecdir)/systemd-sleep\" \
162         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
163         -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(rootbindir)/systemd-tty-ask-password-agent\" \
164         -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
165         -DROOTPREFIX=\"$(rootprefix)\" \
166         -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\" \
167         -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\" \
168         -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
169         -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
170         -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
171         -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
172         -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
173         -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
174         -DX_SERVER=\"$(bindir)/X\" \
175         -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
176         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
177         -DQUOTACHECK=\"$(QUOTACHECK)\" \
178         -DKEXEC=\"$(KEXEC)\" \
179         -I $(top_srcdir)/src \
180         -I $(top_builddir)/src/shared \
181         -I $(top_srcdir)/src/shared \
182         -I $(top_srcdir)/src/network \
183         -I $(top_srcdir)/src/login \
184         -I $(top_srcdir)/src/journal \
185         -I $(top_srcdir)/src/systemd \
186         -I $(top_builddir)/src/core \
187         -I $(top_srcdir)/src/core \
188         -I $(top_srcdir)/src/libudev \
189         -I $(top_srcdir)/src/udev \
190         -I $(top_srcdir)/src/udev/net \
191         -I $(top_builddir)/src/udev \
192         -I $(top_srcdir)/src/libsystemd-bus \
193         -I $(top_srcdir)/src/libsystemd-rtnl \
194         $(OUR_CPPFLAGS)
195
196 AM_CFLAGS = $(OUR_CFLAGS)
197 AM_LDFLAGS = $(OUR_LDFLAGS)
198
199 # ------------------------------------------------------------------------------
200 define move-to-rootlibdir
201         if test "$(libdir)" != "$(rootlibdir)"; then \
202                 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
203                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
204                 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
205                 $(LN_S) -f $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
206                 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
207         fi
208 endef
209
210 INSTALL_DIRS =
211
212 RUNLEVEL1_TARGET_WANTS =
213 RUNLEVEL2_TARGET_WANTS =
214 RUNLEVEL3_TARGET_WANTS =
215 RUNLEVEL4_TARGET_WANTS =
216 RUNLEVEL5_TARGET_WANTS =
217 SHUTDOWN_TARGET_WANTS =
218 LOCAL_FS_TARGET_WANTS =
219 MULTI_USER_TARGET_WANTS =
220 SYSINIT_TARGET_WANTS =
221 SOCKETS_TARGET_WANTS =
222 BUSNAMES_TARGET_WANTS =
223 TIMERS_TARGET_WANTS =
224
225 SYSTEM_UNIT_ALIASES =
226 USER_UNIT_ALIASES =
227
228 GENERAL_ALIASES =
229
230 install-target-wants-hook:
231         what="$(RUNLEVEL1_TARGET_WANTS)" && wants=runlevel1.target && $(add-wants)
232         what="$(RUNLEVEL2_TARGET_WANTS)" && wants=runlevel2.target && $(add-wants)
233         what="$(RUNLEVEL3_TARGET_WANTS)" && wants=runlevel3.target && $(add-wants)
234         what="$(RUNLEVEL4_TARGET_WANTS)" && wants=runlevel4.target && $(add-wants)
235         what="$(RUNLEVEL5_TARGET_WANTS)" && wants=runlevel5.target && $(add-wants)
236         what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && $(add-wants)
237         what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && $(add-wants)
238         what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && $(add-wants)
239         what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && $(add-wants)
240         what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && $(add-wants)
241         what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && $(add-wants)
242         what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && $(add-wants)
243         what="$(SLICES_TARGET_WANTS)" && wants=slices.target && $(add-wants)
244
245 define add-wants
246         [ -z "$$what" ] || ( \
247           dir=$(DESTDIR)$(systemunitdir)/$$wants.wants && \
248           $(MKDIR_P) -m 0755 $$dir && \
249           cd $$dir && \
250           rm -f $$what && \
251           for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
252 endef
253
254 install-directories-hook:
255         $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
256
257 install-aliases-hook:
258         set -- $(SYSTEM_UNIT_ALIASES) && \
259                 dir=$(systemunitdir) && $(install-aliases)
260         set -- $(USER_UNIT_ALIASES) && \
261                 dir=$(userunitdir) && $(install-aliases)
262         set -- $(GENERAL_ALIASES) && \
263                 dir= && $(install-aliases)
264
265 define install-aliases
266         while [ -n "$$1" ]; do \
267                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
268                 rm -f $(DESTDIR)$$dir/$$2 && \
269                 $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
270                 shift 2 || exit $$?; \
271         done
272 endef
273
274 INSTALL_EXEC_HOOKS += \
275         install-target-wants-hook \
276         install-directories-hook \
277         install-aliases-hook
278
279 # ------------------------------------------------------------------------------
280 AM_V_M4 = $(AM_V_M4_$(V))
281 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
282 AM_V_M4_0 = @echo "  M4      " $@;
283
284 AM_V_XSLT = $(AM_V_XSLT_$(V))
285 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
286 AM_V_XSLT_0 = @echo "  XSLT    " $@;
287
288 AM_V_GPERF = $(AM_V_GPERF_$(V))
289 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
290 AM_V_GPERF_0 = @echo "  GPERF   " $@;
291
292 AM_V_LN = $(AM_V_LN_$(V))
293 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
294 AM_V_LN_0 = @echo "  LN      " $@;
295
296 # ------------------------------------------------------------------------------
297 rootbin_PROGRAMS = \
298         systemctl \
299         systemd-notify \
300         systemd-ask-password \
301         systemd-tty-ask-password-agent \
302         systemd-machine-id-setup
303
304 bin_PROGRAMS = \
305         systemd-cgls \
306         systemd-cgtop \
307         systemd-nspawn \
308         systemd-detect-virt \
309         systemd-delta \
310         systemd-analyze \
311         systemd-run
312
313 dist_bin_SCRIPTS = \
314         src/kernel-install/kernel-install
315
316 dist_kernelinstall_SCRIPTS = \
317         src/kernel-install/50-depmod.install \
318         src/kernel-install/90-loaderentry.install
319
320 rootlibexec_PROGRAMS = \
321         systemd \
322         systemd-cgroups-agent \
323         systemd-initctl \
324         systemd-update-utmp \
325         systemd-shutdownd \
326         systemd-shutdown \
327         systemd-remount-fs \
328         systemd-reply-password \
329         systemd-fsck \
330         systemd-ac-power \
331         systemd-sysctl \
332         systemd-sleep \
333         systemd-bus-proxyd \
334         systemd-socket-proxyd
335
336 systemgenerator_PROGRAMS = \
337         systemd-getty-generator \
338         systemd-fstab-generator \
339         systemd-system-update-generator
340
341 dist_bashcompletion_DATA = \
342         shell-completion/bash/journalctl \
343         shell-completion/bash/systemctl \
344         shell-completion/bash/systemd-analyze \
345         shell-completion/bash/systemd-run \
346         shell-completion/bash/udevadm \
347         shell-completion/bash/kernel-install
348
349 dist_zshcompletion_DATA = \
350         shell-completion/zsh/_systemctl \
351         shell-completion/zsh/_journalctl \
352         shell-completion/zsh/_udevadm \
353         shell-completion/zsh/_kernel-install \
354         shell-completion/zsh/_systemd-nspawn \
355         shell-completion/zsh/_systemd-analyze \
356         shell-completion/zsh/_systemd-run \
357         shell-completion/zsh/_sd_hosts_or_user_at_host \
358         shell-completion/zsh/_systemd-delta \
359         shell-completion/zsh/_systemd
360
361 dist_sysctl_DATA = \
362         sysctl.d/50-default.conf
363
364 dist_systemunit_DATA = \
365         units/graphical.target \
366         units/multi-user.target \
367         units/emergency.service \
368         units/emergency.target \
369         units/sysinit.target \
370         units/basic.target \
371         units/getty.target \
372         units/halt.target \
373         units/kexec.target \
374         units/local-fs.target \
375         units/local-fs-pre.target \
376         units/initrd.target \
377         units/initrd-fs.target \
378         units/initrd-root-fs.target \
379         units/remote-fs.target \
380         units/remote-fs-pre.target \
381         units/network.target \
382         units/network-online.target \
383         units/nss-lookup.target \
384         units/nss-user-lookup.target \
385         units/hibernate.target \
386         units/hybrid-sleep.target \
387         units/poweroff.target \
388         units/reboot.target \
389         units/rescue.target \
390         units/rpcbind.target \
391         units/time-sync.target \
392         units/shutdown.target \
393         units/final.target \
394         units/umount.target \
395         units/sigpwr.target \
396         units/sleep.target \
397         units/sockets.target \
398         units/busnames.target \
399         units/timers.target \
400         units/paths.target \
401         units/suspend.target \
402         units/swap.target \
403         units/slices.target \
404         units/system.slice \
405         units/x-.slice \
406         units/systemd-initctl.socket \
407         units/systemd-shutdownd.socket \
408         units/syslog.socket \
409         units/dev-hugepages.mount \
410         units/dev-mqueue.mount \
411         units/sys-kernel-config.mount \
412         units/sys-kernel-debug.mount \
413         units/sys-fs-fuse-connections.mount \
414         units/tmp.mount \
415         units/printer.target \
416         units/sound.target \
417         units/bluetooth.target \
418         units/smartcard.target \
419         units/systemd-ask-password-wall.path \
420         units/systemd-ask-password-console.path \
421         units/systemd-udevd-control.socket \
422         units/systemd-udevd-kernel.socket \
423         units/system-update.target \
424         units/initrd-switch-root.target
425
426 nodist_systemunit_DATA = \
427         units/getty@.service \
428         units/serial-getty@.service \
429         units/console-shell.service \
430         units/console-getty.service \
431         units/container-getty@.service \
432         units/systemd-initctl.service \
433         units/systemd-shutdownd.service \
434         units/systemd-remount-fs.service \
435         units/systemd-update-utmp.service \
436         units/systemd-update-utmp-runlevel.service \
437         units/systemd-ask-password-wall.service \
438         units/systemd-ask-password-console.service \
439         units/systemd-sysctl.service \
440         units/emergency.service \
441         units/rescue.service \
442         units/user@.service \
443         units/systemd-hibernate.service \
444         units/systemd-hybrid-sleep.service \
445         units/systemd-suspend.service \
446         units/systemd-halt.service \
447         units/systemd-poweroff.service \
448         units/systemd-reboot.service \
449         units/systemd-kexec.service \
450         units/systemd-fsck@.service \
451         units/systemd-fsck-root.service \
452         units/systemd-udevd.service \
453         units/systemd-udev-trigger.service \
454         units/systemd-udev-settle.service \
455         units/debug-shell.service \
456         units/initrd-parse-etc.service \
457         units/initrd-cleanup.service \
458         units/initrd-udevadm-cleanup-db.service \
459         units/initrd-switch-root.service \
460         units/systemd-nspawn@.service
461
462 dist_userunit_DATA = \
463         units/user/default.target \
464         units/user/exit.target
465
466 nodist_userunit_DATA = \
467         units/user/systemd-exit.service
468
469 EXTRA_DIST += \
470         units/getty@.service.m4 \
471         units/serial-getty@.service.m4 \
472         units/console-shell.service.m4.in \
473         units/console-getty.service.m4.in \
474         units/container-getty@.service.m4.in \
475         units/rescue.service.m4.in \
476         units/systemd-initctl.service.in \
477         units/systemd-shutdownd.service.in \
478         units/systemd-remount-fs.service.in \
479         units/systemd-update-utmp.service.in \
480         units/systemd-update-utmp-runlevel.service.in \
481         units/systemd-ask-password-wall.service.in \
482         units/systemd-ask-password-console.service.in \
483         units/systemd-sysctl.service.in \
484         units/emergency.service.in \
485         units/systemd-halt.service.in \
486         units/systemd-poweroff.service.in \
487         units/systemd-reboot.service.in \
488         units/systemd-kexec.service.in \
489         units/user/systemd-exit.service.in \
490         units/systemd-fsck@.service.in \
491         units/systemd-fsck-root.service.in \
492         units/user@.service.in \
493         units/systemd-udevd.service \
494         units/systemd-udev-trigger.service \
495         units/systemd-udev-settle.service \
496         units/debug-shell.service.in \
497         units/systemd-hibernate.service.in \
498         units/systemd-hybrid-sleep.service.in \
499         units/systemd-suspend.service.in \
500         units/quotaon.service.in \
501         units/initrd-parse-etc.service.in \
502         units/initrd-cleanup.service.in \
503         units/initrd-udevadm-cleanup-db.service.in \
504         units/initrd-switch-root.service.in \
505         units/systemd-nspawn@.service.in
506
507 CLEANFILES += \
508         units/console-shell.service.m4 \
509         units/console-getty.service.m4 \
510         units/container-getty@.service.m4 \
511         units/rescue.service.m4
512
513 if HAVE_SYSV_COMPAT
514 nodist_systemunit_DATA += \
515         units/rc-local.service \
516         units/halt-local.service
517
518 systemgenerator_PROGRAMS += \
519         systemd-rc-local-generator
520 endif
521
522 EXTRA_DIST += \
523         units/rc-local.service.in \
524         units/halt-local.service.in
525
526 # automake is broken and can't handle files with a dash in front
527 # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14728#8
528 units-install-hook:
529         mv $(DESTDIR)$(systemunitdir)/x-.slice $(DESTDIR)/$(systemunitdir)/-.slice
530
531 units-uninstall-hook:
532         rm -f $(DESTDIR)/$(systemunitdir)/-.slice
533
534 INSTALL_DATA_HOOKS += units-install-hook
535 UNINSTALL_DATA_HOOKS += units-uninstall-hook
536
537 dist_doc_DATA = \
538         README \
539         NEWS \
540         LICENSE.LGPL2.1 \
541         LICENSE.GPL2 \
542         LICENSE.MIT \
543         DISTRO_PORTING
544
545 @INTLTOOL_POLICY_RULE@
546
547 # ------------------------------------------------------------------------------
548
549 MANPAGES =
550 MANPAGES_ALIAS =
551
552 include Makefile-man.am
553
554 .PHONY: man
555 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
556
557 XML_FILES = \
558         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
559 HTML_FILES = \
560         ${XML_FILES:.xml=.html}
561 HTML_ALIAS = \
562         ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
563
564 if ENABLE_MANPAGES
565 man_MANS = \
566         $(MANPAGES) \
567         $(MANPAGES_ALIAS)
568
569 noinst_DATA += \
570         $(HTML_FILES) \
571         $(HTML_ALIAS)
572
573 CLEANFILES += \
574         $(man_MANS) \
575         $(HTML_FILES) \
576         $(HTML_ALIAS)
577
578 docs/html/man:
579         $(AM_V_at)$(MKDIR_P) $(dir $@)
580         $(AM_V_LN)$(LN_S) -f ../../man $@
581
582 noinst_DATA += \
583         docs/html/man
584
585 CLEANFILES += \
586         docs/html/man
587
588 if HAVE_PYTHON
589 man/index.html: man/systemd.index.html
590         $(AM_V_LN)$(LN_S) -f systemd.index.html $@
591
592 noinst_DATA += \
593         man/index.html
594
595 CLEANFILES += \
596         man/index.html
597
598 XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml)
599 NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
600 SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))
601
602 update-man-list: make-man-rules.py $(XML_GLOB)
603         $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
604         $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
605         @echo "Makefile-man.am has been regenerated"
606
607 man/systemd.index.xml: make-man-index.py $(NON_INDEX_XML_FILES)
608         $(AM_V_at)$(MKDIR_P) $(dir $@)
609         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
610
611 man/systemd.directives.xml: make-directive-index.py $(SOURCE_XML_FILES)
612         $(AM_V_at)$(MKDIR_P) $(dir $@)
613         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
614
615 EXTRA_DIST += \
616         man/systemd.index.xml \
617         man/index.html \
618         man/systemd.directives.xml
619
620 CLEANFILES += \
621         man/systemd.index.xml \
622         man/systemd.directives.xml
623
624 endif
625
626 endif
627
628 EXTRA_DIST += \
629         $(XML_FILES) \
630         $(HTML_FILES) \
631         $(HTML_ALIAS) \
632         $(man_MANS) \
633         make-man-index.py \
634         make-directive-index.py \
635         xml_helper.py
636
637 # ------------------------------------------------------------------------------
638 noinst_LTLIBRARIES += \
639         libsystemd-rtnl.la
640
641 libsystemd_rtnl_la_SOURCES = \
642         src/systemd/sd-rtnl.h \
643         src/libsystemd-rtnl/sd-rtnl.c \
644         src/libsystemd-rtnl/rtnl-internal.h \
645         src/libsystemd-rtnl/rtnl-message.c \
646         src/libsystemd-rtnl/rtnl-util.h \
647         src/libsystemd-rtnl/rtnl-util.c
648
649 test_rtnl_SOURCES = \
650         src/libsystemd-rtnl/test-rtnl.c
651
652 test_rtnl_LDADD = \
653         libsystemd-rtnl.la \
654         libsystemd-bus-internal.la \
655         libsystemd-daemon-internal.la \
656         libsystemd-id128-internal.la \
657         libsystemd-shared.la
658
659 tests += \
660         test-rtnl
661
662 # ------------------------------------------------------------------------------
663 noinst_LTLIBRARIES += \
664         libsystemd-shared.la
665
666 libsystemd_shared_la_SOURCES = \
667         src/shared/linux/auto_dev-ioctl.h \
668         src/shared/linux/fanotify.h \
669         src/shared/linux/seccomp.h \
670         src/shared/linux/seccomp-bpf.h \
671         src/shared/ioprio.h \
672         src/shared/missing.h \
673         src/shared/initreq.h \
674         src/shared/securebits.h \
675         src/shared/special.h \
676         src/shared/list.h \
677         src/shared/macro.h \
678         src/shared/def.h \
679         src/shared/sparse-endian.h \
680         src/shared/refcnt.h \
681         src/shared/udev-util.h \
682         src/shared/bus-errors.h \
683         src/shared/device-nodes.c \
684         src/shared/device-nodes.h \
685         src/shared/util.c \
686         src/shared/util.h \
687         src/shared/virt.c \
688         src/shared/virt.h \
689         src/shared/efivars.c \
690         src/shared/efivars.h \
691         src/shared/path-util.c \
692         src/shared/path-util.h \
693         src/shared/time-util.c \
694         src/shared/time-util.h \
695         src/shared/hashmap.c \
696         src/shared/hashmap.h \
697         src/shared/set.c \
698         src/shared/set.h \
699         src/shared/fdset.c \
700         src/shared/fdset.h \
701         src/shared/prioq.c \
702         src/shared/prioq.h \
703         src/shared/sleep-config.c \
704         src/shared/sleep-config.h \
705         src/shared/strv.c \
706         src/shared/strv.h \
707         src/shared/env-util.c \
708         src/shared/env-util.h \
709         src/shared/strbuf.c \
710         src/shared/strbuf.h \
711         src/shared/strxcpyx.c \
712         src/shared/strxcpyx.h \
713         src/shared/conf-parser.c \
714         src/shared/conf-parser.h \
715         src/shared/log.c \
716         src/shared/log.h \
717         src/shared/ratelimit.h \
718         src/shared/ratelimit.c \
719         src/shared/exit-status.c \
720         src/shared/exit-status.h \
721         src/shared/utf8.c \
722         src/shared/utf8.h \
723         src/shared/gunicode.c \
724         src/shared/gunicode.h \
725         src/shared/pager.c \
726         src/shared/pager.h \
727         src/shared/socket-util.c \
728         src/shared/socket-util.h \
729         src/shared/conf-files.c \
730         src/shared/conf-files.h \
731         src/shared/cgroup-util.c \
732         src/shared/cgroup-util.h \
733         src/shared/cgroup-show.c \
734         src/shared/cgroup-show.h \
735         src/shared/unit-name.c \
736         src/shared/unit-name.h \
737         src/shared/utmp-wtmp.c \
738         src/shared/utmp-wtmp.h \
739         src/shared/watchdog.c \
740         src/shared/watchdog.h \
741         src/shared/spawn-ask-password-agent.c \
742         src/shared/spawn-ask-password-agent.h \
743         src/shared/replace-var.c \
744         src/shared/replace-var.h \
745         src/shared/spawn-polkit-agent.c \
746         src/shared/spawn-polkit-agent.h \
747         src/shared/hwclock.c \
748         src/shared/hwclock.h \
749         src/shared/time-dst.c \
750         src/shared/time-dst.h \
751         src/shared/calendarspec.c \
752         src/shared/calendarspec.h \
753         src/shared/fileio.c \
754         src/shared/fileio.h \
755         src/shared/output-mode.h \
756         src/shared/MurmurHash3.c \
757         src/shared/MurmurHash3.h \
758         src/shared/acpi-fpdt.h \
759         src/shared/acpi-fpdt.c \
760         src/shared/boot-timestamps.h \
761         src/shared/boot-timestamps.c \
762         src/shared/mkdir.c \
763         src/shared/mkdir.h \
764         src/shared/smack-util.c \
765         src/shared/smack-util.h \
766         src/shared/apparmor-util.c \
767         src/shared/apparmor-util.h \
768         src/shared/ima-util.c \
769         src/shared/ima-util.h \
770         src/shared/ptyfwd.c \
771         src/shared/ptyfwd.h \
772         src/shared/net-util.c \
773         src/shared/net-util.h \
774         src/shared/errno-list.c \
775         src/shared/errno-list.h \
776         src/shared/syscall-list.c \
777         src/shared/syscall-list.h \
778         src/shared/audit.c \
779         src/shared/audit.h
780
781 nodist_libsystemd_shared_la_SOURCES = \
782         src/shared/errno-from-name.h \
783         src/shared/errno-to-name.h \
784         src/shared/syscall-from-name.h \
785         src/shared/syscall-to-name.h
786
787 # ------------------------------------------------------------------------------
788 noinst_LTLIBRARIES += \
789         libsystemd-units.la
790
791 libsystemd_units_la_SOURCES = \
792         src/shared/install.c \
793         src/shared/install.h \
794         src/shared/install-printf.c \
795         src/shared/install-printf.h \
796         src/shared/path-lookup.c \
797         src/shared/path-lookup.h \
798         src/shared/specifier.c \
799         src/shared/specifier.h
800
801 # ------------------------------------------------------------------------------
802 noinst_LTLIBRARIES += \
803         libsystemd-label.la
804
805 libsystemd_label_la_SOURCES = \
806         src/shared/socket-label.c \
807         src/shared/label.c \
808         src/shared/label.h \
809         src/shared/selinux-util.c \
810         src/shared/selinux-util.h \
811         src/shared/mkdir-label.c \
812         src/shared/ask-password-api.c \
813         src/shared/ask-password-api.h \
814         src/shared/fileio-label.c \
815         src/shared/fileio-label.h \
816         src/shared/dev-setup.c \
817         src/shared/dev-setup.h
818
819 libsystemd_label_la_CFLAGS = \
820         $(AM_CFLAGS) \
821         $(SELINUX_CFLAGS)
822
823 libsystemd_label_la_LIBADD = \
824         $(SELINUX_LIBS)
825
826 # ------------------------------------------------------------------------------
827 noinst_LTLIBRARIES += \
828         libsystemd-logs.la
829
830 libsystemd_logs_la_SOURCES = \
831         src/shared/logs-show.c \
832         src/shared/logs-show.h
833
834 # ------------------------------------------------------------------------------
835 noinst_LTLIBRARIES += \
836         libsystemd-capability.la
837
838 libsystemd_capability_la_SOURCES = \
839         src/shared/capability.c \
840         src/shared/capability.h
841
842 libsystemd_capability_la_CFLAGS = \
843         $(AM_CFLAGS) \
844         $(CAP_CFLAGS)
845
846 libsystemd_capability_la_LIBADD = \
847         $(CAP_LIBS)
848
849 # ------------------------------------------------------------------------------
850 if HAVE_ACL
851 noinst_LTLIBRARIES += \
852         libsystemd-acl.la
853
854 libsystemd_acl_la_SOURCES = \
855         src/shared/acl-util.c \
856         src/shared/acl-util.h
857
858 libsystemd_acl_la_CFLAGS = \
859         $(AM_CFLAGS) \
860         $(ACL_CFLAGS)
861
862 libsystemd_acl_la_LIBADD = \
863         $(ACL_LIBS)
864 endif
865
866 # ------------------------------------------------------------------------------
867 noinst_LTLIBRARIES += \
868         libsystemd-core.la
869
870 libsystemd_core_la_SOURCES = \
871         src/core/unit.c \
872         src/core/unit.h \
873         src/core/unit-printf.c \
874         src/core/unit-printf.h \
875         src/core/job.c \
876         src/core/job.h \
877         src/core/manager.c \
878         src/core/manager.h \
879         src/core/transaction.c \
880         src/core/transaction.h \
881         src/core/load-fragment.c \
882         src/core/load-fragment.h \
883         src/core/service.c \
884         src/core/service.h \
885         src/core/socket.c \
886         src/core/socket.h \
887         src/core/busname.c \
888         src/core/busname.h \
889         src/core/target.c \
890         src/core/target.h \
891         src/core/snapshot.c \
892         src/core/snapshot.h \
893         src/core/device.c \
894         src/core/device.h \
895         src/core/mount.c \
896         src/core/mount.h \
897         src/core/automount.c \
898         src/core/automount.h \
899         src/core/swap.c \
900         src/core/swap.h \
901         src/core/timer.c \
902         src/core/timer.h \
903         src/core/path.c \
904         src/core/path.h \
905         src/core/slice.c \
906         src/core/slice.h \
907         src/core/scope.c \
908         src/core/scope.h \
909         src/core/load-dropin.c \
910         src/core/load-dropin.h \
911         src/core/execute.c \
912         src/core/execute.h \
913         src/core/kill.c \
914         src/core/kill.h \
915         src/core/dbus.c \
916         src/core/dbus.h \
917         src/core/dbus-manager.c \
918         src/core/dbus-manager.h \
919         src/core/dbus-unit.c \
920         src/core/dbus-unit.h \
921         src/core/dbus-job.c \
922         src/core/dbus-job.h \
923         src/core/dbus-service.c \
924         src/core/dbus-service.h \
925         src/core/dbus-socket.c \
926         src/core/dbus-socket.h \
927         src/core/dbus-busname.c \
928         src/core/dbus-busname.h \
929         src/core/dbus-target.c \
930         src/core/dbus-target.h \
931         src/core/dbus-snapshot.c \
932         src/core/dbus-snapshot.h \
933         src/core/dbus-device.c \
934         src/core/dbus-device.h \
935         src/core/dbus-mount.c \
936         src/core/dbus-mount.h \
937         src/core/dbus-automount.c \
938         src/core/dbus-automount.h \
939         src/core/dbus-swap.c \
940         src/core/dbus-swap.h \
941         src/core/dbus-timer.c \
942         src/core/dbus-timer.h \
943         src/core/dbus-path.c \
944         src/core/dbus-path.h \
945         src/core/dbus-slice.c \
946         src/core/dbus-slice.h \
947         src/core/dbus-scope.c \
948         src/core/dbus-scope.h \
949         src/core/dbus-execute.c \
950         src/core/dbus-execute.h \
951         src/core/dbus-kill.c \
952         src/core/dbus-kill.h \
953         src/core/dbus-cgroup.c \
954         src/core/dbus-cgroup.h \
955         src/core/dbus-client-track.c \
956         src/core/dbus-client-track.h \
957         src/core/cgroup.c \
958         src/core/cgroup.h \
959         src/core/selinux-access.c \
960         src/core/selinux-access.h \
961         src/core/selinux-setup.c \
962         src/core/selinux-setup.h \
963         src/core/smack-setup.c \
964         src/core/smack-setup.h \
965         src/core/ima-setup.c \
966         src/core/ima-setup.h \
967         src/core/locale-setup.h \
968         src/core/locale-setup.c \
969         src/core/hostname-setup.c \
970         src/core/hostname-setup.h \
971         src/core/machine-id-setup.c \
972         src/core/machine-id-setup.h \
973         src/core/mount-setup.c \
974         src/core/mount-setup.h \
975         src/core/loopback-setup.h \
976         src/core/loopback-setup.c \
977         src/core/condition.c \
978         src/core/condition.h \
979         src/core/namespace.c \
980         src/core/namespace.h \
981         src/core/tcpwrap.c \
982         src/core/tcpwrap.h \
983         src/core/build.h \
984         src/core/sysfs-show.h \
985         src/core/switch-root.h \
986         src/core/switch-root.c \
987         src/core/killall.h \
988         src/core/killall.c \
989         src/core/audit-fd.c \
990         src/core/audit-fd.h \
991         src/core/async.c \
992         src/core/async.h
993
994 if HAVE_KMOD
995 libsystemd_core_la_SOURCES += \
996         src/core/kmod-setup.c \
997         src/core/kmod-setup.h
998 endif
999
1000 nodist_libsystemd_core_la_SOURCES = \
1001         src/core/load-fragment-gperf.c \
1002         src/core/load-fragment-gperf-nulstr.c
1003
1004 libsystemd_core_la_CFLAGS = \
1005         $(AM_CFLAGS) \
1006         $(LIBWRAP_CFLAGS) \
1007         $(PAM_CFLAGS) \
1008         $(AUDIT_CFLAGS) \
1009         $(KMOD_CFLAGS) \
1010         -pthread
1011
1012 libsystemd_core_la_LIBADD = \
1013         libsystemd-capability.la \
1014         libsystemd-units.la \
1015         libsystemd-label.la \
1016         libsystemd-id128-internal.la \
1017         libsystemd-daemon-internal.la \
1018         libudev-internal.la \
1019         libsystemd-shared.la \
1020         libsystemd-rtnl.la \
1021         libsystemd-bus-internal.la \
1022         $(LIBWRAP_LIBS) \
1023         $(PAM_LIBS) \
1024         $(AUDIT_LIBS) \
1025         $(CAP_LIBS) \
1026         $(KMOD_LIBS)
1027
1028 src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
1029         $(AM_V_at)$(MKDIR_P) $(dir $@)
1030         $(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 ";" }' < $< > $@
1031
1032 EXTRA_DIST += \
1033         src/core/load-fragment-gperf.gperf.m4
1034
1035 CLEANFILES += \
1036         src/core/load-fragment-gperf.gperf \
1037         src/core/load-fragment-gperf.c \
1038         src/core/load-fragment-gperf-nulstr.c \
1039         src/shared/syscall-list.txt \
1040         src/shared/syscall-from-name.gperf \
1041         src/shared/errno-list.txt \
1042         src/shared/errno-from-name.gperf
1043
1044 BUILT_SOURCES += \
1045         src/shared/syscall-from-name.h \
1046         src/shared/syscall-to-name.h \
1047         src/shared/errno-from-name.h \
1048         src/shared/errno-to-name.h
1049
1050 src/shared/syscall-list.txt:
1051         $(AM_V_at)$(MKDIR_P) $(dir $@)
1052         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h - < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9(]/ { sub(/__NR_/, "", $$2); if ($$2 !~ /SYSCALL_BASE/) print $$2; }' > $@
1053
1054 src/shared/syscall-from-name.gperf: src/shared/syscall-list.txt
1055         $(AM_V_at)$(MKDIR_P) $(dir $@)
1056         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct syscall_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, __NR_%s\n", $$1, $$1 }' < $< > $@
1057
1058 src/shared/syscall-from-name.h: src/shared/syscall-from-name.gperf
1059         $(AM_V_at)$(MKDIR_P) $(dir $@)
1060         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_syscall -H hash_syscall_name -p -C < $< > $@
1061
1062 src/shared/syscall-to-name.h: src/shared/syscall-list.txt
1063         $(AM_V_at)$(MKDIR_P) $(dir $@)
1064         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const syscall_names[] = { "} { printf "[SYSCALL_TO_INDEX(__NR_%s)] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
1065
1066 src/shared/errno-list.txt:
1067         $(AM_V_at)$(MKDIR_P) $(dir $@)
1068         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+[0-9]/ { print $$2; }'  > $@
1069
1070 src/shared/errno-from-name.gperf: src/shared/errno-list.txt
1071         $(AM_V_at)$(MKDIR_P) $(dir $@)
1072         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct errno_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
1073
1074 src/shared/errno-from-name.h: src/shared/errno-from-name.gperf
1075         $(AM_V_at)$(MKDIR_P) $(dir $@)
1076         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_errno -H hash_errno_name -p -C < $< > $@
1077
1078 src/shared/errno-to-name.h: src/shared/errno-list.txt
1079         $(AM_V_at)$(MKDIR_P) $(dir $@)
1080         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
1081
1082 # ------------------------------------------------------------------------------
1083 systemd_SOURCES = \
1084         src/core/main.c
1085
1086 systemd_LDADD = \
1087         libsystemd-core.la \
1088         $(RT_LIBS)
1089
1090 dist_pkgsysconf_DATA += \
1091         src/core/system.conf \
1092         src/core/user.conf
1093
1094 dist_dbuspolicy_DATA += \
1095         src/core/org.freedesktop.systemd1.conf
1096
1097 dist_dbussystemservice_DATA += \
1098         src/core/org.freedesktop.systemd1.service
1099
1100 polkitpolicy_in_in_files += \
1101         src/core/org.freedesktop.systemd1.policy.in.in
1102
1103 pkgconfigdata_DATA = \
1104         src/core/systemd.pc
1105
1106 nodist_rpmmacros_DATA = \
1107         src/core/macros.systemd
1108
1109 EXTRA_DIST += \
1110         src/core/systemd.pc.in \
1111         src/core/macros.systemd.in
1112
1113 CLEANFILES += \
1114         src/core/macros.systemd \
1115         src/core/org.freedesktop.systemd1.policy.in
1116
1117 # ------------------------------------------------------------------------------
1118 manual_tests += \
1119         test-engine \
1120         test-ns \
1121         test-loopback \
1122         test-hostname \
1123         test-daemon \
1124         test-cgroup \
1125         test-install \
1126         test-watchdog \
1127         test-log
1128
1129 tests += \
1130         test-job-type \
1131         test-env-replace \
1132         test-strbuf \
1133         test-strv \
1134         test-path-util \
1135         test-strxcpyx \
1136         test-unit-name \
1137         test-unit-file \
1138         test-utf8 \
1139         test-ellipsize \
1140         test-util \
1141         test-namespace \
1142         test-date \
1143         test-sleep \
1144         test-replace-var \
1145         test-sched-prio \
1146         test-calendarspec \
1147         test-strip-tab-ansi \
1148         test-cgroup-util \
1149         test-cgroup-mask \
1150         test-prioq \
1151         test-fileio \
1152         test-time \
1153         test-hashmap \
1154         test-list \
1155         test-tables \
1156         test-device-nodes
1157
1158 EXTRA_DIST += \
1159         test/sched_idle_bad.service \
1160         test/sched_idle_ok.service \
1161         test/sched_rr_bad.service \
1162         test/sched_rr_ok.service \
1163         test/sched_rr_change.service \
1164         test/son.service \
1165         test/daughter.service \
1166         test/parent.slice
1167
1168 EXTRA_DIST += \
1169         src/test/test-helper.h
1170
1171 test_device_nodes_SOURCES = \
1172         src/test/test-device-nodes.c
1173
1174 test_device_nodes_LDADD = \
1175         libsystemd-shared.la
1176
1177 test_engine_SOURCES = \
1178         src/test/test-engine.c
1179
1180 test_engine_LDADD = \
1181         libsystemd-core.la \
1182         $(RT_LIBS)
1183
1184 test_job_type_SOURCES = \
1185         src/test/test-job-type.c
1186
1187 test_job_type_LDADD = \
1188         libsystemd-core.la \
1189         $(RT_LIBS)
1190
1191 test_ns_SOURCES = \
1192         src/test/test-ns.c
1193
1194 test_ns_LDADD = \
1195         libsystemd-core.la
1196
1197 test_loopback_SOURCES = \
1198         src/test/test-loopback.c
1199
1200 test_loopback_LDADD = \
1201         libsystemd-core.la
1202
1203 test_hostname_SOURCES = \
1204         src/test/test-hostname.c
1205
1206 test_hostname_LDADD = \
1207         libsystemd-core.la
1208
1209 if ENABLE_EFI
1210 manual_tests += \
1211         test-boot-timestamp
1212
1213 test_boot_timestamp_SOURCES = \
1214         src/test/test-boot-timestamps.c
1215
1216 test_boot_timestamp_LDADD = \
1217         libsystemd-shared.la
1218 endif
1219
1220 test_unit_name_SOURCES = \
1221         src/test/test-unit-name.c
1222
1223 test_unit_name_LDADD = \
1224         libsystemd-core.la \
1225         $(RT_LIBS)
1226
1227 test_unit_file_SOURCES = \
1228         src/test/test-unit-file.c
1229
1230 test_unit_file_LDADD = \
1231         libsystemd-core.la \
1232         $(RT_LIBS)
1233
1234 test_utf8_SOURCES = \
1235         src/test/test-utf8.c
1236
1237 test_utf8_LDADD = \
1238         libsystemd-shared.la
1239
1240 test_util_SOURCES = \
1241         src/test/test-util.c
1242
1243 test_util_LDADD = \
1244         libsystemd-core.la
1245
1246 test_namespace_SOURCES = \
1247         src/test/test-namespace.c
1248
1249 test_namespace_LDADD = \
1250         libsystemd-core.la
1251
1252 test_hashmap_SOURCES = \
1253         src/test/test-hashmap.c
1254
1255 test_hashmap_LDADD = \
1256         libsystemd-core.la
1257
1258 test_list_SOURCES = \
1259         src/test/test-list.c
1260
1261 test_list_LDADD = \
1262         libsystemd-core.la
1263
1264 test_tables_SOURCES = \
1265         src/test/test-tables.c \
1266         src/shared/test-tables.h
1267
1268 test_tables_LDADD = \
1269         libsystemd-logs.la \
1270         libsystemd-journal-internal.la \
1271         libsystemd-core.la \
1272         $(RT_LIBS)
1273
1274 test_prioq_SOURCES = \
1275         src/test/test-prioq.c
1276
1277 test_prioq_LDADD = \
1278         libsystemd-core.la
1279
1280 test_fileio_SOURCES = \
1281         src/test/test-fileio.c
1282
1283 test_fileio_LDADD = \
1284         libsystemd-core.la
1285
1286 test_time_SOURCES = \
1287         src/test/test-time.c
1288
1289 test_time_LDADD = \
1290         libsystemd-core.la
1291
1292 test_log_SOURCES = \
1293         src/test/test-log.c
1294
1295 test_log_LDADD = \
1296         libsystemd-core.la
1297
1298 test_ellipsize_SOURCES = \
1299         src/test/test-ellipsize.c
1300
1301 test_ellipsize_LDADD = \
1302         libsystemd-core.la
1303
1304 test_date_SOURCES = \
1305         src/test/test-date.c
1306
1307 test_date_LDADD = \
1308         libsystemd-core.la
1309
1310 test_sleep_SOURCES = \
1311         src/test/test-sleep.c
1312
1313 test_sleep_LDADD = \
1314         libsystemd-core.la
1315
1316 test_replace_var_SOURCES = \
1317         src/test/test-replace-var.c
1318
1319 test_replace_var_LDADD = \
1320         libsystemd-shared.la
1321
1322 test_calendarspec_SOURCES = \
1323         src/test/test-calendarspec.c
1324
1325 test_calendarspec_LDADD = \
1326         libsystemd-shared.la
1327
1328 test_strip_tab_ansi_SOURCES = \
1329         src/test/test-strip-tab-ansi.c
1330
1331 test_strip_tab_ansi_LDADD = \
1332         libsystemd-shared.la
1333
1334 test_daemon_SOURCES = \
1335         src/test/test-daemon.c
1336
1337 test_daemon_LDADD = \
1338         libsystemd-daemon-internal.la \
1339         libsystemd-shared.la
1340
1341 test_cgroup_SOURCES = \
1342         src/test/test-cgroup.c
1343
1344 test_cgroup_LDADD = \
1345         libsystemd-label.la \
1346         libsystemd-shared.la
1347
1348 test_cgroup_mask_SOURCES = \
1349         src/test/test-cgroup-mask.c
1350
1351 test_cgroup_mask_CPPFLAGS = \
1352         $(AM_CPPFLAGS) \
1353         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1354
1355 test_cgroup_mask_LDADD = \
1356         libsystemd-core.la \
1357         $(RT_LIBS)
1358
1359 test_cgroup_util_SOURCES = \
1360         src/test/test-cgroup-util.c
1361
1362 test_cgroup_util_LDADD = \
1363         libsystemd-label.la \
1364         libsystemd-daemon-internal.la \
1365         libsystemd-shared.la
1366
1367 test_env_replace_SOURCES = \
1368         src/test/test-env-replace.c
1369
1370 test_env_replace_LDADD = \
1371         libsystemd-shared.la
1372
1373 test_strbuf_SOURCES = \
1374         src/test/test-strbuf.c
1375
1376 test_strbuf_LDADD = \
1377         libsystemd-shared.la
1378
1379 test_strv_SOURCES = \
1380         src/test/test-strv.c
1381
1382 test_strv_LDADD = \
1383         libsystemd-units.la \
1384         libsystemd-id128-internal.la \
1385         libsystemd-shared.la
1386
1387 test_path_util_SOURCES = \
1388         src/test/test-path-util.c
1389
1390 test_path_util_LDADD = \
1391         libsystemd-shared.la
1392
1393 test_strxcpyx_SOURCES = \
1394         src/test/test-strxcpyx.c
1395
1396 test_strxcpyx_LDADD = \
1397         libsystemd-shared.la
1398
1399 test_install_SOURCES = \
1400         src/test/test-install.c
1401
1402 test_install_LDADD = \
1403         libsystemd-units.la \
1404         libsystemd-label.la \
1405         libsystemd-id128-internal.la \
1406         libsystemd-shared.la
1407
1408 test_watchdog_SOURCES = \
1409         src/test/test-watchdog.c
1410
1411 test_watchdog_LDADD = \
1412         libsystemd-shared.la
1413
1414 test_sched_prio_SOURCES = \
1415         src/test/test-sched-prio.c
1416
1417 test_sched_prio_CPPFLAGS = \
1418         $(AM_CPPFLAGS) \
1419         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1420
1421 test_sched_prio_LDADD = \
1422         libsystemd-core.la \
1423         $(RT_LIBS)
1424
1425 # ------------------------------------------------------------------------------
1426 ## .PHONY so it always rebuilds it
1427 .PHONY: coverage lcov-run lcov-report
1428
1429 # run lcov from scratch, always
1430 coverage:
1431         $(MAKE) lcov-run
1432         $(MAKE) lcov-report
1433
1434 coverage_dir = coverage
1435 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
1436
1437 if ENABLE_COVERAGE
1438 # reset run coverage tests
1439 lcov-run:
1440         @rm -rf $(coverage_dir)
1441         lcov $(coverage_opts) --zerocounters
1442         -$(MAKE) check
1443
1444 # generate report based on current coverage data
1445 lcov-report:
1446         $(MKDIR_P) $(coverage_dir)
1447         lcov $(coverage_opts) --compat-libtool --capture --no-external \
1448                 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
1449         genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov.info
1450         @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
1451
1452 # lcov doesn't work properly with vpath builds, make sure that bad
1453 # output is not uploaded by mistake.
1454 coverage-sync: coverage
1455         test "$(builddir)" = "$(srcdir)"
1456         rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
1457
1458 else
1459 lcov-run lcov-report:
1460         echo "Need to reconfigure with --enable-coverage"
1461 endif
1462
1463 # ------------------------------------------------------------------------------
1464 systemd_analyze_SOURCES = \
1465         src/analyze/analyze.c
1466
1467 systemd_analyze_LDADD = \
1468         libsystemd-bus-internal.la \
1469         libsystemd-id128-internal.la \
1470         libsystemd-daemon-internal.la \
1471         libsystemd-shared.la
1472
1473 # ------------------------------------------------------------------------------
1474 systemd_initctl_SOURCES = \
1475         src/initctl/initctl.c
1476
1477 systemd_initctl_LDADD = \
1478         libsystemd-bus-internal.la \
1479         libsystemd-id128-internal.la \
1480         libsystemd-daemon-internal.la \
1481         libsystemd-shared.la
1482
1483 # ------------------------------------------------------------------------------
1484 systemd_update_utmp_SOURCES = \
1485         src/update-utmp/update-utmp.c
1486
1487 systemd_update_utmp_CFLAGS = \
1488         $(AM_CFLAGS) \
1489         $(AUDIT_CFLAGS)
1490
1491 systemd_update_utmp_LDADD = \
1492         libsystemd-bus-internal.la \
1493         libsystemd-id128-internal.la \
1494         libsystemd-daemon-internal.la \
1495         libsystemd-shared.la \
1496         $(AUDIT_LIBS)
1497
1498 # ------------------------------------------------------------------------------
1499 systemd_shutdownd_SOURCES = \
1500         src/shutdownd/shutdownd.c
1501
1502 systemd_shutdownd_LDADD = \
1503         libsystemd-label.la \
1504         libsystemd-daemon-internal.la \
1505         libsystemd-shared.la
1506
1507 dist_doc_DATA += \
1508         src/systemd/sd-shutdown.h
1509
1510 # ------------------------------------------------------------------------------
1511 systemd_shutdown_SOURCES = \
1512         src/core/umount.c \
1513         src/core/umount.h \
1514         src/core/shutdown.c \
1515         src/core/mount-setup.c \
1516         src/core/mount-setup.h \
1517         src/core/killall.h \
1518         src/core/killall.c
1519
1520 systemd_shutdown_LDADD = \
1521         libsystemd-label.la \
1522         libudev-internal.la \
1523         libsystemd-shared.la
1524
1525 # ------------------------------------------------------------------------------
1526 if HAVE_KMOD
1527 systemd_modules_load_SOURCES = \
1528         src/modules-load/modules-load.c
1529
1530 systemd_modules_load_CFLAGS = \
1531         $(AM_CFLAGS) \
1532         $(KMOD_CFLAGS)
1533
1534 systemd_modules_load_LDADD = \
1535         libsystemd-shared.la \
1536         $(KMOD_LIBS)
1537
1538 rootlibexec_PROGRAMS += \
1539         systemd-modules-load
1540
1541 nodist_systemunit_DATA += \
1542         units/systemd-modules-load.service
1543
1544 SYSINIT_TARGET_WANTS += \
1545         systemd-modules-load.service
1546
1547 if ENABLE_TMPFILES
1548 nodist_systemunit_DATA += \
1549         units/kmod-static-nodes.service
1550
1551 SYSINIT_TARGET_WANTS += \
1552         kmod-static-nodes.service
1553 endif
1554 endif
1555
1556 EXTRA_DIST += \
1557         units/systemd-modules-load.service.in \
1558         units/kmod-static-nodes.service.in
1559
1560 # ------------------------------------------------------------------------------
1561 if ENABLE_TMPFILES
1562 systemd_tmpfiles_SOURCES = \
1563         src/tmpfiles/tmpfiles.c
1564
1565 systemd_tmpfiles_LDADD = \
1566         libsystemd-units.la \
1567         libsystemd-label.la \
1568         libsystemd-capability.la \
1569         libsystemd-id128-internal.la \
1570         libsystemd-shared.la
1571
1572 rootbin_PROGRAMS += \
1573         systemd-tmpfiles
1574
1575 dist_systemunit_DATA += \
1576         units/systemd-tmpfiles-clean.timer
1577
1578 nodist_systemunit_DATA += \
1579         units/systemd-tmpfiles-setup-dev.service \
1580         units/systemd-tmpfiles-setup.service \
1581         units/systemd-tmpfiles-clean.service
1582
1583 dist_tmpfiles_DATA = \
1584         tmpfiles.d/systemd.conf \
1585         tmpfiles.d/tmp.conf \
1586         tmpfiles.d/x11.conf
1587
1588 if HAVE_SYSV_COMPAT
1589 dist_tmpfiles_DATA += \
1590         tmpfiles.d/legacy.conf
1591 endif
1592
1593 SYSINIT_TARGET_WANTS += \
1594         systemd-tmpfiles-setup-dev.service \
1595         systemd-tmpfiles-setup.service
1596
1597 dist_zshcompletion_DATA += \
1598         shell-completion/zsh/_systemd-tmpfiles
1599
1600 TIMERS_TARGET_WANTS += \
1601         systemd-tmpfiles-clean.timer
1602
1603 INSTALL_DIRS += \
1604         $(tmpfilesdir) \
1605         $(sysconfdir)/tmpfiles.d
1606 endif
1607
1608 EXTRA_DIST += \
1609         units/systemd-tmpfiles-setup-dev.service.in \
1610         units/systemd-tmpfiles-setup.service.in \
1611         units/systemd-tmpfiles-clean.service.in
1612
1613 # ------------------------------------------------------------------------------
1614 systemd_machine_id_setup_SOURCES = \
1615         src/machine-id-setup/machine-id-setup-main.c \
1616         src/core/machine-id-setup.c \
1617         src/core/machine-id-setup.h
1618
1619 systemd_machine_id_setup_LDADD = \
1620         libsystemd-label.la \
1621         libsystemd-id128-internal.la \
1622         libsystemd-shared.la
1623
1624 # ------------------------------------------------------------------------------
1625 systemd_sysctl_SOURCES = \
1626         src/sysctl/sysctl.c
1627
1628 systemd_sysctl_LDADD = \
1629         libsystemd-shared.la
1630
1631 # ------------------------------------------------------------------------------
1632 systemd_sleep_SOURCES = \
1633         src/sleep/sleep.c
1634
1635 systemd_sleep_LDADD = \
1636         libsystemd-shared.la
1637
1638 # ------------------------------------------------------------------------------
1639 systemd_fsck_SOURCES = \
1640         src/fsck/fsck.c
1641
1642 systemd_fsck_LDADD = \
1643         libsystemd-bus-internal.la \
1644         libsystemd-id128-internal.la \
1645         libsystemd-daemon-internal.la \
1646         libudev-internal.la \
1647         libsystemd-shared.la
1648
1649 # ------------------------------------------------------------------------------
1650 systemd_ac_power_SOURCES = \
1651         src/ac-power/ac-power.c
1652
1653 systemd_ac_power_LDADD = \
1654         libudev-internal.la \
1655         libsystemd-shared.la
1656
1657 # ------------------------------------------------------------------------------
1658 systemd_detect_virt_SOURCES = \
1659         src/detect-virt/detect-virt.c
1660
1661 systemd_detect_virt_LDADD = \
1662         libsystemd-shared.la
1663
1664 systemd-detect-virt-install-hook:
1665         -$(SETCAP) cap_dac_override,cap_sys_ptrace=ep $(DESTDIR)$(bindir)/systemd-detect-virt
1666
1667 INSTALL_EXEC_HOOKS += \
1668         systemd-detect-virt-install-hook
1669
1670 # ------------------------------------------------------------------------------
1671 systemd_delta_SOURCES = \
1672         src/delta/delta.c
1673
1674 systemd_delta_LDADD = \
1675         libsystemd-shared.la
1676
1677 # ------------------------------------------------------------------------------
1678 systemd_getty_generator_SOURCES = \
1679         src/getty-generator/getty-generator.c
1680
1681 systemd_getty_generator_LDADD = \
1682         libsystemd-label.la \
1683         libsystemd-shared.la
1684
1685 # ------------------------------------------------------------------------------
1686 systemd_fstab_generator_SOURCES = \
1687         src/fstab-generator/fstab-generator.c \
1688         src/core/mount-setup.c
1689
1690 systemd_fstab_generator_LDADD = \
1691         libsystemd-label.la \
1692         libsystemd-shared.la
1693
1694 # ------------------------------------------------------------------------------
1695 systemd_system_update_generator_SOURCES = \
1696         src/system-update-generator/system-update-generator.c
1697
1698 systemd_system_update_generator_LDADD = \
1699         libsystemd-label.la \
1700         libsystemd-shared.la
1701
1702 if ENABLE_EFI
1703 # ------------------------------------------------------------------------------
1704 systemgenerator_PROGRAMS +=  \
1705         systemd-efi-boot-generator
1706
1707 systemd_efi_boot_generator_SOURCES = \
1708         src/efi-boot-generator/efi-boot-generator.c
1709
1710 systemd_efi_boot_generator_LDADD = \
1711         libsystemd-label.la \
1712         libsystemd-shared.la
1713
1714 # ------------------------------------------------------------------------------
1715 bootctl_SOURCES = \
1716         src/boot/boot.h \
1717         src/boot/boot-loader.h \
1718         src/boot/bootctl.c \
1719         src/boot/boot-loader.c \
1720         src/boot/boot-efi.c
1721
1722 bootctl_LDADD = \
1723         libsystemd-shared.la \
1724         libsystemd-id128-internal.la \
1725         libsystemd-daemon-internal.la
1726
1727 bin_PROGRAMS += \
1728         bootctl
1729
1730 dist_zshcompletion_DATA += \
1731         shell-completion/zsh/_bootctl
1732
1733 endif
1734
1735 # ------------------------------------------------------------------------------
1736 if HAVE_BLKID
1737 systemgenerator_PROGRAMS +=  \
1738         systemd-gpt-auto-generator
1739
1740 systemd_gpt_auto_generator_SOURCES = \
1741         src/gpt-auto-generator/gpt-auto-generator.c
1742
1743 systemd_gpt_auto_generator_LDADD = \
1744         libsystemd-label.la \
1745         libsystemd-id128-internal.la \
1746         libudev-internal.la \
1747         libsystemd-shared.la \
1748         $(BLKID_LIBS)
1749
1750 systemd_gpt_auto_generator_CFLAGS = \
1751         $(AM_CFLAGS) \
1752         $(BLKID_CFLAGS)
1753 endif
1754
1755 # ------------------------------------------------------------------------------
1756 systemgenerator_PROGRAMS +=  \
1757         systemd-dbus1-generator
1758
1759 systemd_dbus1_generator_SOURCES = \
1760         src/dbus1-generator/dbus1-generator.c
1761
1762 systemd_dbus1_generator_LDADD = \
1763         libsystemd-label.la \
1764         libsystemd-shared.la \
1765         libsystemd-bus-internal.la
1766
1767 # ------------------------------------------------------------------------------
1768 systemd_rc_local_generator_SOURCES = \
1769         src/rc-local-generator/rc-local-generator.c
1770
1771 systemd_rc_local_generator_LDADD = \
1772         libsystemd-label.la \
1773         libsystemd-shared.la
1774
1775 # ------------------------------------------------------------------------------
1776 systemd_remount_fs_SOURCES = \
1777         src/remount-fs/remount-fs.c \
1778         src/core/mount-setup.c \
1779         src/core/mount-setup.h
1780
1781 systemd_remount_fs_LDADD = \
1782         libsystemd-label.la \
1783         libsystemd-shared.la
1784
1785 # ------------------------------------------------------------------------------
1786 systemd_cgroups_agent_SOURCES = \
1787         src/cgroups-agent/cgroups-agent.c
1788
1789 systemd_cgroups_agent_LDADD = \
1790         libsystemd-bus-internal.la \
1791         libsystemd-id128-internal.la \
1792         libsystemd-daemon-internal.la \
1793         libsystemd-shared.la
1794
1795 # ------------------------------------------------------------------------------
1796 systemctl_SOURCES = \
1797         src/systemctl/systemctl.c
1798
1799 systemctl_LDADD = \
1800         libsystemd-units.la \
1801         libsystemd-label.la \
1802         libsystemd-bus-internal.la \
1803         libsystemd-logs.la
1804
1805 if ENABLE_LOGIND
1806 systemctl_LDADD += \
1807         libsystemd-login-internal.la
1808 endif
1809
1810 systemctl_LDADD += \
1811         libsystemd-journal-internal.la \
1812         libsystemd-id128-internal.la \
1813         libsystemd-daemon-internal.la \
1814         libsystemd-shared.la
1815
1816 # ------------------------------------------------------------------------------
1817 systemd_notify_SOURCES = \
1818         src/notify/notify.c \
1819         src/readahead/sd-readahead.c
1820
1821 systemd_notify_LDADD = \
1822         libsystemd-daemon-internal.la \
1823         libsystemd-shared.la
1824
1825 # ------------------------------------------------------------------------------
1826 systemd_ask_password_SOURCES = \
1827         src/ask-password/ask-password.c
1828
1829 systemd_ask_password_LDADD = \
1830         libsystemd-label.la \
1831         libsystemd-shared.la
1832
1833 # ------------------------------------------------------------------------------
1834 systemd_reply_password_SOURCES = \
1835         src/reply-password/reply-password.c
1836
1837 systemd_reply_password_LDADD = \
1838         libsystemd-shared.la
1839
1840 # ------------------------------------------------------------------------------
1841 systemd_cgls_SOURCES = \
1842         src/cgls/cgls.c
1843
1844 systemd_cgls_LDADD = \
1845         libsystemd-shared.la
1846
1847 # ------------------------------------------------------------------------------
1848 systemd_cgtop_SOURCES = \
1849         src/cgtop/cgtop.c
1850
1851 systemd_cgtop_LDADD = \
1852         libsystemd-shared.la
1853
1854 # ------------------------------------------------------------------------------
1855 systemd_nspawn_SOURCES = \
1856         src/nspawn/nspawn.c \
1857         src/core/mount-setup.c \
1858         src/core/mount-setup.h \
1859         src/core/loopback-setup.c \
1860         src/core/loopback-setup.h
1861
1862 systemd_nspawn_LDADD = \
1863         libsystemd-label.la \
1864         libsystemd-capability.la \
1865         libsystemd-bus-internal.la \
1866         libsystemd-id128-internal.la \
1867         libsystemd-daemon-internal.la \
1868         libsystemd-shared.la \
1869         libsystemd-rtnl.la
1870
1871 # ------------------------------------------------------------------------------
1872 systemd_run_SOURCES = \
1873         src/run/run.c
1874
1875 systemd_run_LDADD = \
1876         libsystemd-label.la \
1877         libsystemd-capability.la \
1878         libsystemd-bus-internal.la \
1879         libsystemd-daemon-internal.la \
1880         libsystemd-id128-internal.la \
1881         libsystemd-shared.la
1882
1883 # ------------------------------------------------------------------------------
1884 systemd_bus_proxyd_SOURCES = \
1885         src/bus-proxyd/bus-proxyd.c
1886
1887 systemd_bus_proxyd_LDADD = \
1888         libsystemd-bus-internal.la \
1889         libsystemd-daemon-internal.la \
1890         libsystemd-id128-internal.la \
1891         libsystemd-shared.la
1892
1893 bus-proxyd-install-hook:
1894         $(AM_V_LN)$(LN_S) -f ../../lib/systemd/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
1895
1896 bus-proxyd-uninstall-hook:
1897         rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
1898
1899 INSTALL_EXEC_HOOKS += bus-proxyd-install-hook
1900 UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook
1901
1902 if ENABLE_KDBUS
1903 nodist_systemunit_DATA += \
1904         units/systemd-bus-proxyd@.service
1905
1906 dist_systemunit_DATA += \
1907         units/systemd-bus-proxyd.socket
1908
1909 dist_userunit_DATA += \
1910         units/user/systemd-bus-proxyd.socket
1911
1912 USER_UNIT_ALIASES += \
1913         $(systemunitdir)/systemd-bus-proxyd@.service systemd-bus-proxyd@.service
1914 endif
1915
1916 EXTRA_DIST += \
1917         units/systemd-bus-proxyd@.service.in
1918
1919 # ------------------------------------------------------------------------------
1920 systemd_tty_ask_password_agent_SOURCES = \
1921         src/tty-ask-password-agent/tty-ask-password-agent.c
1922
1923 systemd_tty_ask_password_agent_LDADD = \
1924         libsystemd-label.la \
1925         libsystemd-shared.la
1926
1927 # ------------------------------------------------------------------------------
1928 libsystemd_daemon_la_SOURCES = \
1929         src/libsystemd-daemon/libsystemd-daemon.sym \
1930         src/libsystemd-daemon/sd-daemon.c
1931
1932 libsystemd_daemon_internal_la_SOURCES = \
1933         $(libsystemd_daemon_la_SOURCES)
1934
1935 libsystemd_daemon_internal_la_CPPFLAGS = \
1936         $(AM_CPPFLAGS) \
1937         -DSD_DAEMON_DISABLE_MQ
1938
1939 libsystemd_daemon_la_CFLAGS = \
1940         $(AM_CFLAGS) \
1941         -fvisibility=hidden \
1942         -DSD_EXPORT_SYMBOLS
1943
1944 libsystemd_daemon_la_LDFLAGS = \
1945         $(AM_LDFLAGS) \
1946         -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
1947         -Wl,--version-script=$(top_srcdir)/src/libsystemd-daemon/libsystemd-daemon.sym
1948
1949 libsystemd_daemon_la_LIBADD =  \
1950         $(RT_LIBS)
1951
1952 pkginclude_HEADERS += \
1953         src/systemd/sd-daemon.h
1954
1955 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
1956 libsystemd-daemon-install-hook:
1957         libname=libsystemd-daemon.so && $(move-to-rootlibdir)
1958
1959 libsystemd-daemon-uninstall-hook:
1960         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so*
1961
1962 INSTALL_EXEC_HOOKS += libsystemd-daemon-install-hook
1963 UNINSTALL_EXEC_HOOKS += libsystemd-daemon-uninstall-hook
1964
1965 lib_LTLIBRARIES += \
1966         libsystemd-daemon.la
1967
1968 noinst_LTLIBRARIES += \
1969         libsystemd-daemon-internal.la
1970
1971 pkgconfiglib_DATA += \
1972         src/libsystemd-daemon/libsystemd-daemon.pc
1973
1974 EXTRA_DIST += \
1975         src/libsystemd-daemon/libsystemd-daemon.pc.in
1976
1977 # ------------------------------------------------------------------------------
1978 libsystemd_bus_la_SOURCES = \
1979         src/libsystemd-bus/libsystemd-bus.sym \
1980         src/systemd/sd-bus.h \
1981         src/systemd/sd-bus-protocol.h \
1982         src/systemd/sd-bus-vtable.h \
1983         src/systemd/sd-memfd.h \
1984         src/systemd/sd-utf8.h \
1985         src/systemd/sd-event.h \
1986         src/libsystemd-bus/sd-bus.c \
1987         src/libsystemd-bus/bus-control.c \
1988         src/libsystemd-bus/bus-control.h \
1989         src/libsystemd-bus/bus-error.c \
1990         src/libsystemd-bus/bus-error.h \
1991         src/libsystemd-bus/bus-internal.c \
1992         src/libsystemd-bus/bus-internal.h \
1993         src/libsystemd-bus/bus-socket.c \
1994         src/libsystemd-bus/bus-socket.h \
1995         src/libsystemd-bus/bus-kernel.c \
1996         src/libsystemd-bus/bus-kernel.h \
1997         src/libsystemd-bus/bus-container.c \
1998         src/libsystemd-bus/bus-container.h \
1999         src/libsystemd-bus/bus-message.c \
2000         src/libsystemd-bus/bus-message.h \
2001         src/libsystemd-bus/bus-creds.c \
2002         src/libsystemd-bus/bus-creds.h \
2003         src/libsystemd-bus/bus-signature.c \
2004         src/libsystemd-bus/bus-signature.h \
2005         src/libsystemd-bus/bus-type.c \
2006         src/libsystemd-bus/bus-type.h \
2007         src/libsystemd-bus/bus-match.c \
2008         src/libsystemd-bus/bus-match.h \
2009         src/libsystemd-bus/bus-bloom.c \
2010         src/libsystemd-bus/bus-bloom.h \
2011         src/libsystemd-bus/bus-introspect.c \
2012         src/libsystemd-bus/bus-introspect.h \
2013         src/libsystemd-bus/bus-objects.c \
2014         src/libsystemd-bus/bus-objects.h \
2015         src/libsystemd-bus/bus-gvariant.c \
2016         src/libsystemd-bus/bus-gvariant.h \
2017         src/libsystemd-bus/bus-convenience.c \
2018         src/libsystemd-bus/kdbus.h \
2019         src/libsystemd-bus/sd-memfd.c \
2020         src/libsystemd-bus/bus-util.c \
2021         src/libsystemd-bus/bus-util.h \
2022         src/libsystemd-bus/sd-utf8.c \
2023         src/libsystemd-bus/sd-event.c \
2024         src/libsystemd-bus/event-util.h \
2025         src/libsystemd-bus/bus-protocol.h
2026
2027 nodist_libsystemd_bus_la_SOURCES = \
2028         src/libsystemd-bus/bus-error-mapping.c
2029
2030 libsystemd_bus_la_LIBADD = \
2031         libsystemd-id128-internal.la \
2032         libsystemd-daemon-internal.la \
2033         libsystemd-shared.la
2034
2035 libsystemd_bus_la_CFLAGS = \
2036         $(AM_CFLAGS) \
2037         -pthread
2038
2039 libsystemd_bus_la_LDFLAGS = \
2040         $(AM_LDFLAGS) \
2041         -version-info $(LIBSYSTEMD_BUS_CURRENT):$(LIBSYSTEMD_BUS_REVISION):$(LIBSYSTEMD_BUS_AGE) \
2042         -Wl,--version-script=$(top_srcdir)/src/libsystemd-bus/libsystemd-bus.sym
2043
2044 pkgconfiglib_DATA += \
2045         src/libsystemd-bus/libsystemd-bus.pc
2046
2047 EXTRA_DIST += \
2048         src/libsystemd-bus/bus-error-mapping.gperf \
2049         src/libsystemd-bus/libsystemd-bus.pc.in \
2050         src/libsystemd-bus/DIFFERENCES \
2051         src/libsystemd-bus/GVARIANT-SERIALIZATION
2052
2053 CLEANFILES += \
2054         src/libsystemd-bus/bus-error-mapping.c
2055
2056 lib_LTLIBRARIES += \
2057         libsystemd-bus.la
2058
2059 libsystemd_bus_internal_la_SOURCES = \
2060         $(libsystemd_bus_la_SOURCES)
2061
2062 nodist_libsystemd_bus_internal_la_SOURCES = \
2063         $(nodist_libsystemd_bus_la_SOURCES)
2064
2065 libsystemd_bus_internal_la_CFLAGS = \
2066         $(libsystemd_bus_la_CFLAGS)
2067
2068 noinst_LTLIBRARIES += \
2069         libsystemd-bus-internal.la
2070
2071 libsystemd_bus_dump_la_SOURCES = \
2072         src/libsystemd-bus/bus-dump.c \
2073         src/libsystemd-bus/bus-dump.h
2074
2075 libsystemd_bus_dump_la_CFLAGS = \
2076         $(AM_CFLAGS) \
2077         $(CAP_CFLAGS)
2078
2079 noinst_LTLIBRARIES += \
2080         libsystemd-bus-dump.la
2081
2082 tests += \
2083         test-bus-marshal \
2084         test-bus-signature \
2085         test-bus-chat \
2086         test-bus-server \
2087         test-bus-match \
2088         test-bus-kernel \
2089         test-bus-kernel-bloom \
2090         test-bus-kernel-benchmark \
2091         test-bus-memfd \
2092         test-bus-zero-copy \
2093         test-bus-introspect \
2094         test-bus-objects \
2095         test-bus-error \
2096         test-bus-creds \
2097         test-bus-gvariant \
2098         test-event
2099
2100 bin_PROGRAMS += \
2101         busctl
2102
2103 test_bus_marshal_SOURCES = \
2104         src/libsystemd-bus/test-bus-marshal.c
2105
2106 test_bus_marshal_LDADD = \
2107         libsystemd-bus-internal.la \
2108         libsystemd-id128-internal.la \
2109         libsystemd-daemon-internal.la \
2110         libsystemd-shared.la \
2111         libsystemd-bus-dump.la \
2112         libsystemd-capability.la \
2113         $(GLIB_LIBS) \
2114         $(DBUS_LIBS) \
2115         $(CAP_LIBS)
2116
2117 test_bus_marshal_CFLAGS = \
2118         $(AM_CFLAGS) \
2119         $(GLIB_CFLAGS) \
2120         $(DBUS_CFLAGS) \
2121         $(CAP_CFLAGS)
2122
2123 test_bus_signature_SOURCES = \
2124         src/libsystemd-bus/test-bus-signature.c
2125
2126 test_bus_signature_LDADD = \
2127         libsystemd-shared.la \
2128         libsystemd-bus-internal.la
2129
2130 test_bus_chat_SOURCES = \
2131         src/libsystemd-bus/test-bus-chat.c
2132
2133 test_bus_chat_CFLAGS = \
2134         $(AM_CFLAGS) \
2135         -pthread
2136
2137 test_bus_chat_LDADD = \
2138         libsystemd-bus-internal.la \
2139         libsystemd-id128-internal.la \
2140         libsystemd-daemon-internal.la \
2141         libsystemd-shared.la
2142
2143 test_bus_server_SOURCES = \
2144         src/libsystemd-bus/test-bus-server.c
2145
2146 test_bus_server_CFLAGS = \
2147         $(AM_CFLAGS) \
2148         -pthread
2149
2150 test_bus_server_LDADD = \
2151         libsystemd-bus-internal.la \
2152         libsystemd-id128-internal.la \
2153         libsystemd-daemon-internal.la \
2154         libsystemd-shared.la
2155
2156 test_bus_objects_SOURCES = \
2157         src/libsystemd-bus/test-bus-objects.c
2158
2159 test_bus_objects_CFLAGS = \
2160         $(AM_CFLAGS) \
2161         $(CAP_CFLAGS) \
2162         -pthread
2163
2164 test_bus_objects_LDADD = \
2165         libsystemd-bus-internal.la \
2166         libsystemd-id128-internal.la \
2167         libsystemd-daemon-internal.la \
2168         libsystemd-shared.la \
2169         libsystemd-bus-dump.la \
2170         libsystemd-capability.la \
2171         $(CAP_LIBS)
2172
2173 test_bus_error_SOURCES = \
2174         src/libsystemd-bus/test-bus-error.c
2175
2176 test_bus_error_LDADD = \
2177         libsystemd-bus-internal.la \
2178         libsystemd-id128-internal.la \
2179         libsystemd-daemon-internal.la \
2180         libsystemd-shared.la
2181
2182 test_bus_gvariant_SOURCES = \
2183         src/libsystemd-bus/test-bus-gvariant.c
2184
2185 test_bus_gvariant_LDADD = \
2186         libsystemd-bus-internal.la \
2187         libsystemd-id128-internal.la \
2188         libsystemd-daemon-internal.la \
2189         libsystemd-shared.la \
2190         libsystemd-bus-dump.la \
2191         libsystemd-capability.la \
2192         $(GLIB_LIBS) \
2193         $(CAP_LIBS)
2194
2195 test_bus_gvariant_CFLAGS = \
2196         $(AM_CFLAGS) \
2197         $(GLIB_CFLAGS)
2198         $(CAP_CFLAGS)
2199
2200 test_bus_creds_SOURCES = \
2201         src/libsystemd-bus/test-bus-creds.c
2202
2203 test_bus_creds_LDADD = \
2204         libsystemd-bus-internal.la \
2205         libsystemd-id128-internal.la \
2206         libsystemd-daemon-internal.la \
2207         libsystemd-shared.la \
2208         libsystemd-bus-dump.la \
2209         libsystemd-capability.la
2210
2211 test_bus_match_SOURCES = \
2212         src/libsystemd-bus/test-bus-match.c
2213
2214 test_bus_match_LDADD = \
2215         libsystemd-bus-internal.la \
2216         libsystemd-id128-internal.la \
2217         libsystemd-daemon-internal.la \
2218         libsystemd-shared.la
2219
2220 test_bus_kernel_SOURCES = \
2221         src/libsystemd-bus/test-bus-kernel.c
2222
2223 test_bus_kernel_LDADD = \
2224         libsystemd-bus-internal.la \
2225         libsystemd-id128-internal.la \
2226         libsystemd-daemon-internal.la \
2227         libsystemd-shared.la \
2228         libsystemd-bus-dump.la \
2229         libsystemd-capability.la \
2230         $(CAP_LIBS)
2231
2232 test_bus_kernel_CFLAGS = \
2233         $(AM_CFLAGS) \
2234         $(CAP_CFLAGS)
2235
2236 test_bus_kernel_bloom_SOURCES = \
2237         src/libsystemd-bus/test-bus-kernel-bloom.c
2238
2239 test_bus_kernel_bloom_LDADD = \
2240         libsystemd-bus-internal.la \
2241         libsystemd-id128-internal.la \
2242         libsystemd-daemon-internal.la \
2243         libsystemd-shared.la
2244
2245 test_bus_kernel_benchmark_SOURCES = \
2246         src/libsystemd-bus/test-bus-kernel-benchmark.c
2247
2248 test_bus_kernel_benchmark_LDADD = \
2249         libsystemd-bus-internal.la \
2250         libsystemd-id128-internal.la \
2251         libsystemd-daemon-internal.la \
2252         libsystemd-shared.la
2253
2254 test_bus_memfd_SOURCES = \
2255         src/libsystemd-bus/test-bus-memfd.c
2256
2257 test_bus_memfd_LDADD = \
2258         libsystemd-bus-internal.la \
2259         libsystemd-shared.la
2260
2261 test_bus_zero_copy_SOURCES = \
2262         src/libsystemd-bus/test-bus-zero-copy.c
2263
2264 test_bus_zero_copy_LDADD = \
2265         libsystemd-bus-internal.la \
2266         libsystemd-id128-internal.la \
2267         libsystemd-daemon-internal.la \
2268         libsystemd-shared.la \
2269         libsystemd-bus-dump.la \
2270         libsystemd-capability.la \
2271         $(CAP_LIBS)
2272
2273 test_bus_zero_copy_CFLAGS = \
2274         $(AM_CFLAGS) \
2275         $(CAP_CFLAGS)
2276
2277 test_bus_introspect_SOURCES = \
2278         src/libsystemd-bus/test-bus-introspect.c
2279
2280 test_bus_introspect_LDADD = \
2281         libsystemd-shared.la \
2282         libsystemd-bus-internal.la
2283
2284 test_event_SOURCES = \
2285         src/libsystemd-bus/test-event.c
2286
2287 test_event_LDADD = \
2288         libsystemd-bus-internal.la \
2289         libsystemd-id128-internal.la \
2290         libsystemd-daemon-internal.la \
2291         libsystemd-shared.la
2292
2293 busctl_SOURCES = \
2294         src/libsystemd-bus/busctl.c
2295
2296 busctl_LDADD = \
2297         libsystemd-bus-internal.la \
2298         libsystemd-id128-internal.la \
2299         libsystemd-daemon-internal.la \
2300         libsystemd-shared.la \
2301         libsystemd-bus-dump.la \
2302         libsystemd-capability.la \
2303         $(CAP_LIBS)
2304
2305 busctl_CFLAGS = \
2306         $(AM_CFLAGS) \
2307         $(CAP_CFLAGS)
2308
2309 # ------------------------------------------------------------------------------
2310 if ENABLE_GTK_DOC
2311 SUBDIRS += \
2312         docs/libudev
2313
2314 noinst_DATA += \
2315         docs/html/libudev \
2316         docs/html/gudev
2317 endif
2318
2319 include_HEADERS += \
2320         src/libudev/libudev.h
2321
2322 lib_LTLIBRARIES += \
2323         libudev.la
2324
2325 libudev_la_SOURCES =\
2326         src/libudev/libudev.sym \
2327         src/libudev/libudev-private.h \
2328         src/libudev/libudev.c \
2329         src/libudev/libudev-list.c \
2330         src/libudev/libudev-util.c \
2331         src/libudev/libudev-device.c \
2332         src/libudev/libudev-enumerate.c \
2333         src/libudev/libudev-monitor.c \
2334         src/libudev/libudev-queue.c \
2335         src/libudev/libudev-hwdb-def.h \
2336         src/libudev/libudev-hwdb.c
2337
2338 libudev_la_CFLAGS = \
2339         $(AM_CFLAGS) \
2340         -fvisibility=hidden
2341
2342 libudev_la_LDFLAGS = \
2343         $(AM_LDFLAGS) \
2344         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
2345         -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
2346
2347 libudev_la_LIBADD = \
2348         libsystemd-daemon-internal.la \
2349         libsystemd-id128-internal.la \
2350         libsystemd-shared.la
2351
2352 pkgconfiglib_DATA += \
2353         src/libudev/libudev.pc
2354
2355 EXTRA_DIST += \
2356         src/libudev/libudev.pc.in
2357
2358 CLEANFILES += \
2359         src/libudev/libudev.pc \
2360         docs/html/libudev \
2361         docs/html/gudev
2362
2363 docs/html/libudev:
2364         $(AM_V_at)$(MKDIR_P) $(dir $@)
2365         $(AM_V_LN)$(LN_S) -f ../libudev/html $@
2366
2367 docs/html/gudev:
2368         $(AM_V_at)$(MKDIR_P) $(dir $@)
2369         $(AM_V_LN)$(LN_S) -f ../gudev/html $@
2370
2371 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2372 libudev-install-hook:
2373         libname=libudev.so && $(move-to-rootlibdir)
2374
2375 libudev-uninstall-hook:
2376         rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
2377
2378 INSTALL_EXEC_HOOKS += libudev-install-hook
2379 UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
2380
2381 # ------------------------------------------------------------------------------
2382 noinst_LTLIBRARIES += \
2383         libudev-internal.la
2384
2385 libudev_internal_la_SOURCES =\
2386         $(libudev_la_SOURCES) \
2387         src/libudev/libudev-device-private.c \
2388         src/libudev/libudev-queue-private.c
2389
2390 libudev_internal_la_CFLAGS = \
2391         $(AM_CFLAGS) \
2392         -fvisibility=default
2393
2394 # ------------------------------------------------------------------------------
2395 INSTALL_DIRS += \
2396         $(sysconfdir)/udev/rules.d \
2397         $(sysconfdir)/udev/hwdb.d
2398
2399 dist_network_DATA = \
2400         network/99-default.link
2401
2402 dist_udevrules_DATA += \
2403         rules/99-systemd.rules \
2404         rules/42-usb-hid-pm.rules \
2405         rules/50-udev-default.rules \
2406         rules/60-drm.rules \
2407         rules/60-keyboard.rules \
2408         rules/60-persistent-storage-tape.rules \
2409         rules/60-persistent-serial.rules \
2410         rules/60-persistent-input.rules \
2411         rules/60-persistent-alsa.rules \
2412         rules/60-persistent-storage.rules \
2413         rules/64-btrfs.rules \
2414         rules/75-net-description.rules \
2415         rules/75-tty-description.rules \
2416         rules/78-sound-card.rules \
2417         rules/80-net-setup-link.rules \
2418         rules/95-udev-late.rules
2419
2420 dist_udevhwdb_DATA = \
2421         hwdb/20-pci-vendor-model.hwdb \
2422         hwdb/20-pci-classes.hwdb \
2423         hwdb/20-usb-vendor-model.hwdb \
2424         hwdb/20-usb-classes.hwdb \
2425         hwdb/20-bluetooth-vendor-product.hwdb \
2426         hwdb/20-acpi-vendor.hwdb \
2427         hwdb/20-OUI.hwdb \
2428         hwdb/60-keyboard.hwdb
2429
2430 udevconfdir = $(sysconfdir)/udev
2431 dist_udevconf_DATA = \
2432         src/udev/udev.conf
2433
2434 sharepkgconfigdir = $(datadir)/pkgconfig
2435 sharepkgconfig_DATA = \
2436         src/udev/udev.pc
2437
2438 EXTRA_DIST += \
2439         rules/99-systemd.rules.in \
2440         src/udev/udev.pc.in
2441
2442 CLEANFILES += \
2443         rules/99-systemd.rules \
2444         src/udev/udev.pc
2445
2446 EXTRA_DIST += \
2447         units/systemd-udevd.service.in \
2448         units/systemd-udev-trigger.service.in \
2449         units/systemd-udev-settle.service.in
2450
2451 CLEANFILES += \
2452         units/systemd-udevd.service \
2453         units/systemd-udev-trigger.service \
2454         units/systemd-udev-settle.service
2455
2456 SOCKETS_TARGET_WANTS += \
2457         systemd-udevd-control.socket \
2458         systemd-udevd-kernel.socket
2459 SYSINIT_TARGET_WANTS += \
2460         systemd-udevd.service \
2461         systemd-udev-trigger.service
2462
2463 rootbin_PROGRAMS += \
2464         udevadm
2465
2466 rootlibexec_PROGRAMS += \
2467         systemd-udevd
2468
2469 noinst_LTLIBRARIES += \
2470         libudev-core.la
2471
2472 src/udev/keyboard-keys.txt:
2473         $(AM_V_at)$(MKDIR_P) $(dir $@)
2474         $(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/' > $@
2475
2476 src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt
2477         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
2478
2479 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
2480         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
2481
2482 src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt
2483         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
2484
2485 libudev_core_la_SOURCES = \
2486         src/udev/udev.h \
2487         src/udev/udev-event.c \
2488         src/udev/udev-watch.c \
2489         src/udev/udev-node.c \
2490         src/udev/udev-rules.c \
2491         src/udev/udev-ctrl.c \
2492         src/udev/udev-builtin.c \
2493         src/udev/udev-builtin-btrfs.c \
2494         src/udev/udev-builtin-hwdb.c \
2495         src/udev/udev-builtin-input_id.c \
2496         src/udev/udev-builtin-keyboard.c \
2497         src/udev/udev-builtin-net_id.c \
2498         src/udev/udev-builtin-net_setup_link.c \
2499         src/udev/udev-builtin-path_id.c \
2500         src/udev/udev-builtin-usb_id.c \
2501         src/udev/net/link-config.h \
2502         src/udev/net/link-config.c \
2503         src/udev/net/ethtool-util.h \
2504         src/udev/net/ethtool-util.c
2505
2506 nodist_libudev_core_la_SOURCES = \
2507         src/udev/keyboard-keys-from-name.h \
2508         src/udev/keyboard-keys-to-name.h \
2509         src/udev/net/link-config-gperf.c
2510
2511 BUILT_SOURCES += \
2512         $(nodist_libudev_core_la_SOURCES)
2513
2514 CLEANFILES += \
2515         src/udev/keyboard-keys-from-name.gperf \
2516         src/udev/keyboard-keys.txt \
2517         src/udev/net/link-config-gperf.c
2518
2519 EXTRA_DIST += \
2520         src/udev/net/link-config-gperf.gperf
2521
2522 libudev_core_la_CFLAGS = \
2523         $(AM_CFLAGS) \
2524         $(BLKID_CFLAGS) \
2525         $(KMOD_CFLAGS)
2526
2527 libudev_core_la_LIBADD = \
2528         libudev-internal.la \
2529         libsystemd-label.la \
2530         libsystemd-daemon-internal.la \
2531         libsystemd-rtnl.la \
2532         libsystemd-id128-internal.la \
2533         libsystemd-shared.la \
2534         $(BLKID_LIBS) \
2535         $(KMOD_LIBS)
2536
2537 libudev_core_la_CPPFLAGS = \
2538         $(AM_CPPFLAGS) \
2539         -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
2540
2541 if ENABLE_FIRMWARE
2542 libudev_core_la_SOURCES += \
2543         src/udev/udev-builtin-firmware.c
2544
2545 dist_udevrules_DATA += \
2546         rules/50-firmware.rules
2547 endif
2548
2549 if HAVE_KMOD
2550 libudev_core_la_SOURCES += \
2551         src/udev/udev-builtin-kmod.c
2552
2553 dist_udevrules_DATA += \
2554         rules/80-drivers.rules
2555 endif
2556
2557 if HAVE_BLKID
2558 libudev_core_la_SOURCES += \
2559         src/udev/udev-builtin-blkid.c
2560 endif
2561
2562 if HAVE_ACL
2563 libudev_core_la_SOURCES += \
2564         src/udev/udev-builtin-uaccess.c \
2565         src/login/logind-acl.c \
2566         src/login/sd-login.c \
2567         src/systemd/sd-login.h \
2568         src/login/login-shared.c \
2569         src/login/login-shared.h
2570
2571 libudev_core_la_LIBADD += \
2572         libsystemd-acl.la
2573 endif
2574
2575 systemd_udevd_SOURCES = \
2576         src/udev/udevd.c
2577
2578 systemd_udevd_LDADD = \
2579         libudev-core.la
2580
2581 udevadm_SOURCES = \
2582         src/udev/udevadm.c \
2583         src/udev/udevadm-info.c \
2584         src/udev/udevadm-control.c \
2585         src/udev/udevadm-monitor.c \
2586         src/udev/udevadm-hwdb.c \
2587         src/udev/udevadm-settle.c \
2588         src/udev/udevadm-trigger.c \
2589         src/udev/udevadm-test.c \
2590         src/udev/udevadm-test-builtin.c
2591
2592 udevadm_LDADD = \
2593         libudev-core.la
2594
2595 # Update hwdb on installation. Do not bother if installing
2596 # in DESTDIR, since this is likely for packaging purposes.
2597 hwdb-update-hook:
2598         -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update
2599
2600 INSTALL_DATA_HOOKS += \
2601         hwdb-update-hook
2602
2603 hwdb-remove-hook:
2604         -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
2605
2606 # ------------------------------------------------------------------------------
2607 TESTS += \
2608         test/udev-test.pl \
2609         test/rules-test.sh
2610
2611 manual_tests += \
2612         test-libudev \
2613         test-udev
2614
2615 test_libudev_SOURCES = \
2616         src/test/test-libudev.c
2617
2618 test_libudev_LDADD = \
2619         libsystemd-label.la \
2620         libudev-internal.la \
2621         libsystemd-shared.la
2622
2623 test_udev_SOURCES = \
2624         src/test/test-udev.c
2625
2626 test_udev_LDADD = \
2627         libudev-core.la \
2628         $(BLKID_LIBS) \
2629         $(KMOD_LIBS) \
2630         $(SELINUX_LIBS)
2631
2632 if HAVE_ACL
2633 test_udev_LDADD += \
2634         libsystemd-acl.la
2635 endif
2636
2637 check_DATA += \
2638         test/sys
2639
2640 # packed sysfs test tree
2641 test/sys:
2642         $(AM_V_at)$(MKDIR_P) $(dir $@)
2643         $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
2644
2645 test-sys-distclean:
2646         -rm -rf test/sys
2647 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
2648
2649 EXTRA_DIST += \
2650         test/sys.tar.xz \
2651         test/udev-test.pl \
2652         test/rules-test.sh \
2653         test/rule-syntax-check.py
2654
2655 # ------------------------------------------------------------------------------
2656 ata_id_SOURCES = \
2657         src/udev/ata_id/ata_id.c
2658
2659 ata_id_LDADD = \
2660         libudev-internal.la \
2661         libsystemd-shared.la
2662
2663 udevlibexec_PROGRAMS += \
2664         ata_id
2665
2666 # ------------------------------------------------------------------------------
2667 cdrom_id_SOURCES = \
2668         src/udev/cdrom_id/cdrom_id.c
2669
2670 cdrom_id_LDADD = \
2671         libudev-internal.la \
2672         libsystemd-shared.la
2673
2674 udevlibexec_PROGRAMS += \
2675         cdrom_id
2676
2677 dist_udevrules_DATA += \
2678         rules/60-cdrom_id.rules
2679
2680 # ------------------------------------------------------------------------------
2681 collect_SOURCES = \
2682         src/udev/collect/collect.c
2683
2684 collect_LDADD = \
2685         libudev-internal.la \
2686         libsystemd-shared.la
2687
2688 udevlibexec_PROGRAMS += \
2689         collect
2690
2691 # ------------------------------------------------------------------------------
2692 scsi_id_SOURCES =\
2693         src/udev/scsi_id/scsi_id.c \
2694         src/udev/scsi_id/scsi_serial.c \
2695         src/udev/scsi_id/scsi.h \
2696         src/udev/scsi_id/scsi_id.h
2697
2698 scsi_id_LDADD = \
2699         libudev-internal.la \
2700         libsystemd-shared.la
2701
2702 udevlibexec_PROGRAMS += \
2703         scsi_id
2704
2705 EXTRA_DIST += \
2706         src/udev/scsi_id/README
2707
2708 # ------------------------------------------------------------------------------
2709 v4l_id_SOURCES = \
2710         src/udev/v4l_id/v4l_id.c
2711
2712 v4l_id_LDADD = \
2713         libudev-internal.la
2714
2715 udevlibexec_PROGRAMS += \
2716         v4l_id
2717
2718 dist_udevrules_DATA += \
2719         rules/60-persistent-v4l.rules
2720
2721 # ------------------------------------------------------------------------------
2722 accelerometer_SOURCES = \
2723         src/udev/accelerometer/accelerometer.c
2724
2725 accelerometer_LDADD = \
2726         libudev-internal.la -lm \
2727         libsystemd-shared.la
2728
2729 udevlibexec_PROGRAMS += \
2730         accelerometer
2731
2732 dist_udevrules_DATA += \
2733         rules/61-accelerometer.rules
2734
2735 # ------------------------------------------------------------------------------
2736 if ENABLE_GUDEV
2737 if ENABLE_GTK_DOC
2738 SUBDIRS += \
2739         docs/gudev
2740 endif
2741
2742 libgudev_includedir = \
2743         $(includedir)/gudev-1.0/gudev
2744
2745 libgudev_include_HEADERS = \
2746         src/gudev/gudev.h \
2747         src/gudev/gudevenums.h \
2748         src/gudev/gudevenumtypes.h \
2749         src/gudev/gudevtypes.h \
2750         src/gudev/gudevclient.h \
2751         src/gudev/gudevdevice.h \
2752         src/gudev/gudevenumerator.h
2753
2754 lib_LTLIBRARIES += libgudev-1.0.la
2755
2756 pkgconfiglib_DATA += \
2757         src/gudev/gudev-1.0.pc
2758
2759 CLEANFILES += \
2760         src/gudev/gudev-1.0.pc
2761
2762 libgudev_1_0_la_SOURCES = \
2763         src/gudev/gudevenums.h \
2764         src/gudev/gudevenumtypes.h \
2765         src/gudev/gudevenumtypes.h\
2766         src/gudev/gudevtypes.h \
2767         src/gudev/gudevclient.h \
2768         src/gudev/gudevclient.c \
2769         src/gudev/gudevdevice.h \
2770         src/gudev/gudevdevice.c \
2771         src/gudev/gudevenumerator.h \
2772         src/gudev/gudevenumerator.c \
2773         src/gudev/gudevprivate.h
2774
2775 nodist_libgudev_1_0_la_SOURCES = \
2776         src/gudev/gudevmarshal.h \
2777         src/gudev/gudevmarshal.c \
2778         src/gudev/gudevenumtypes.h \
2779         src/gudev/gudevenumtypes.c
2780
2781 BUILT_SOURCES += \
2782         $(nodist_libgudev_1_0_la_SOURCES)
2783
2784 libgudev_1_0_la_CPPFLAGS = \
2785         $(AM_CPPFLAGS) \
2786         -I$(top_builddir)/src\
2787         -I$(top_srcdir)/src\
2788         -I$(top_builddir)/src/gudev \
2789         -I$(top_srcdir)/src/gudev \
2790         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
2791         -D_GUDEV_COMPILATION \
2792         -DG_LOG_DOMAIN=\"GUdev\"
2793
2794 libgudev_1_0_la_CFLAGS = \
2795         $(AM_CFLAGS) \
2796         -fvisibility=default \
2797         $(GLIB_CFLAGS)
2798
2799 libgudev_1_0_la_LIBADD = \
2800         libudev.la \
2801         $(GLIB_LIBS)
2802
2803 libgudev_1_0_la_LDFLAGS = \
2804         $(AM_LDFLAGS) \
2805         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
2806         -export-dynamic -no-undefined \
2807         -export-symbols-regex '^g_udev_.*'
2808
2809 src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
2810         $(AM_V_at)$(MKDIR_P) $(dir $@)
2811         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
2812
2813 src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
2814         $(AM_V_at)$(MKDIR_P) $(dir $@)
2815         $(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
2816         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
2817
2818 src/gudev/gudevenumtypes.%: src/gudev/gudevenumtypes.%.template src/gudev/gudevenums.h
2819         $(AM_V_at)$(MKDIR_P) $(dir $@)
2820         $(AM_V_GEN)glib-mkenums --template $^ > $@
2821
2822 if HAVE_INTROSPECTION
2823 -include $(INTROSPECTION_MAKEFILE)
2824
2825 src/gudev/GUdev-1.0.gir: libgudev-1.0.la
2826
2827 src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
2828
2829 src_gudev_GUdev_1_0_gir_CFLAGS = \
2830         $(AM_CFLAGS) \
2831         $(INCLUDES) \
2832         -D_GUDEV_COMPILATION \
2833         -D_GUDEV_WORK_AROUND_DEV_T_BUG \
2834         -I$(top_srcdir)/src \
2835         -I$(top_builddir)/src \
2836         -I$(top_srcdir)/src/gudev \
2837         -I$(top_builddir)/src/gudev
2838
2839 src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
2840
2841 src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
2842         --pkg-export=gudev-1.0 \
2843         --warn-all
2844
2845 src_gudev_GUdev_1_0_gir_FILES = \
2846         src/gudev/gudev.h \
2847         src/gudev/gudevtypes.h \
2848         src/gudev/gudevenums.h \
2849         src/gudev/gudevenumtypes.h \
2850         src/gudev/gudevclient.h \
2851         src/gudev/gudevdevice.h \
2852         src/gudev/gudevenumerator.h \
2853         src/gudev/gudevclient.c \
2854         src/gudev/gudevdevice.c \
2855         src/gudev/gudevenumerator.c
2856
2857 INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
2858 INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
2859
2860 girdir = $(datadir)/gir-1.0
2861 gir_DATA = \
2862         src/gudev/GUdev-1.0.gir
2863
2864 typelibsdir = $(libdir)/girepository-1.0
2865 typelibs_DATA = \
2866         src/gudev/GUdev-1.0.typelib
2867
2868 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
2869 endif # HAVE_INTROSPECTION
2870
2871 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2872 libgudev-install-hook:
2873         libname=libgudev-1.0.so && $(move-to-rootlibdir)
2874
2875 libgudev-uninstall-hook:
2876         rm -f $(DESTDIR)$(rootlibdir)/libgudev-1.0.so*
2877
2878 INSTALL_EXEC_HOOKS += libgudev-install-hook
2879 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-hook
2880 endif
2881
2882 EXTRA_DIST += \
2883         src/gudev/gudev-1.0.pc.in \
2884         src/gudev/gudevmarshal.list \
2885         src/gudev/gudevenumtypes.h.template \
2886         src/gudev/gudevenumtypes.c.template \
2887         src/gudev/gjs-example.js \
2888         src/gudev/seed-example-enum.js \
2889         src/gudev/seed-example.js
2890
2891 # ------------------------------------------------------------------------------
2892 mtd_probe_SOURCES =  \
2893         src/udev/mtd_probe/mtd_probe.c \
2894         src/udev/mtd_probe/mtd_probe.h \
2895         src/udev/mtd_probe/probe_smartmedia.c
2896
2897 dist_udevrules_DATA += \
2898         rules/75-probe_mtd.rules
2899
2900 udevlibexec_PROGRAMS += \
2901         mtd_probe
2902
2903 # ------------------------------------------------------------------------------
2904 libsystemd_id128_la_SOURCES = \
2905         src/libsystemd-id128/libsystemd-id128.sym \
2906         src/libsystemd-id128/sd-id128.c
2907
2908 libsystemd_id128_la_CFLAGS = \
2909         $(AM_CFLAGS) \
2910         -fvisibility=hidden
2911
2912 libsystemd_id128_la_LDFLAGS = \
2913         $(AM_LDFLAGS) \
2914         -version-info $(LIBSYSTEMD_ID128_CURRENT):$(LIBSYSTEMD_ID128_REVISION):$(LIBSYSTEMD_ID128_AGE) \
2915         -Wl,--version-script=$(top_srcdir)/src/libsystemd-id128/libsystemd-id128.sym
2916
2917 libsystemd_id128_la_LIBADD = \
2918         libsystemd-daemon-internal.la \
2919         libsystemd-shared.la
2920
2921 libsystemd_id128_internal_la_SOURCES = \
2922         $(libsystemd_id128_la_SOURCES)
2923
2924 test_id128_SOURCES = \
2925         src/test/test-id128.c
2926
2927 test_id128_LDADD = \
2928         libsystemd-id128-internal.la \
2929         libsystemd-daemon-internal.la \
2930         libsystemd-shared.la
2931
2932 tests += \
2933         test-id128
2934
2935 pkginclude_HEADERS += \
2936         src/systemd/sd-id128.h
2937
2938 lib_LTLIBRARIES += \
2939         libsystemd-id128.la
2940
2941 noinst_LTLIBRARIES += \
2942         libsystemd-id128-internal.la
2943
2944 pkgconfiglib_DATA += \
2945         src/libsystemd-id128/libsystemd-id128.pc
2946
2947 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2948 libsystemd-id128-install-hook:
2949         libname=libsystemd-id128.so && $(move-to-rootlibdir)
2950
2951 libsystemd-id128-uninstall-hook:
2952         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-id128.so*
2953
2954 INSTALL_EXEC_HOOKS += libsystemd-id128-install-hook
2955 UNINSTALL_EXEC_HOOKS += libsystemd-id128-uninstall-hook
2956
2957 EXTRA_DIST += \
2958         src/libsystemd-id128/libsystemd-id128.pc.in
2959
2960 # ------------------------------------------------------------------------------
2961
2962 rootlibexec_PROGRAMS += \
2963         systemd-activate
2964
2965 systemd_activate_SOURCES = \
2966         src/activate/activate.c
2967
2968 systemd_activate_LDADD = \
2969         libsystemd-label.la \
2970         libsystemd-daemon-internal.la \
2971         libsystemd-shared.la
2972
2973 # ------------------------------------------------------------------------------
2974 systemd_journald_SOURCES = \
2975         src/journal/journald.c \
2976         src/journal/journald-server.h
2977
2978 systemd_journald_LDADD = \
2979         libsystemd-journal-core.la \
2980         libsystemd-bus-internal.la \
2981         libsystemd-shared.la
2982
2983 systemd_cat_SOURCES = \
2984         src/journal/cat.c
2985
2986 systemd_cat_LDADD = \
2987         libsystemd-journal-core.la
2988
2989 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
2990 journalctl_CFLAGS = \
2991         $(AM_CFLAGS)
2992
2993 journalctl_SOURCES = \
2994         src/journal/journalctl.c
2995
2996 journalctl_LDADD = \
2997         libsystemd-journal-internal.la \
2998         libsystemd-id128-internal.la \
2999         libsystemd-logs.la \
3000         libsystemd-shared.la
3001
3002 if HAVE_ACL
3003 journalctl_LDADD += \
3004         libsystemd-acl.la
3005 endif
3006
3007 if HAVE_QRENCODE
3008 journalctl_SOURCES += \
3009         src/journal/journal-qrcode.c \
3010         src/journal/journal-qrcode.h
3011
3012 journalctl_CFLAGS += \
3013         $(QRENCODE_CFLAGS)
3014
3015 journalctl_LDADD += \
3016         $(QRENCODE_LIBS)
3017 endif
3018
3019 test_journal_SOURCES = \
3020         src/journal/test-journal.c
3021
3022 test_journal_LDADD = \
3023         libsystemd-journal-core.la
3024
3025 test_journal_send_SOURCES = \
3026         src/journal/test-journal-send.c
3027
3028 test_journal_send_LDADD = \
3029         libsystemd-journal-core.la
3030
3031 test_journal_syslog_SOURCES = \
3032         src/journal/test-journal-syslog.c
3033
3034 test_journal_syslog_LDADD = \
3035         libsystemd-journal-core.la
3036
3037 test_journal_match_SOURCES = \
3038         src/journal/test-journal-match.c
3039
3040 test_journal_match_LDADD = \
3041         libsystemd-journal-core.la
3042
3043 test_journal_enum_SOURCES = \
3044         src/journal/test-journal-enum.c
3045
3046 test_journal_enum_LDADD = \
3047         libsystemd-journal-core.la
3048
3049 test_journal_stream_SOURCES = \
3050         src/journal/test-journal-stream.c
3051
3052 test_journal_stream_LDADD = \
3053         libsystemd-journal-core.la
3054
3055 test_journal_flush_SOURCES = \
3056         src/journal/test-journal-flush.c
3057
3058 test_journal_flush_LDADD = \
3059         libsystemd-journal-core.la
3060
3061 test_journal_init_SOURCES = \
3062         src/journal/test-journal-init.c
3063
3064 test_journal_init_LDADD = \
3065         libsystemd-journal-core.la
3066
3067 test_journal_verify_SOURCES = \
3068         src/journal/test-journal-verify.c
3069
3070 test_journal_verify_LDADD = \
3071         libsystemd-journal-core.la
3072
3073 test_journal_interleaving_SOURCES = \
3074         src/journal/test-journal-interleaving.c
3075
3076 test_journal_interleaving_LDADD = \
3077         libsystemd-journal-core.la
3078
3079 test_mmap_cache_SOURCES = \
3080         src/journal/test-mmap-cache.c
3081
3082 test_mmap_cache_LDADD = \
3083         libsystemd-journal-core.la
3084
3085 test_catalog_SOURCES = \
3086         src/journal/test-catalog.c
3087
3088 test_catalog_CPPFLAGS = \
3089         $(AM_CPPFLAGS) \
3090         -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
3091
3092 test_catalog_LDADD = \
3093         libsystemd-journal-core.la
3094
3095 libsystemd_journal_la_SOURCES = \
3096         src/journal/libsystemd-journal.sym \
3097         src/journal/sd-journal.c \
3098         src/systemd/sd-journal.h \
3099         src/systemd/_sd-common.h \
3100         src/journal/journal-file.c \
3101         src/journal/journal-file.h \
3102         src/journal/journal-vacuum.c \
3103         src/journal/journal-vacuum.h \
3104         src/journal/journal-verify.c \
3105         src/journal/journal-verify.h \
3106         src/journal/lookup3.c \
3107         src/journal/lookup3.h \
3108         src/journal/journal-send.c \
3109         src/journal/journal-def.h \
3110         src/journal/compress.h \
3111         src/journal/catalog.c \
3112         src/journal/catalog.h \
3113         src/journal/mmap-cache.c \
3114         src/journal/mmap-cache.h
3115
3116 libsystemd_journal_la_CFLAGS = \
3117         $(AM_CFLAGS) \
3118         -fvisibility=hidden
3119
3120 libsystemd_journal_la_LDFLAGS = \
3121         $(AM_LDFLAGS) \
3122         -version-info $(LIBSYSTEMD_JOURNAL_CURRENT):$(LIBSYSTEMD_JOURNAL_REVISION):$(LIBSYSTEMD_JOURNAL_AGE) \
3123         -Wl,--version-script=$(top_srcdir)/src/journal/libsystemd-journal.sym
3124
3125 libsystemd_journal_la_LIBADD = \
3126         libsystemd-label.la \
3127         libsystemd-daemon-internal.la \
3128         libsystemd-id128-internal.la \
3129         libsystemd-shared.la
3130
3131 libsystemd_journal_internal_la_SOURCES = \
3132         $(libsystemd_journal_la_SOURCES)
3133
3134 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3135 libsystemd_journal_internal_la_CFLAGS = \
3136         $(AM_CFLAGS)
3137
3138 libsystemd_journal_internal_la_LIBADD =
3139
3140 if HAVE_XZ
3141 libsystemd_journal_la_SOURCES += \
3142         src/journal/compress.c
3143
3144 libsystemd_journal_la_CFLAGS += \
3145         $(XZ_CFLAGS)
3146
3147 libsystemd_journal_la_LIBADD += \
3148         $(XZ_LIBS)
3149
3150 libsystemd_journal_internal_la_CFLAGS += \
3151         $(XZ_CFLAGS)
3152
3153 libsystemd_journal_internal_la_LIBADD += \
3154         $(XZ_LIBS)
3155 endif
3156
3157 libsystemd_journal_core_la_SOURCES = \
3158         src/journal/journald-kmsg.c \
3159         src/journal/journald-kmsg.h \
3160         src/journal/journald-syslog.c \
3161         src/journal/journald-syslog.h \
3162         src/journal/journald-stream.c \
3163         src/journal/journald-stream.h \
3164         src/journal/journald-server.c \
3165         src/journal/journald-server.h \
3166         src/journal/journald-console.c \
3167         src/journal/journald-console.h \
3168         src/journal/journald-native.c \
3169         src/journal/journald-native.h \
3170         src/journal/journald-rate-limit.c \
3171         src/journal/journald-rate-limit.h \
3172         src/journal/journal-internal.h
3173
3174 nodist_libsystemd_journal_core_la_SOURCES = \
3175         src/journal/journald-gperf.c
3176
3177 libsystemd_journal_core_la_LIBADD = \
3178         libsystemd-journal-internal.la \
3179         libudev-internal.la \
3180         libsystemd-capability.la \
3181         libsystemd-label.la \
3182         libsystemd-daemon-internal.la \
3183         libsystemd-id128-internal.la \
3184         libsystemd-shared.la
3185
3186 if ENABLE_LOGIND
3187 libsystemd_journal_core_la_LIBADD += \
3188         libsystemd-login-internal.la
3189 endif
3190
3191 if HAVE_ACL
3192 libsystemd_journal_core_la_LIBADD += \
3193         libsystemd-acl.la
3194 endif
3195
3196 noinst_LTLIBRARIES += \
3197         libsystemd-journal-core.la
3198
3199 if HAVE_GCRYPT
3200 libsystemd_journal_la_SOURCES += \
3201         src/journal/journal-authenticate.c \
3202         src/journal/journal-authenticate.h \
3203         src/journal/fsprg.c \
3204         src/journal/fsprg.h
3205
3206 libsystemd_journal_la_CFLAGS += \
3207         $(GCRYPT_CFLAGS) \
3208         -Wno-pointer-arith
3209
3210 libsystemd_journal_la_LIBADD += \
3211         $(GCRYPT_LIBS)
3212
3213 libsystemd_journal_internal_la_CFLAGS += \
3214         $(GCRYPT_CFLAGS) \
3215         -Wno-pointer-arith
3216
3217 libsystemd_journal_internal_la_LIBADD += \
3218         $(GCRYPT_LIBS)
3219 endif
3220
3221 # move lib from $(libdir) to $(rootlibdir) and update devel link, if
3222 # needed. Also, grant read access to new journal files to members of
3223 # "adm" and "wheel".
3224 libsystemd-journal-install-hook:
3225         libname=libsystemd-journal.so && $(move-to-rootlibdir)
3226         -$(MKDIR_P) $(DESTDIR)/var/log/journal
3227         -chown 0:0 $(DESTDIR)/var/log/journal
3228         -chmod 755 $(DESTDIR)/var/log/journal
3229         -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
3230         -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
3231
3232 libsystemd-journal-uninstall-hook:
3233         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so*
3234
3235 INSTALL_EXEC_HOOKS += libsystemd-journal-install-hook
3236 UNINSTALL_EXEC_HOOKS += libsystemd-journal-uninstall-hook
3237
3238 # ------------------------------------------------------------------------------
3239
3240 # Update catalog on installation. Do not bother if installing
3241 # in DESTDIR, since this is likely for packaging purposes.
3242 catalog-update-hook:
3243         -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
3244
3245 INSTALL_DATA_HOOKS += \
3246         catalog-update-hook
3247
3248 catalog-remove-hook:
3249         -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
3250
3251 UNINSTALL_DATA_HOOKS += \
3252         catalog-remove-hook
3253
3254 manual_tests += \
3255         test-journal-enum
3256
3257 tests += \
3258         test-journal \
3259         test-journal-send \
3260         test-journal-syslog \
3261         test-journal-match \
3262         test-journal-stream \
3263         test-journal-init \
3264         test-journal-verify \
3265         test-journal-interleaving \
3266         test-journal-flush \
3267         test-mmap-cache \
3268         test-catalog
3269
3270 pkginclude_HEADERS += \
3271         src/systemd/sd-journal.h \
3272         src/systemd/sd-messages.h \
3273         src/systemd/_sd-common.h
3274
3275 lib_LTLIBRARIES += \
3276         libsystemd-journal.la
3277
3278 noinst_LTLIBRARIES += \
3279         libsystemd-journal-internal.la
3280
3281 rootlibexec_PROGRAMS += \
3282         systemd-journald
3283
3284 rootbin_PROGRAMS += \
3285         journalctl
3286
3287 bin_PROGRAMS += \
3288         systemd-cat
3289
3290 dist_systemunit_DATA += \
3291         units/systemd-journald.socket
3292
3293 nodist_systemunit_DATA += \
3294         units/systemd-journald.service \
3295         units/systemd-journal-flush.service
3296
3297 dist_pkgsysconf_DATA += \
3298         src/journal/journald.conf
3299
3300 pkgconfiglib_DATA += \
3301         src/journal/libsystemd-journal.pc
3302
3303 dist_catalog_DATA = \
3304         catalog/systemd.fr.catalog \
3305         catalog/systemd.ru.catalog \
3306         catalog/systemd.it.catalog \
3307         catalog/systemd.catalog
3308
3309 SOCKETS_TARGET_WANTS += \
3310         systemd-journald.socket
3311 SYSINIT_TARGET_WANTS += \
3312         systemd-journald.service \
3313         systemd-journal-flush.service
3314
3315 EXTRA_DIST += \
3316         src/journal/libsystemd-journal.pc.in \
3317         units/systemd-journald.service.in \
3318         units/systemd-journal-flush.service.in \
3319         src/journal/journald-gperf.gperf
3320
3321 CLEANFILES += \
3322         src/journal/journald-gperf.c
3323
3324 # ------------------------------------------------------------------------------
3325 if HAVE_MICROHTTPD
3326 gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
3327
3328 rootlibexec_PROGRAMS += \
3329         systemd-journal-gatewayd
3330
3331 systemd_journal_gatewayd_SOURCES = \
3332         src/journal/journal-gatewayd.c \
3333         src/journal/microhttpd-util.h \
3334         src/journal/microhttpd-util.c
3335
3336 systemd_journal_gatewayd_LDADD = \
3337         libsystemd-logs.la \
3338         libsystemd-journal-internal.la \
3339         libsystemd-id128-internal.la \
3340         libsystemd-daemon-internal.la \
3341         libsystemd-bus-internal.la \
3342         libsystemd-shared.la \
3343         $(MICROHTTPD_LIBS)
3344
3345 systemd_journal_gatewayd_CFLAGS = \
3346         $(AM_CFLAGS) \
3347         $(MICROHTTPD_CFLAGS)
3348
3349 systemd_journal_gatewayd_CPPFLAGS = \
3350         $(AM_CPPFLAGS) \
3351         -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
3352
3353 dist_systemunit_DATA += \
3354         units/systemd-journal-gatewayd.socket
3355
3356 nodist_systemunit_DATA += \
3357         units/systemd-journal-gatewayd.service
3358
3359 dist_gatewayddocumentroot_DATA = \
3360         src/journal/browse.html
3361
3362 endif
3363
3364 EXTRA_DIST += \
3365         units/systemd-journal-gatewayd.service.in
3366
3367 # ------------------------------------------------------------------------------
3368
3369 systemd_socket_proxyd_SOURCES = \
3370         src/socket-proxy/socket-proxyd.c
3371
3372 systemd_socket_proxyd_LDADD = \
3373         libsystemd-logs.la \
3374         libsystemd-bus-internal.la \
3375         libsystemd-journal-internal.la \
3376         libsystemd-id128-internal.la \
3377         libsystemd-daemon-internal.la \
3378         libsystemd-shared.la
3379
3380 # ------------------------------------------------------------------------------
3381 if ENABLE_COREDUMP
3382 systemd_coredump_SOURCES = \
3383         src/journal/coredump.c
3384
3385 systemd_coredump_LDADD = \
3386         libsystemd-journal-internal.la \
3387         libsystemd-label.la \
3388         libsystemd-shared.la
3389
3390 if ENABLE_LOGIND
3391 systemd_coredump_LDADD += \
3392         libsystemd-login-internal.la
3393 endif
3394
3395 rootlibexec_PROGRAMS += \
3396         systemd-coredump
3397
3398 systemd_coredumpctl_SOURCES = \
3399         src/journal/coredumpctl.c
3400
3401 systemd_coredumpctl_LDADD = \
3402         libsystemd-journal-internal.la \
3403         libsystemd-id128-internal.la \
3404         libsystemd-shared.la
3405
3406 bin_PROGRAMS += \
3407         systemd-coredumpctl
3408
3409 dist_bashcompletion_DATA += \
3410         shell-completion/bash/systemd-coredumpctl
3411
3412 dist_zshcompletion_DATA += \
3413         shell-completion/zsh/_systemd-coredumpctl
3414
3415 sysctl_DATA = \
3416         sysctl.d/50-coredump.conf
3417
3418 CLEANFILES += \
3419         sysctl.d/50-coredump.conf
3420 endif
3421
3422 EXTRA_DIST += \
3423         sysctl.d/50-coredump.conf.in
3424
3425 # ------------------------------------------------------------------------------
3426 if ENABLE_BINFMT
3427 systemd_binfmt_SOURCES = \
3428         src/binfmt/binfmt.c
3429
3430 systemd_binfmt_LDADD = \
3431         libsystemd-shared.la
3432
3433 rootlibexec_PROGRAMS += \
3434         systemd-binfmt
3435
3436 dist_systemunit_DATA += \
3437         units/proc-sys-fs-binfmt_misc.automount \
3438         units/proc-sys-fs-binfmt_misc.mount
3439
3440 nodist_systemunit_DATA += \
3441         units/systemd-binfmt.service
3442
3443 INSTALL_DIRS += \
3444         $(prefix)/lib/binfmt.d \
3445         $(sysconfdir)/binfmt.d
3446
3447 SYSINIT_TARGET_WANTS += \
3448         systemd-binfmt.service \
3449         proc-sys-fs-binfmt_misc.automount
3450
3451 endif
3452
3453 EXTRA_DIST += \
3454         units/systemd-binfmt.service.in
3455
3456 # ------------------------------------------------------------------------------
3457 if ENABLE_VCONSOLE
3458 systemd_vconsole_setup_SOURCES = \
3459         src/vconsole/vconsole-setup.c
3460
3461 systemd_vconsole_setup_LDADD = \
3462         libsystemd-shared.la
3463
3464 rootlibexec_PROGRAMS += \
3465         systemd-vconsole-setup
3466
3467 nodist_systemunit_DATA += \
3468         units/systemd-vconsole-setup.service
3469
3470 SYSINIT_TARGET_WANTS += \
3471         systemd-vconsole-setup.service
3472 endif
3473
3474 EXTRA_DIST += \
3475         units/systemd-vconsole-setup.service.in
3476
3477 # ------------------------------------------------------------------------------
3478 if ENABLE_READAHEAD
3479 systemd_readahead_SOURCES = \
3480         src/readahead/readahead.c \
3481         src/readahead/readahead-collect.c \
3482         src/readahead/readahead-replay.c \
3483         src/readahead/readahead-analyze.c \
3484         src/readahead/readahead-common.c \
3485         src/readahead/readahead-common.h
3486
3487 systemd_readahead_LDADD = \
3488         libsystemd-daemon-internal.la \
3489         libudev-internal.la \
3490         libsystemd-shared.la
3491
3492 dist_doc_DATA += \
3493         src/readahead/sd-readahead.c \
3494         src/systemd/sd-readahead.h
3495
3496 rootlibexec_PROGRAMS += \
3497         systemd-readahead
3498
3499 dist_systemunit_DATA += \
3500         units/systemd-readahead-drop.service \
3501         units/systemd-readahead-done.timer
3502
3503 nodist_systemunit_DATA += \
3504         units/systemd-readahead-collect.service \
3505         units/systemd-readahead-replay.service \
3506         units/systemd-readahead-done.service
3507
3508 endif
3509
3510 EXTRA_DIST += \
3511         units/systemd-readahead-collect.service.in \
3512         units/systemd-readahead-replay.service.in \
3513         units/systemd-readahead-done.service.in
3514
3515 # ------------------------------------------------------------------------------
3516 if ENABLE_BOOTCHART
3517 systemd_bootchart_SOURCES = \
3518         src/bootchart/bootchart.c \
3519         src/bootchart/bootchart.h \
3520         src/bootchart/store.c \
3521         src/bootchart/store.h \
3522         src/bootchart/svg.c \
3523         src/bootchart/svg.h
3524
3525 systemd_bootchart_LDADD = \
3526         libsystemd-journal-internal.la \
3527         libsystemd-shared.la
3528
3529 rootlibexec_PROGRAMS += \
3530         systemd-bootchart
3531
3532 dist_pkgsysconf_DATA += \
3533         src/bootchart/bootchart.conf
3534 endif
3535
3536 # ------------------------------------------------------------------------------
3537 if ENABLE_QUOTACHECK
3538 rootlibexec_PROGRAMS += \
3539         systemd-quotacheck
3540
3541 nodist_systemunit_DATA += \
3542         units/systemd-quotacheck.service
3543
3544 systemd_quotacheck_SOURCES = \
3545         src/quotacheck/quotacheck.c
3546
3547 systemd_quotacheck_LDADD = \
3548         libsystemd-shared.la
3549 endif
3550
3551 EXTRA_DIST += \
3552         units/systemd-quotacheck.service.in
3553
3554 nodist_systemunit_DATA += \
3555         units/quotaon.service
3556
3557 # ------------------------------------------------------------------------------
3558 if ENABLE_RANDOMSEED
3559 rootlibexec_PROGRAMS += \
3560         systemd-random-seed
3561
3562 nodist_systemunit_DATA += \
3563         units/systemd-random-seed.service
3564
3565 systemd_random_seed_SOURCES = \
3566         src/random-seed/random-seed.c
3567
3568 systemd_random_seed_LDADD = \
3569         libsystemd-label.la \
3570         libsystemd-shared.la
3571
3572 SYSINIT_TARGET_WANTS += \
3573         systemd-random-seed.service
3574
3575 endif
3576
3577 EXTRA_DIST += \
3578         units/systemd-random-seed.service.in
3579
3580 # ------------------------------------------------------------------------------
3581 if ENABLE_BACKLIGHT
3582 rootlibexec_PROGRAMS += \
3583         systemd-backlight
3584
3585 nodist_systemunit_DATA += \
3586         units/systemd-backlight@.service
3587
3588 systemd_backlight_SOURCES = \
3589         src/backlight/backlight.c
3590
3591 systemd_backlight_LDADD = \
3592         libsystemd-label.la \
3593         libudev-internal.la \
3594         libsystemd-shared.la
3595 endif
3596
3597 EXTRA_DIST += \
3598         units/systemd-backlight@.service.in
3599
3600 # ------------------------------------------------------------------------------
3601 if ENABLE_RFKILL
3602 rootlibexec_PROGRAMS += \
3603         systemd-rfkill
3604
3605 nodist_systemunit_DATA += \
3606         units/systemd-rfkill@.service
3607
3608 systemd_rfkill_SOURCES = \
3609         src/rfkill/rfkill.c
3610
3611 systemd_rfkill_LDADD = \
3612         libsystemd-label.la \
3613         libudev-internal.la \
3614         libsystemd-shared.la
3615 endif
3616
3617 EXTRA_DIST += \
3618         units/systemd-rfkill@.service.in
3619
3620 # ------------------------------------------------------------------------------
3621 if HAVE_LIBCRYPTSETUP
3622 rootlibexec_PROGRAMS += \
3623         systemd-cryptsetup
3624
3625 systemgenerator_PROGRAMS += \
3626         systemd-cryptsetup-generator
3627
3628 dist_systemunit_DATA += \
3629         units/cryptsetup.target
3630
3631 systemd_cryptsetup_SOURCES = \
3632         src/cryptsetup/cryptsetup.c
3633
3634 systemd_cryptsetup_CFLAGS = \
3635         $(AM_CFLAGS) \
3636         $(LIBCRYPTSETUP_CFLAGS)
3637
3638 systemd_cryptsetup_LDADD = \
3639         libsystemd-label.la \
3640         libudev-internal.la \
3641         libsystemd-shared.la \
3642         $(LIBCRYPTSETUP_LIBS)
3643
3644 systemd_cryptsetup_generator_SOURCES = \
3645         src/cryptsetup/cryptsetup-generator.c
3646
3647 systemd_cryptsetup_generator_LDADD = \
3648         libsystemd-label.la \
3649         libsystemd-shared.la
3650
3651 SYSINIT_TARGET_WANTS += \
3652         cryptsetup.target
3653
3654 endif
3655
3656 # ------------------------------------------------------------------------------
3657 if ENABLE_HOSTNAMED
3658 systemd_hostnamed_SOURCES = \
3659         src/hostname/hostnamed.c
3660
3661 systemd_hostnamed_LDADD = \
3662         libsystemd-label.la \
3663         libsystemd-bus-internal.la \
3664         libsystemd-id128-internal.la \
3665         libsystemd-daemon-internal.la \
3666         libsystemd-shared.la
3667
3668 rootlibexec_PROGRAMS += \
3669         systemd-hostnamed
3670
3671 nodist_systemunit_DATA += \
3672         units/systemd-hostnamed.service
3673
3674 dist_systemunit_DATA += \
3675         units/org.freedesktop.hostname1.busname
3676
3677 dist_dbuspolicy_DATA += \
3678         src/hostname/org.freedesktop.hostname1.conf
3679
3680 dist_dbussystemservice_DATA += \
3681         src/hostname/org.freedesktop.hostname1.service
3682
3683 polkitpolicy_files += \
3684         src/hostname/org.freedesktop.hostname1.policy
3685
3686 SYSTEM_UNIT_ALIASES += \
3687         systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
3688
3689 BUSNAMES_TARGET_WANTS += \
3690         org.freedesktop.hostname1.busname
3691
3692 hostnamectl_SOURCES = \
3693         src/hostname/hostnamectl.c
3694
3695 hostnamectl_LDADD = \
3696         libsystemd-bus-internal.la \
3697         libsystemd-id128-internal.la \
3698         libsystemd-daemon-internal.la \
3699         libsystemd-shared.la
3700
3701 bin_PROGRAMS += \
3702         hostnamectl
3703
3704 dist_bashcompletion_DATA += \
3705         shell-completion/bash/hostnamectl
3706
3707 dist_zshcompletion_DATA += \
3708         shell-completion/zsh/_hostnamectl
3709
3710 endif
3711
3712 polkitpolicy_in_files += \
3713         src/hostname/org.freedesktop.hostname1.policy.in
3714
3715 EXTRA_DIST += \
3716         units/systemd-hostnamed.service.in
3717
3718 # ------------------------------------------------------------------------------
3719 if ENABLE_KDBUS
3720 systemd_bus_driverd_SOURCES = \
3721         src/bus-driverd/bus-driverd.c
3722
3723 systemd_bus_driverd_LDADD = \
3724         libsystemd-bus-internal.la \
3725         libsystemd-id128-internal.la \
3726         libsystemd-daemon-internal.la \
3727         libsystemd-shared.la
3728
3729 rootlibexec_PROGRAMS += \
3730         systemd-bus-driverd
3731
3732 nodist_systemunit_DATA += \
3733         units/systemd-bus-driverd.service
3734
3735 dist_systemunit_DATA += \
3736         units/org.freedesktop.DBus.busname
3737
3738 BUSNAMES_TARGET_WANTS += \
3739         org.freedesktop.DBus.busname
3740
3741 endif
3742
3743 EXTRA_DIST += \
3744         units/systemd-bus-driverd.service.in
3745
3746 # ------------------------------------------------------------------------------
3747 if ENABLE_LOCALED
3748 systemd_localed_SOURCES = \
3749         src/locale/localed.c
3750
3751 systemd_localed_LDADD = \
3752         libsystemd-label.la \
3753         libsystemd-bus-internal.la \
3754         libsystemd-id128-internal.la \
3755         libsystemd-daemon-internal.la \
3756         libsystemd-shared.la
3757
3758 nodist_systemunit_DATA += \
3759         units/systemd-localed.service
3760
3761 dist_systemunit_DATA += \
3762         units/org.freedesktop.locale1.busname
3763
3764 rootlibexec_PROGRAMS += \
3765         systemd-localed
3766
3767 dist_dbuspolicy_DATA += \
3768         src/locale/org.freedesktop.locale1.conf
3769
3770 dist_dbussystemservice_DATA += \
3771         src/locale/org.freedesktop.locale1.service
3772
3773 polkitpolicy_files += \
3774         src/locale/org.freedesktop.locale1.policy
3775
3776 SYSTEM_UNIT_ALIASES += \
3777         systemd-localed.service dbus-org.freedesktop.locale1.service
3778
3779 BUSNAMES_TARGET_WANTS += \
3780         org.freedesktop.locale1.busname
3781
3782 dist_pkgdata_DATA += \
3783         src/locale/kbd-model-map
3784
3785 dist_noinst_SCRIPT = \
3786         src/locale/generate-kbd-model-map
3787
3788 update-kbd-model-map: src/locale/generate-kbd-model-map
3789         $PYTHON $< > src/locale/kbd-model-map
3790
3791 localectl_SOURCES = \
3792         src/locale/localectl.c
3793
3794 localectl_LDADD = \
3795         libsystemd-bus-internal.la \
3796         libsystemd-id128-internal.la \
3797         libsystemd-daemon-internal.la \
3798         libsystemd-shared.la
3799
3800 bin_PROGRAMS += \
3801         localectl
3802
3803 dist_bashcompletion_DATA += \
3804         shell-completion/bash/localectl
3805
3806 dist_zshcompletion_DATA += \
3807         shell-completion/zsh/_localectl
3808
3809 endif
3810
3811 polkitpolicy_in_files += \
3812         src/locale/org.freedesktop.locale1.policy.in
3813
3814 EXTRA_DIST += \
3815         units/systemd-localed.service.in
3816
3817 # ------------------------------------------------------------------------------
3818 if ENABLE_TIMEDATED
3819 systemd_timedated_SOURCES = \
3820         src/timedate/timedated.c
3821
3822 systemd_timedated_LDADD = \
3823         libsystemd-label.la \
3824         libsystemd-bus-internal.la \
3825         libsystemd-id128-internal.la \
3826         libsystemd-daemon-internal.la \
3827         libsystemd-shared.la
3828
3829 rootlibexec_PROGRAMS += \
3830         systemd-timedated
3831
3832 dist_dbussystemservice_DATA += \
3833         src/timedate/org.freedesktop.timedate1.service
3834
3835 dist_dbuspolicy_DATA += \
3836         src/timedate/org.freedesktop.timedate1.conf
3837
3838 nodist_systemunit_DATA += \
3839         units/systemd-timedated.service
3840
3841 dist_systemunit_DATA += \
3842         units/org.freedesktop.timedate1.busname
3843
3844 polkitpolicy_files += \
3845         src/timedate/org.freedesktop.timedate1.policy
3846
3847 INSTALL_DIRS += \
3848         $(prefix)/lib/systemd/ntp-units.d \
3849         $(sysconfdir)/systemd/ntp-units.d
3850
3851 SYSTEM_UNIT_ALIASES += \
3852         systemd-timedated.service dbus-org.freedesktop.timedate1.service
3853
3854 BUSNAMES_TARGET_WANTS += \
3855         org.freedesktop.timedate1.busname
3856
3857 timedatectl_SOURCES = \
3858         src/timedate/timedatectl.c
3859
3860 timedatectl_LDADD = \
3861         libsystemd-bus-internal.la \
3862         libsystemd-id128-internal.la \
3863         libsystemd-daemon-internal.la \
3864         libsystemd-shared.la
3865
3866 bin_PROGRAMS += \
3867         timedatectl
3868
3869 dist_bashcompletion_DATA += \
3870         shell-completion/bash/timedatectl
3871
3872 dist_zshcompletion_DATA += \
3873         shell-completion/zsh/_timedatectl