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