chiark / gitweb /
journal: add a test case for flushing messages out of a series of journal files into...
[elogind.git] / Makefile.am
1 #  -*- Mode: makefile; indent-tabs-mode: t -*-
2 #
3 #  This file is part of systemd.
4 #
5 #  Copyright 2010-2012 Lennart Poettering
6 #  Copyright 2010-2012 Kay Sievers
7 #  Copyright 2013 Zbigniew Jędrzejewski-Szmek
8 #  Copyright 2013 David Strauss
9 #
10 #  systemd is free software; you can redistribute it and/or modify it
11 #  under the terms of the GNU Lesser General Public License as published by
12 #  the Free Software Foundation; either version 2.1 of the License, or
13 #  (at your option) any later version.
14 #
15 #  systemd is distributed in the hope that it will be useful, but
16 #  WITHOUT ANY WARRANTY; without even the implied warranty of
17 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 #  Lesser General Public License for more details.
19 #
20 #  You should have received a copy of the GNU Lesser General Public License
21 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
22
23 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
24 AM_MAKEFLAGS = --no-print-directory
25 AUTOMAKE_OPTIONS = color-tests parallel-tests
26
27 SUBDIRS = . po
28
29 # remove targets if the command fails
30 .DELETE_ON_ERROR:
31
32 # keep intermediate files
33 .SECONDARY:
34
35 # Keep the test-suite.log
36 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
37
38 LIBUDEV_CURRENT=5
39 LIBUDEV_REVISION=0
40 LIBUDEV_AGE=4
41
42 LIBGUDEV_CURRENT=1
43 LIBGUDEV_REVISION=3
44 LIBGUDEV_AGE=1
45
46 LIBSYSTEMD_LOGIN_CURRENT=9
47 LIBSYSTEMD_LOGIN_REVISION=1
48 LIBSYSTEMD_LOGIN_AGE=9
49
50 LIBSYSTEMD_DAEMON_CURRENT=0
51 LIBSYSTEMD_DAEMON_REVISION=10
52 LIBSYSTEMD_DAEMON_AGE=0
53
54 LIBSYSTEMD_ID128_CURRENT=0
55 LIBSYSTEMD_ID128_REVISION=26
56 LIBSYSTEMD_ID128_AGE=0
57
58 LIBSYSTEMD_JOURNAL_CURRENT=11
59 LIBSYSTEMD_JOURNAL_REVISION=3
60 LIBSYSTEMD_JOURNAL_AGE=11
61
62 LIBSYSTEMD_BUS_CURRENT=0
63 LIBSYSTEMD_BUS_REVISION=0
64 LIBSYSTEMD_BUS_AGE=0
65
66 # Dirs of external packages
67 dbuspolicydir=@dbuspolicydir@
68 dbussessionservicedir=@dbussessionservicedir@
69 dbussystemservicedir=@dbussystemservicedir@
70 pamlibdir=@pamlibdir@
71 pamconfdir=@pamconfdir@
72 pkgconfigdatadir=$(datadir)/pkgconfig
73 pkgconfiglibdir=$(libdir)/pkgconfig
74 polkitpolicydir=$(datadir)/polkit-1/actions
75 bashcompletiondir=@bashcompletiondir@
76 zshcompletiondir=@zshcompletiondir@
77 rpmmacrosdir=$(prefix)/lib/rpm/macros.d
78 sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
79 sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
80 varlogdir=$(localstatedir)/log
81 systemdstatedir=$(localstatedir)/lib/systemd
82 catalogstatedir=$(systemdstatedir)/catalog
83
84 # Our own, non-special dirs
85 pkgsysconfdir=$(sysconfdir)/systemd
86 userunitdir=$(prefix)/lib/systemd/user
87 userpresetdir=$(prefix)/lib/systemd/user-preset
88 tmpfilesdir=$(prefix)/lib/tmpfiles.d
89 sysctldir=$(prefix)/lib/sysctl.d
90 networkdir=$(prefix)/lib/systemd/network
91 pkgincludedir=$(includedir)/systemd
92 systemgeneratordir=$(rootlibexecdir)/system-generators
93 usergeneratordir=$(prefix)/lib/systemd/user-generators
94 systemshutdowndir=$(rootlibexecdir)/system-shutdown
95 systemsleepdir=$(rootlibexecdir)/system-sleep
96 systemunitdir=$(rootprefix)/lib/systemd/system
97 systempresetdir=$(rootprefix)/lib/systemd/system-preset
98 udevlibexecdir=$(rootprefix)/lib/udev
99 udevhomedir=$(udevlibexecdir)
100 udevrulesdir=$(udevlibexecdir)/rules.d
101 udevhwdbdir=$(udevlibexecdir)/hwdb.d
102 catalogdir=$(prefix)/lib/systemd/catalog
103 kernelinstalldir = $(prefix)/lib/kernel/install.d
104
105 # And these are the special ones for /
106 rootprefix=@rootprefix@
107 rootbindir=$(rootprefix)/bin
108 rootlibexecdir=$(rootprefix)/lib/systemd
109
110 CLEANFILES = $(BUILT_SOURCES)
111 DISTCLEANFILES =
112 EXTRA_DIST =
113 BUILT_SOURCES =
114 INSTALL_EXEC_HOOKS =
115 UNINSTALL_EXEC_HOOKS =
116 INSTALL_DATA_HOOKS =
117 UNINSTALL_DATA_HOOKS =
118 DISTCLEAN_LOCAL_HOOKS =
119 CLEAN_LOCAL_HOOKS =
120 pkginclude_HEADERS =
121 noinst_LTLIBRARIES =
122 lib_LTLIBRARIES =
123 include_HEADERS =
124 noinst_DATA =
125 pkgconfiglib_DATA =
126 polkitpolicy_in_in_files =
127 polkitpolicy_in_files =
128 polkitpolicy_files =
129 dist_udevrules_DATA =
130 nodist_udevrules_DATA =
131 dist_pkgsysconf_DATA =
132 dist_pkgdata_DATA =
133 dist_dbuspolicy_DATA =
134 dist_dbussystemservice_DATA =
135 check_PROGRAMS =
136 check_DATA =
137 tests=
138 manual_tests =
139 if ENABLE_TESTS
140 noinst_PROGRAMS = $(manual_tests) $(tests)
141 TESTS = $(tests)
142 else
143 noinst_PROGRAMS =
144 TESTS =
145 endif
146 udevlibexec_PROGRAMS =
147
148 AM_CPPFLAGS = \
149         -include $(top_builddir)/config.h \
150         -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
151         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
152         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
153         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
154         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
155         -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
156         -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
157         -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
158         -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
159         -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
160         -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
161         -DSYSTEMD_SLEEP_BINARY_PATH=\"$(rootlibexecdir)/systemd-sleep\" \
162         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
163         -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(rootbindir)/systemd-tty-ask-password-agent\" \
164         -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
165         -DROOTPREFIX=\"$(rootprefix)\" \
166         -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\" \
167         -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\" \
168         -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
169         -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
170         -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
171         -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
172         -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
173         -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
174         -DX_SERVER=\"$(bindir)/X\" \
175         -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
176         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
177         -DQUOTACHECK=\"$(QUOTACHECK)\" \
178         -DKEXEC=\"$(KEXEC)\" \
179         -I $(top_srcdir)/src \
180         -I $(top_builddir)/src/shared \
181         -I $(top_srcdir)/src/shared \
182         -I $(top_srcdir)/src/network \
183         -I $(top_srcdir)/src/login \
184         -I $(top_srcdir)/src/journal \
185         -I $(top_srcdir)/src/systemd \
186         -I $(top_builddir)/src/core \
187         -I $(top_srcdir)/src/core \
188         -I $(top_srcdir)/src/libudev \
189         -I $(top_srcdir)/src/udev \
190         -I $(top_srcdir)/src/udev/net \
191         -I $(top_builddir)/src/udev \
192         -I $(top_srcdir)/src/libsystemd-bus \
193         -I $(top_srcdir)/src/libsystemd-rtnl \
194         $(OUR_CPPFLAGS)
195
196 AM_CFLAGS = $(OUR_CFLAGS)
197 AM_LDFLAGS = $(OUR_LDFLAGS)
198
199 # ------------------------------------------------------------------------------
200 define move-to-rootlibdir
201         if test "$(libdir)" != "$(rootlibdir)"; then \
202                 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
203                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
204                 so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
205                 $(LN_S) -f $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
206                 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
207         fi
208 endef
209
210 INSTALL_DIRS =
211
212 RUNLEVEL1_TARGET_WANTS =
213 RUNLEVEL2_TARGET_WANTS =
214 RUNLEVEL3_TARGET_WANTS =
215 RUNLEVEL4_TARGET_WANTS =
216 RUNLEVEL5_TARGET_WANTS =
217 SHUTDOWN_TARGET_WANTS =
218 LOCAL_FS_TARGET_WANTS =
219 MULTI_USER_TARGET_WANTS =
220 SYSINIT_TARGET_WANTS =
221 SOCKETS_TARGET_WANTS =
222 TIMERS_TARGET_WANTS =
223
224 SYSTEM_UNIT_ALIASES =
225 USER_UNIT_ALIASES =
226
227 GENERAL_ALIASES =
228
229 install-target-wants-hook:
230         what="$(RUNLEVEL1_TARGET_WANTS)" && wants=runlevel1.target && $(add-wants)
231         what="$(RUNLEVEL2_TARGET_WANTS)" && wants=runlevel2.target && $(add-wants)
232         what="$(RUNLEVEL3_TARGET_WANTS)" && wants=runlevel3.target && $(add-wants)
233         what="$(RUNLEVEL4_TARGET_WANTS)" && wants=runlevel4.target && $(add-wants)
234         what="$(RUNLEVEL5_TARGET_WANTS)" && wants=runlevel5.target && $(add-wants)
235         what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && $(add-wants)
236         what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && $(add-wants)
237         what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && $(add-wants)
238         what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && $(add-wants)
239         what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && $(add-wants)
240         what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && $(add-wants)
241         what="$(SLICES_TARGET_WANTS)" && wants=slices.target && $(add-wants)
242
243 define add-wants
244         [ -z "$$what" ] || ( \
245           dir=$(DESTDIR)$(systemunitdir)/$$wants.wants && \
246           $(MKDIR_P) -m 0755 $$dir && \
247           cd $$dir && \
248           rm -f $$what && \
249           for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
250 endef
251
252 install-directories-hook:
253         $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
254
255 install-aliases-hook:
256         set -- $(SYSTEM_UNIT_ALIASES) && \
257                 dir=$(systemunitdir) && $(install-aliases)
258         set -- $(USER_UNIT_ALIASES) && \
259                 dir=$(userunitdir) && $(install-aliases)
260         set -- $(GENERAL_ALIASES) && \
261                 dir= && $(install-aliases)
262
263 define install-aliases
264         while [ -n "$$1" ]; do \
265                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
266                 rm -f $(DESTDIR)$$dir/$$2 && \
267                 $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
268                 shift 2 || exit $$?; \
269         done
270 endef
271
272 INSTALL_EXEC_HOOKS += \
273         install-target-wants-hook \
274         install-directories-hook \
275         install-aliases-hook
276
277 # ------------------------------------------------------------------------------
278 AM_V_M4 = $(AM_V_M4_$(V))
279 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
280 AM_V_M4_0 = @echo "  M4      " $@;
281
282 AM_V_XSLT = $(AM_V_XSLT_$(V))
283 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
284 AM_V_XSLT_0 = @echo "  XSLT    " $@;
285
286 AM_V_GPERF = $(AM_V_GPERF_$(V))
287 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
288 AM_V_GPERF_0 = @echo "  GPERF   " $@;
289
290 AM_V_LN = $(AM_V_LN_$(V))
291 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
292 AM_V_LN_0 = @echo "  LN      " $@;
293
294 # ------------------------------------------------------------------------------
295 rootbin_PROGRAMS = \
296         systemctl \
297         systemd-notify \
298         systemd-ask-password \
299         systemd-tty-ask-password-agent \
300         systemd-machine-id-setup
301
302 bin_PROGRAMS = \
303         systemd-cgls \
304         systemd-cgtop \
305         systemd-stdio-bridge \
306         systemd-nspawn \
307         systemd-detect-virt \
308         systemd-delta \
309         systemd-analyze \
310         systemd-run
311
312 dist_bin_SCRIPTS = \
313         src/kernel-install/kernel-install
314
315 dist_kernelinstall_SCRIPTS = \
316         src/kernel-install/50-depmod.install \
317         src/kernel-install/90-loaderentry.install
318
319 rootlibexec_PROGRAMS = \
320         systemd \
321         systemd-cgroups-agent \
322         systemd-initctl \
323         systemd-update-utmp \
324         systemd-shutdownd \
325         systemd-shutdown \
326         systemd-remount-fs \
327         systemd-reply-password \
328         systemd-fsck \
329         systemd-ac-power \
330         systemd-sysctl \
331         systemd-sleep \
332         systemd-socket-proxyd
333
334 systemgenerator_PROGRAMS = \
335         systemd-getty-generator \
336         systemd-fstab-generator \
337         systemd-system-update-generator
338
339 dist_bashcompletion_DATA = \
340         shell-completion/bash/journalctl \
341         shell-completion/bash/systemctl \
342         shell-completion/bash/systemd-analyze \
343         shell-completion/bash/systemd-run \
344         shell-completion/bash/udevadm \
345         shell-completion/bash/kernel-install
346
347 dist_zshcompletion_DATA = \
348         shell-completion/zsh/_systemctl \
349         shell-completion/zsh/_journalctl \
350         shell-completion/zsh/_udevadm \
351         shell-completion/zsh/_kernel-install \
352         shell-completion/zsh/_systemd-nspawn \
353         shell-completion/zsh/_systemd-analyze \
354         shell-completion/zsh/_systemd-run \
355         shell-completion/zsh/_sd_hosts_or_user_at_host \
356         shell-completion/zsh/_systemd-delta \
357         shell-completion/zsh/_systemd
358
359 dist_sysctl_DATA = \
360         sysctl.d/50-default.conf
361
362 dist_systemunit_DATA = \
363         units/graphical.target \
364         units/multi-user.target \
365         units/emergency.service \
366         units/emergency.target \
367         units/sysinit.target \
368         units/basic.target \
369         units/getty.target \
370         units/halt.target \
371         units/kexec.target \
372         units/local-fs.target \
373         units/local-fs-pre.target \
374         units/initrd.target \
375         units/initrd-fs.target \
376         units/initrd-root-fs.target \
377         units/remote-fs.target \
378         units/remote-fs-pre.target \
379         units/network.target \
380         units/network-online.target \
381         units/nss-lookup.target \
382         units/nss-user-lookup.target \
383         units/hibernate.target \
384         units/hybrid-sleep.target \
385         units/poweroff.target \
386         units/reboot.target \
387         units/rescue.target \
388         units/rpcbind.target \
389         units/time-sync.target \
390         units/shutdown.target \
391         units/final.target \
392         units/umount.target \
393         units/sigpwr.target \
394         units/sleep.target \
395         units/sockets.target \
396         units/timers.target \
397         units/paths.target \
398         units/suspend.target \
399         units/swap.target \
400         units/slices.target \
401         units/system.slice \
402         units/x-.slice \
403         units/systemd-initctl.socket \
404         units/systemd-shutdownd.socket \
405         units/syslog.socket \
406         units/dev-hugepages.mount \
407         units/dev-mqueue.mount \
408         units/sys-kernel-config.mount \
409         units/sys-kernel-debug.mount \
410         units/sys-fs-fuse-connections.mount \
411         units/tmp.mount \
412         units/printer.target \
413         units/sound.target \
414         units/bluetooth.target \
415         units/smartcard.target \
416         units/systemd-ask-password-wall.path \
417         units/systemd-ask-password-console.path \
418         units/systemd-udevd-control.socket \
419         units/systemd-udevd-kernel.socket \
420         units/system-update.target \
421         units/initrd-switch-root.target
422
423 nodist_systemunit_DATA = \
424         units/getty@.service \
425         units/serial-getty@.service \
426         units/console-shell.service \
427         units/console-getty.service \
428         units/container-getty@.service \
429         units/systemd-initctl.service \
430         units/systemd-shutdownd.service \
431         units/systemd-remount-fs.service \
432         units/systemd-update-utmp.service \
433         units/systemd-update-utmp-runlevel.service \
434         units/systemd-ask-password-wall.service \
435         units/systemd-ask-password-console.service \
436         units/systemd-sysctl.service \
437         units/emergency.service \
438         units/rescue.service \
439         units/user@.service \
440         units/systemd-hibernate.service \
441         units/systemd-hybrid-sleep.service \
442         units/systemd-suspend.service \
443         units/systemd-halt.service \
444         units/systemd-poweroff.service \
445         units/systemd-reboot.service \
446         units/systemd-kexec.service \
447         units/systemd-fsck@.service \
448         units/systemd-fsck-root.service \
449         units/systemd-udevd.service \
450         units/systemd-udev-trigger.service \
451         units/systemd-udev-settle.service \
452         units/debug-shell.service \
453         units/initrd-parse-etc.service \
454         units/initrd-cleanup.service \
455         units/initrd-udevadm-cleanup-db.service \
456         units/initrd-switch-root.service \
457         units/systemd-nspawn@.service
458
459 dist_userunit_DATA = \
460         units/user/default.target \
461         units/user/exit.target
462
463 nodist_userunit_DATA = \
464         units/user/systemd-exit.service
465
466 EXTRA_DIST += \
467         units/getty@.service.m4 \
468         units/serial-getty@.service.m4 \
469         units/console-shell.service.m4.in \
470         units/console-getty.service.m4.in \
471         units/container-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
504 CLEANFILES += \
505         units/console-shell.service.m4 \
506         units/console-getty.service.m4 \
507         units/container-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-rtnl.la
637
638 libsystemd_rtnl_la_SOURCES = \
639         src/systemd/sd-rtnl.h \
640         src/libsystemd-rtnl/sd-rtnl.c \
641         src/libsystemd-rtnl/rtnl-internal.h \
642         src/libsystemd-rtnl/rtnl-message.c \
643         src/libsystemd-rtnl/rtnl-util.h \
644         src/libsystemd-rtnl/rtnl-util.c
645
646 test_rtnl_SOURCES = \
647         src/libsystemd-rtnl/test-rtnl.c
648
649 test_rtnl_LDADD = \
650         libsystemd-rtnl.la \
651         libsystemd-bus-internal.la \
652         libsystemd-id128-internal.la \
653         libsystemd-shared.la
654
655 tests += test-rtnl
656
657 # ------------------------------------------------------------------------------
658 noinst_LTLIBRARIES += \
659         libsystemd-shared.la
660
661 libsystemd_shared_la_SOURCES = \
662         src/shared/linux/auto_dev-ioctl.h \
663         src/shared/linux/fanotify.h \
664         src/shared/linux/seccomp.h \
665         src/shared/linux/seccomp-bpf.h \
666         src/shared/ioprio.h \
667         src/shared/missing.h \
668         src/shared/initreq.h \
669         src/shared/securebits.h \
670         src/shared/special.h \
671         src/shared/list.h \
672         src/shared/macro.h \
673         src/shared/def.h \
674         src/shared/sparse-endian.h \
675         src/shared/refcnt.h \
676         src/shared/udev-util.h \
677         src/shared/bus-errors.h \
678         src/shared/device-nodes.c \
679         src/shared/device-nodes.h \
680         src/shared/util.c \
681         src/shared/util.h \
682         src/shared/virt.c \
683         src/shared/virt.h \
684         src/shared/efivars.c \
685         src/shared/efivars.h \
686         src/shared/path-util.c \
687         src/shared/path-util.h \
688         src/shared/time-util.c \
689         src/shared/time-util.h \
690         src/shared/hashmap.c \
691         src/shared/hashmap.h \
692         src/shared/set.c \
693         src/shared/set.h \
694         src/shared/fdset.c \
695         src/shared/fdset.h \
696         src/shared/prioq.c \
697         src/shared/prioq.h \
698         src/shared/sleep-config.c \
699         src/shared/sleep-config.h \
700         src/shared/strv.c \
701         src/shared/strv.h \
702         src/shared/env-util.c \
703         src/shared/env-util.h \
704         src/shared/strbuf.c \
705         src/shared/strbuf.h \
706         src/shared/strxcpyx.c \
707         src/shared/strxcpyx.h \
708         src/shared/conf-parser.c \
709         src/shared/conf-parser.h \
710         src/shared/log.c \
711         src/shared/log.h \
712         src/shared/ratelimit.h \
713         src/shared/ratelimit.c \
714         src/shared/exit-status.c \
715         src/shared/exit-status.h \
716         src/shared/utf8.c \
717         src/shared/utf8.h \
718         src/shared/gunicode.c \
719         src/shared/gunicode.h \
720         src/shared/pager.c \
721         src/shared/pager.h \
722         src/shared/socket-util.c \
723         src/shared/socket-util.h \
724         src/shared/conf-files.c \
725         src/shared/conf-files.h \
726         src/shared/cgroup-util.c \
727         src/shared/cgroup-util.h \
728         src/shared/cgroup-show.c \
729         src/shared/cgroup-show.h \
730         src/shared/unit-name.c \
731         src/shared/unit-name.h \
732         src/shared/utmp-wtmp.c \
733         src/shared/utmp-wtmp.h \
734         src/shared/watchdog.c \
735         src/shared/watchdog.h \
736         src/shared/spawn-ask-password-agent.c \
737         src/shared/spawn-ask-password-agent.h \
738         src/shared/replace-var.c \
739         src/shared/replace-var.h \
740         src/shared/spawn-polkit-agent.c \
741         src/shared/spawn-polkit-agent.h \
742         src/shared/hwclock.c \
743         src/shared/hwclock.h \
744         src/shared/time-dst.c \
745         src/shared/time-dst.h \
746         src/shared/calendarspec.c \
747         src/shared/calendarspec.h \
748         src/shared/fileio.c \
749         src/shared/fileio.h \
750         src/shared/output-mode.h \
751         src/shared/MurmurHash3.c \
752         src/shared/MurmurHash3.h \
753         src/shared/acpi-fpdt.h \
754         src/shared/acpi-fpdt.c \
755         src/shared/boot-timestamps.h \
756         src/shared/boot-timestamps.c \
757         src/shared/mkdir.c \
758         src/shared/mkdir.h \
759         src/shared/smack-util.c \
760         src/shared/smack-util.h \
761         src/shared/apparmor-util.c \
762         src/shared/apparmor-util.h \
763         src/shared/ima-util.c \
764         src/shared/ima-util.h \
765         src/shared/ptyfwd.c \
766         src/shared/ptyfwd.h \
767         src/shared/net-util.c \
768         src/shared/net-util.h \
769         src/shared/errno-list.c \
770         src/shared/errno-list.h \
771         src/shared/syscall-list.c \
772         src/shared/syscall-list.h
773
774 nodist_libsystemd_shared_la_SOURCES = \
775         src/shared/errno-from-name.h \
776         src/shared/errno-to-name.h \
777         src/shared/syscall-from-name.h \
778         src/shared/syscall-to-name.h
779
780 # ------------------------------------------------------------------------------
781 noinst_LTLIBRARIES += \
782         libsystemd-units.la
783
784 libsystemd_units_la_SOURCES = \
785         src/shared/install.c \
786         src/shared/install.h \
787         src/shared/install-printf.c \
788         src/shared/install-printf.h \
789         src/shared/path-lookup.c \
790         src/shared/path-lookup.h \
791         src/shared/specifier.c \
792         src/shared/specifier.h
793
794 libsystemd_units_la_CFLAGS = \
795         $(AM_CFLAGS)
796
797 # ------------------------------------------------------------------------------
798 noinst_LTLIBRARIES += \
799         libsystemd-label.la
800
801 libsystemd_label_la_SOURCES = \
802         src/shared/socket-label.c \
803         src/shared/label.c \
804         src/shared/label.h \
805         src/shared/selinux-util.c \
806         src/shared/selinux-util.h \
807         src/shared/mkdir-label.c \
808         src/shared/ask-password-api.c \
809         src/shared/ask-password-api.h \
810         src/shared/fileio-label.c \
811         src/shared/fileio-label.h \
812         src/shared/dev-setup.c \
813         src/shared/dev-setup.h
814
815 libsystemd_label_la_CFLAGS = \
816         $(AM_CFLAGS) \
817         $(SELINUX_CFLAGS)
818
819 libsystemd_label_la_LIBADD = \
820         $(SELINUX_LIBS)
821
822 # ------------------------------------------------------------------------------
823 noinst_LTLIBRARIES += \
824         libsystemd-logs.la
825
826 libsystemd_logs_la_SOURCES = \
827         src/shared/logs-show.c \
828         src/shared/logs-show.h
829
830 # ------------------------------------------------------------------------------
831 noinst_LTLIBRARIES += \
832         libsystemd-capability.la
833
834 libsystemd_capability_la_SOURCES = \
835         src/shared/capability.c \
836         src/shared/capability.h
837
838 libsystemd_capability_la_CFLAGS = \
839         $(AM_CFLAGS) \
840         $(CAP_CFLAGS)
841
842 libsystemd_capability_la_LIBADD = \
843         $(CAP_LIBS)
844
845 # ------------------------------------------------------------------------------
846 noinst_LTLIBRARIES += \
847         libsystemd-audit.la
848
849 libsystemd_audit_la_SOURCES = \
850         src/shared/audit.c \
851         src/shared/audit.h
852
853 # ------------------------------------------------------------------------------
854 if HAVE_ACL
855 noinst_LTLIBRARIES += \
856         libsystemd-acl.la
857
858 libsystemd_acl_la_SOURCES = \
859         src/shared/acl-util.c \
860         src/shared/acl-util.h
861
862 libsystemd_acl_la_CFLAGS = \
863         $(AM_CFLAGS) \
864         $(ACL_CFLAGS)
865
866 libsystemd_acl_la_LIBADD = \
867         $(ACL_LIBS)
868 endif
869
870 # ------------------------------------------------------------------------------
871 noinst_LTLIBRARIES += \
872         libsystemd-core.la
873
874 libsystemd_core_la_SOURCES = \
875         src/core/unit.c \
876         src/core/unit.h \
877         src/core/unit-printf.c \
878         src/core/unit-printf.h \
879         src/core/job.c \
880         src/core/job.h \
881         src/core/manager.c \
882         src/core/manager.h \
883         src/core/transaction.c \
884         src/core/transaction.h \
885         src/core/load-fragment.c \
886         src/core/load-fragment.h \
887         src/core/service.c \
888         src/core/service.h \
889         src/core/automount.c \
890         src/core/automount.h \
891         src/core/mount.c \
892         src/core/mount.h \
893         src/core/swap.c \
894         src/core/swap.h \
895         src/core/device.c \
896         src/core/device.h \
897         src/core/target.c \
898         src/core/target.h \
899         src/core/snapshot.c \
900         src/core/snapshot.h \
901         src/core/socket.c \
902         src/core/socket.h \
903         src/core/timer.c \
904         src/core/timer.h \
905         src/core/path.c \
906         src/core/path.h \
907         src/core/slice.c \
908         src/core/slice.h \
909         src/core/scope.c \
910         src/core/scope.h \
911         src/core/load-dropin.c \
912         src/core/load-dropin.h \
913         src/core/execute.c \
914         src/core/execute.h \
915         src/core/kill.c \
916         src/core/kill.h \
917         src/core/dbus.c \
918         src/core/dbus.h \
919         src/core/dbus-manager.c \
920         src/core/dbus-manager.h \
921         src/core/dbus-unit.c \
922         src/core/dbus-unit.h \
923         src/core/dbus-job.c \
924         src/core/dbus-job.h \
925         src/core/dbus-service.c \
926         src/core/dbus-service.h \
927         src/core/dbus-socket.c \
928         src/core/dbus-socket.h \
929         src/core/dbus-timer.c \
930         src/core/dbus-timer.h \
931         src/core/dbus-target.c \
932         src/core/dbus-target.h \
933         src/core/dbus-mount.c \
934         src/core/dbus-mount.h \
935         src/core/dbus-automount.c \
936         src/core/dbus-automount.h \
937         src/core/dbus-swap.c \
938         src/core/dbus-swap.h \
939         src/core/dbus-snapshot.c \
940         src/core/dbus-snapshot.h \
941         src/core/dbus-device.c \
942         src/core/dbus-device.h \
943         src/core/dbus-path.c \
944         src/core/dbus-path.h \
945         src/core/dbus-slice.c \
946         src/core/dbus-slice.h \
947         src/core/dbus-scope.c \
948         src/core/dbus-scope.h \
949         src/core/dbus-execute.c \
950         src/core/dbus-execute.h \
951         src/core/dbus-kill.c \
952         src/core/dbus-kill.h \
953         src/core/dbus-cgroup.c \
954         src/core/dbus-cgroup.h \
955         src/core/dbus-client-track.c \
956         src/core/dbus-client-track.h \
957         src/core/cgroup.c \
958         src/core/cgroup.h \
959         src/core/selinux-access.c \
960         src/core/selinux-access.h \
961         src/core/selinux-setup.c \
962         src/core/selinux-setup.h \
963         src/core/smack-setup.c \
964         src/core/smack-setup.h \
965         src/core/ima-setup.c \
966         src/core/ima-setup.h \
967         src/core/locale-setup.h \
968         src/core/locale-setup.c \
969         src/core/hostname-setup.c \
970         src/core/hostname-setup.h \
971         src/core/machine-id-setup.c \
972         src/core/machine-id-setup.h \
973         src/core/mount-setup.c \
974         src/core/mount-setup.h \
975         src/core/loopback-setup.h \
976         src/core/loopback-setup.c \
977         src/core/condition.c \
978         src/core/condition.h \
979         src/core/namespace.c \
980         src/core/namespace.h \
981         src/core/tcpwrap.c \
982         src/core/tcpwrap.h \
983         src/core/build.h \
984         src/core/sysfs-show.h \
985         src/core/switch-root.h \
986         src/core/switch-root.c \
987         src/core/killall.h \
988         src/core/killall.c \
989         src/core/audit-fd.c \
990         src/core/audit-fd.h \
991         src/core/async.c \
992         src/core/async.h
993
994 if HAVE_KMOD
995 libsystemd_core_la_SOURCES += \
996         src/core/kmod-setup.c \
997         src/core/kmod-setup.h
998 endif
999
1000 nodist_libsystemd_core_la_SOURCES = \
1001         src/core/load-fragment-gperf.c \
1002         src/core/load-fragment-gperf-nulstr.c
1003
1004 libsystemd_core_la_CFLAGS = \
1005         $(AM_CFLAGS) \
1006         $(LIBWRAP_CFLAGS) \
1007         $(PAM_CFLAGS) \
1008         $(AUDIT_CFLAGS) \
1009         $(KMOD_CFLAGS) \
1010         -pthread
1011
1012 libsystemd_core_la_LIBADD = \
1013         libsystemd-capability.la \
1014         libsystemd-units.la \
1015         libsystemd-label.la \
1016         libsystemd-audit.la \
1017         libsystemd-id128-internal.la \
1018         libsystemd-daemon-internal.la \
1019         libudev-internal.la \
1020         libsystemd-shared.la \
1021         libsystemd-rtnl.la \
1022         libsystemd-bus-internal.la \
1023         $(LIBWRAP_LIBS) \
1024         $(PAM_LIBS) \
1025         $(AUDIT_LIBS) \
1026         $(CAP_LIBS) \
1027         $(KMOD_LIBS)
1028
1029 src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
1030         $(AM_V_at)$(MKDIR_P) $(dir $@)
1031         $(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 ";" }' < $< > $@
1032
1033 EXTRA_DIST += \
1034         src/core/load-fragment-gperf.gperf.m4
1035
1036 CLEANFILES += \
1037         src/core/load-fragment-gperf.gperf \
1038         src/core/load-fragment-gperf.c \
1039         src/core/load-fragment-gperf-nulstr.c \
1040         src/shared/syscall-list.txt \
1041         src/shared/syscall-from-name.gperf \
1042         src/shared/errno-list.txt \
1043         src/shared/errno-from-name.gperf
1044
1045 BUILT_SOURCES += \
1046         src/shared/syscall-from-name.h \
1047         src/shared/syscall-to-name.h \
1048         src/shared/errno-from-name.h \
1049         src/shared/errno-to-name.h
1050
1051 src/shared/syscall-list.txt: Makefile
1052         $(AM_V_at)$(MKDIR_P) $(dir $@)
1053         $(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; }' > $@
1054
1055 src/shared/syscall-from-name.gperf: src/shared/syscall-list.txt Makefile
1056         $(AM_V_at)$(MKDIR_P) $(dir $@)
1057         $(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 }' < $< > $@
1058
1059 src/shared/syscall-from-name.h: src/shared/syscall-from-name.gperf Makefile
1060         $(AM_V_at)$(MKDIR_P) $(dir $@)
1061         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_syscall -H hash_syscall_name -p -C < $< > $@
1062
1063 src/shared/syscall-to-name.h: src/shared/syscall-list.txt Makefile
1064         $(AM_V_at)$(MKDIR_P) $(dir $@)
1065         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const syscall_names[] = { "} { printf "[SYSCALL_TO_INDEX(__NR_%s)] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
1066
1067 src/shared/errno-list.txt: Makefile
1068         $(AM_V_at)$(MKDIR_P) $(dir $@)
1069         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+[0-9]/ { print $$2; }'  > $@
1070
1071 src/shared/errno-from-name.gperf: src/shared/errno-list.txt Makefile
1072         $(AM_V_at)$(MKDIR_P) $(dir $@)
1073         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct errno_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
1074
1075 src/shared/errno-from-name.h: src/shared/errno-from-name.gperf Makefile
1076         $(AM_V_at)$(MKDIR_P) $(dir $@)
1077         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_errno -H hash_errno_name -p -C < $< > $@
1078
1079 src/shared/errno-to-name.h: src/shared/errno-list.txt Makefile
1080         $(AM_V_at)$(MKDIR_P) $(dir $@)
1081         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
1082
1083 # ------------------------------------------------------------------------------
1084 systemd_SOURCES = \
1085         src/core/main.c
1086
1087 systemd_LDADD = \
1088         libsystemd-core.la \
1089         $(RT_LIBS)
1090
1091 dist_pkgsysconf_DATA += \
1092         src/core/system.conf \
1093         src/core/user.conf
1094
1095 dist_dbuspolicy_DATA += \
1096         src/core/org.freedesktop.systemd1.conf
1097
1098 dist_dbussystemservice_DATA += \
1099         src/core/org.freedesktop.systemd1.service
1100
1101 polkitpolicy_in_in_files += \
1102         src/core/org.freedesktop.systemd1.policy.in.in
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-namespace \
1143         test-date \
1144         test-sleep \
1145         test-replace-var \
1146         test-sched-prio \
1147         test-calendarspec \
1148         test-strip-tab-ansi \
1149         test-cgroup-util \
1150         test-cgroup-mask \
1151         test-prioq \
1152         test-fileio \
1153         test-time \
1154         test-hashmap \
1155         test-list \
1156         test-tables \
1157         test-device-nodes
1158
1159 EXTRA_DIST += \
1160         test/sched_idle_bad.service \
1161         test/sched_idle_ok.service \
1162         test/sched_rr_bad.service \
1163         test/sched_rr_ok.service \
1164         test/sched_rr_change.service \
1165         test/son.service \
1166         test/daughter.service \
1167         test/parent.slice
1168
1169 EXTRA_DIST += \
1170         src/test/test-helper.h
1171
1172 test_device_nodes_SOURCES = \
1173         src/test/test-device-nodes.c
1174
1175 test_device_nodes_LDADD = \
1176         libsystemd-shared.la
1177
1178 test_engine_SOURCES = \
1179         src/test/test-engine.c
1180
1181 test_engine_LDADD = \
1182         libsystemd-core.la \
1183         $(RT_LIBS)
1184
1185 test_job_type_SOURCES = \
1186         src/test/test-job-type.c
1187
1188 test_job_type_LDADD = \
1189         libsystemd-core.la \
1190         $(RT_LIBS)
1191
1192 test_ns_SOURCES = \
1193         src/test/test-ns.c
1194
1195 test_ns_LDADD = \
1196         libsystemd-core.la
1197
1198 test_loopback_SOURCES = \
1199         src/test/test-loopback.c
1200
1201 test_loopback_LDADD = \
1202         libsystemd-core.la
1203
1204 test_hostname_SOURCES = \
1205         src/test/test-hostname.c
1206
1207 test_hostname_LDADD = \
1208         libsystemd-core.la
1209
1210 if ENABLE_EFI
1211 manual_tests += \
1212         test-boot-timestamp
1213
1214 test_boot_timestamp_SOURCES = \
1215         src/test/test-boot-timestamps.c
1216
1217 test_boot_timestamp_LDADD = \
1218         libsystemd-shared.la
1219 endif
1220
1221 test_unit_name_SOURCES = \
1222         src/test/test-unit-name.c
1223
1224 test_unit_name_LDADD = \
1225         libsystemd-core.la \
1226         $(RT_LIBS)
1227
1228 test_unit_file_SOURCES = \
1229         src/test/test-unit-file.c
1230
1231 test_unit_file_LDADD = \
1232         libsystemd-core.la \
1233         $(RT_LIBS)
1234
1235 test_utf8_SOURCES = \
1236         src/test/test-utf8.c
1237
1238 test_utf8_LDADD = \
1239         libsystemd-shared.la
1240
1241 test_util_SOURCES = \
1242         src/test/test-util.c
1243
1244 test_util_LDADD = \
1245         libsystemd-core.la
1246
1247 test_namespace_SOURCES = \
1248         src/test/test-namespace.c
1249
1250 test_namespace_LDADD = \
1251         libsystemd-core.la
1252
1253 test_hashmap_SOURCES = \
1254         src/test/test-hashmap.c
1255
1256 test_hashmap_LDADD = \
1257         libsystemd-core.la
1258
1259 test_list_SOURCES = \
1260         src/test/test-list.c
1261
1262 test_list_LDADD = \
1263         libsystemd-core.la
1264
1265 test_tables_SOURCES = \
1266         src/test/test-tables.c \
1267         src/shared/test-tables.h
1268
1269 test_tables_LDADD = \
1270         libsystemd-logs.la \
1271         libsystemd-journal-internal.la \
1272         libsystemd-core.la \
1273         $(RT_LIBS)
1274
1275 test_prioq_SOURCES = \
1276         src/test/test-prioq.c
1277
1278 test_prioq_LDADD = \
1279         libsystemd-core.la
1280
1281 test_fileio_SOURCES = \
1282         src/test/test-fileio.c
1283
1284 test_fileio_LDADD = \
1285         libsystemd-core.la
1286
1287 test_time_SOURCES = \
1288         src/test/test-time.c
1289
1290 test_time_LDADD = \
1291         libsystemd-core.la
1292
1293 test_log_SOURCES = \
1294         src/test/test-log.c
1295
1296 test_log_LDADD = \
1297         libsystemd-core.la
1298
1299 test_ellipsize_SOURCES = \
1300         src/test/test-ellipsize.c
1301
1302 test_ellipsize_LDADD = \
1303         libsystemd-core.la
1304
1305 test_date_SOURCES = \
1306         src/test/test-date.c
1307
1308 test_date_LDADD = \
1309         libsystemd-core.la
1310
1311 test_sleep_SOURCES = \
1312         src/test/test-sleep.c
1313
1314 test_sleep_LDADD = \
1315         libsystemd-core.la
1316
1317 test_replace_var_SOURCES = \
1318         src/test/test-replace-var.c
1319
1320 test_replace_var_LDADD = \
1321         libsystemd-shared.la
1322
1323 test_calendarspec_SOURCES = \
1324         src/test/test-calendarspec.c
1325
1326 test_calendarspec_LDADD = \
1327         libsystemd-shared.la
1328
1329 test_strip_tab_ansi_SOURCES = \
1330         src/test/test-strip-tab-ansi.c
1331
1332 test_strip_tab_ansi_LDADD = \
1333         libsystemd-shared.la
1334
1335 test_daemon_SOURCES = \
1336         src/test/test-daemon.c
1337
1338 test_daemon_LDADD = \
1339         libsystemd-daemon-internal.la \
1340         libsystemd-shared.la
1341
1342 test_cgroup_SOURCES = \
1343         src/test/test-cgroup.c
1344
1345 test_cgroup_LDADD = \
1346         libsystemd-label.la \
1347         libsystemd-shared.la
1348
1349 test_cgroup_mask_SOURCES = \
1350         src/test/test-cgroup-mask.c
1351
1352 test_cgroup_mask_CFLAGS = \
1353         $(AM_CFLAGS) \
1354         $(DBUS_CFLAGS) \
1355         -D"STR(s)=\#s" -D"TEST_DIR=STR($(abs_top_srcdir)/test/)"
1356
1357 test_cgroup_mask_LDADD = \
1358         libsystemd-core.la \
1359         $(RT_LIBS)
1360
1361 test_cgroup_util_SOURCES = \
1362         src/test/test-cgroup-util.c
1363
1364 test_cgroup_util_LDADD = \
1365         libsystemd-label.la \
1366         libsystemd-daemon-internal.la \
1367         libsystemd-shared.la
1368
1369 test_env_replace_SOURCES = \
1370         src/test/test-env-replace.c
1371
1372 test_env_replace_LDADD = \
1373         libsystemd-shared.la
1374
1375 test_strbuf_SOURCES = \
1376         src/test/test-strbuf.c
1377
1378 test_strbuf_LDADD = \
1379         libsystemd-shared.la
1380
1381 test_strv_SOURCES = \
1382         src/test/test-strv.c
1383
1384 test_strv_LDADD = \
1385         libsystemd-units.la \
1386         libsystemd-id128-internal.la \
1387         libsystemd-shared.la
1388
1389 test_path_util_SOURCES = \
1390         src/test/test-path-util.c
1391
1392 test_path_util_LDADD = \
1393         libsystemd-shared.la
1394
1395 test_strxcpyx_SOURCES = \
1396         src/test/test-strxcpyx.c
1397
1398 test_strxcpyx_LDADD = \
1399         libsystemd-shared.la
1400
1401 test_install_SOURCES = \
1402         src/test/test-install.c
1403
1404 test_install_LDADD = \
1405         libsystemd-units.la \
1406         libsystemd-label.la \
1407         libsystemd-id128-internal.la \
1408         libsystemd-shared.la
1409
1410 test_watchdog_SOURCES = \
1411         src/test/test-watchdog.c
1412
1413 test_watchdog_LDADD = \
1414         libsystemd-shared.la
1415
1416 test_sched_prio_SOURCES = \
1417         src/test/test-sched-prio.c
1418
1419 test_sched_prio_CFLAGS = \
1420         $(AM_CFLAGS) \
1421         -D"STR(s)=\#s" -D"TEST_DIR=STR($(abs_top_srcdir)/test/)"
1422
1423 test_sched_prio_LDADD = \
1424         libsystemd-core.la \
1425         $(RT_LIBS)
1426
1427 # ------------------------------------------------------------------------------
1428 ## .PHONY so it always rebuilds it
1429 .PHONY: coverage lcov-run lcov-report
1430
1431 # run lcov from scratch, always
1432 coverage:
1433         $(MAKE) lcov-run
1434         $(MAKE) lcov-report
1435
1436 coverage_dir = coverage
1437 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
1438
1439 if ENABLE_COVERAGE
1440 # reset run coverage tests
1441 lcov-run:
1442         @rm -rf $(coverage_dir)
1443         lcov $(coverage_opts) --zerocounters
1444         -$(MAKE) check
1445
1446 # generate report based on current coverage data
1447 lcov-report:
1448         $(MKDIR_P) $(coverage_dir)
1449         lcov $(coverage_opts) --compat-libtool --capture --no-external \
1450                 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
1451         genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov.info
1452         @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
1453
1454 # lcov doesn't work properly with vpath builds, make sure that bad
1455 # output is not uploaded by mistake.
1456 coverage-sync: coverage
1457         test "$(builddir)" = "$(srcdir)"
1458         rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
1459
1460 else
1461 lcov-run lcov-report:
1462         echo "Need to reconfigure with --enable-coverage"
1463 endif
1464
1465 # ------------------------------------------------------------------------------
1466 systemd_analyze_SOURCES = \
1467         src/analyze/analyze.c
1468
1469 systemd_analyze_LDADD = \
1470         libsystemd-bus-internal.la \
1471         libsystemd-id128-internal.la \
1472         libsystemd-daemon-internal.la \
1473         libsystemd-shared.la
1474
1475 # ------------------------------------------------------------------------------
1476 systemd_initctl_SOURCES = \
1477         src/initctl/initctl.c
1478
1479 systemd_initctl_LDADD = \
1480         libsystemd-bus-internal.la \
1481         libsystemd-id128-internal.la \
1482         libsystemd-daemon-internal.la \
1483         libsystemd-shared.la
1484
1485 # ------------------------------------------------------------------------------
1486 systemd_update_utmp_SOURCES = \
1487         src/update-utmp/update-utmp.c
1488
1489 systemd_update_utmp_CFLAGS = \
1490         $(AM_CFLAGS) \
1491         $(AUDIT_CFLAGS)
1492
1493 systemd_update_utmp_LDADD = \
1494         libsystemd-bus-internal.la \
1495         libsystemd-id128-internal.la \
1496         libsystemd-daemon-internal.la \
1497         libsystemd-shared.la \
1498         $(AUDIT_LIBS)
1499
1500 # ------------------------------------------------------------------------------
1501 systemd_shutdownd_SOURCES = \
1502         src/shutdownd/shutdownd.c
1503
1504 systemd_shutdownd_LDADD = \
1505         libsystemd-label.la \
1506         libsystemd-daemon-internal.la \
1507         libsystemd-shared.la
1508
1509 dist_doc_DATA += \
1510         src/systemd/sd-shutdown.h
1511
1512 # ------------------------------------------------------------------------------
1513 systemd_shutdown_SOURCES = \
1514         src/core/umount.c \
1515         src/core/umount.h \
1516         src/core/shutdown.c \
1517         src/core/mount-setup.c \
1518         src/core/mount-setup.h \
1519         src/core/killall.h \
1520         src/core/killall.c
1521
1522 systemd_shutdown_LDADD = \
1523         libsystemd-label.la \
1524         libudev-internal.la \
1525         libsystemd-shared.la
1526
1527 # ------------------------------------------------------------------------------
1528 if HAVE_KMOD
1529 systemd_modules_load_SOURCES = \
1530         src/modules-load/modules-load.c
1531
1532 systemd_modules_load_CFLAGS = \
1533         $(AM_CFLAGS) \
1534         $(KMOD_CFLAGS)
1535
1536 systemd_modules_load_LDADD = \
1537         libsystemd-shared.la \
1538         $(KMOD_LIBS)
1539
1540 rootlibexec_PROGRAMS += \
1541         systemd-modules-load
1542
1543 nodist_systemunit_DATA += \
1544         units/systemd-modules-load.service
1545
1546 SYSINIT_TARGET_WANTS += \
1547         systemd-modules-load.service
1548
1549 if ENABLE_TMPFILES
1550 nodist_systemunit_DATA += \
1551         units/kmod-static-nodes.service
1552
1553 SYSINIT_TARGET_WANTS += \
1554         kmod-static-nodes.service
1555 endif
1556 endif
1557
1558 EXTRA_DIST += \
1559         units/systemd-modules-load.service.in \
1560         units/kmod-static-nodes.service.in
1561
1562 # ------------------------------------------------------------------------------
1563 if ENABLE_TMPFILES
1564 systemd_tmpfiles_SOURCES = \
1565         src/tmpfiles/tmpfiles.c \
1566         src/shared/specifier.c \
1567         src/shared/specifier.h
1568
1569 systemd_tmpfiles_LDADD = \
1570         libsystemd-label.la \
1571         libsystemd-capability.la \
1572         libsystemd-id128-internal.la \
1573         libsystemd-shared.la
1574
1575 rootbin_PROGRAMS += \
1576         systemd-tmpfiles
1577
1578 dist_systemunit_DATA += \
1579         units/systemd-tmpfiles-clean.timer
1580
1581 nodist_systemunit_DATA += \
1582         units/systemd-tmpfiles-setup-dev.service \
1583         units/systemd-tmpfiles-setup.service \
1584         units/systemd-tmpfiles-clean.service
1585
1586 dist_tmpfiles_DATA = \
1587         tmpfiles.d/systemd.conf \
1588         tmpfiles.d/tmp.conf \
1589         tmpfiles.d/x11.conf
1590
1591 if HAVE_SYSV_COMPAT
1592 dist_tmpfiles_DATA += \
1593         tmpfiles.d/legacy.conf
1594 endif
1595
1596 SYSINIT_TARGET_WANTS += \
1597         systemd-tmpfiles-setup-dev.service \
1598         systemd-tmpfiles-setup.service
1599
1600 dist_zshcompletion_DATA += \
1601         shell-completion/zsh/_systemd-tmpfiles
1602
1603 TIMERS_TARGET_WANTS += \
1604         systemd-tmpfiles-clean.timer
1605
1606 INSTALL_DIRS += \
1607         $(tmpfilesdir) \
1608         $(sysconfdir)/tmpfiles.d
1609 endif
1610
1611 EXTRA_DIST += \
1612         units/systemd-tmpfiles-setup-dev.service.in \
1613         units/systemd-tmpfiles-setup.service.in \
1614         units/systemd-tmpfiles-clean.service.in
1615
1616 # ------------------------------------------------------------------------------
1617 systemd_machine_id_setup_SOURCES = \
1618         src/machine-id-setup/machine-id-setup-main.c \
1619         src/core/machine-id-setup.c \
1620         src/core/machine-id-setup.h
1621
1622 systemd_machine_id_setup_LDADD = \
1623         libsystemd-label.la \
1624         libsystemd-id128-internal.la \
1625         libsystemd-shared.la
1626
1627 # ------------------------------------------------------------------------------
1628 systemd_sysctl_SOURCES = \
1629         src/sysctl/sysctl.c
1630
1631 systemd_sysctl_LDADD = \
1632         libsystemd-shared.la
1633
1634 # ------------------------------------------------------------------------------
1635 systemd_sleep_SOURCES = \
1636         src/sleep/sleep.c
1637
1638 systemd_sleep_LDADD = \
1639         libsystemd-shared.la
1640
1641 # ------------------------------------------------------------------------------
1642 systemd_fsck_SOURCES = \
1643         src/fsck/fsck.c
1644
1645 systemd_fsck_LDADD = \
1646         libsystemd-bus-internal.la \
1647         libsystemd-id128-internal.la \
1648         libsystemd-daemon-internal.la \
1649         libudev-internal.la \
1650         libsystemd-shared.la
1651
1652 # ------------------------------------------------------------------------------
1653 systemd_ac_power_SOURCES = \
1654         src/ac-power/ac-power.c
1655
1656 systemd_ac_power_LDADD = \
1657         libudev-internal.la \
1658         libsystemd-shared.la
1659
1660 # ------------------------------------------------------------------------------
1661 systemd_detect_virt_SOURCES = \
1662         src/detect-virt/detect-virt.c
1663
1664 systemd_detect_virt_LDADD = \
1665         libsystemd-shared.la
1666
1667 systemd-detect-virt-install-hook:
1668         -$(SETCAP) cap_dac_override,cap_sys_ptrace=ep $(DESTDIR)$(bindir)/systemd-detect-virt
1669
1670 INSTALL_EXEC_HOOKS += \
1671         systemd-detect-virt-install-hook
1672
1673 # ------------------------------------------------------------------------------
1674 systemd_delta_SOURCES = \
1675         src/delta/delta.c
1676
1677 systemd_delta_LDADD = \
1678         libsystemd-shared.la
1679
1680 # ------------------------------------------------------------------------------
1681 systemd_getty_generator_SOURCES = \
1682         src/getty-generator/getty-generator.c
1683
1684 systemd_getty_generator_LDADD = \
1685         libsystemd-label.la \
1686         libsystemd-shared.la
1687
1688 # ------------------------------------------------------------------------------
1689 systemd_fstab_generator_SOURCES = \
1690         src/fstab-generator/fstab-generator.c \
1691         src/core/mount-setup.c
1692
1693 systemd_fstab_generator_LDADD = \
1694         libsystemd-label.la \
1695         libsystemd-shared.la
1696
1697 # ------------------------------------------------------------------------------
1698 systemd_system_update_generator_SOURCES = \
1699         src/system-update-generator/system-update-generator.c
1700
1701 systemd_system_update_generator_LDADD = \
1702         libsystemd-label.la \
1703         libsystemd-shared.la
1704
1705 if ENABLE_EFI
1706 # ------------------------------------------------------------------------------
1707 systemgenerator_PROGRAMS +=  \
1708         systemd-efi-boot-generator
1709
1710 systemd_efi_boot_generator_SOURCES = \
1711         src/efi-boot-generator/efi-boot-generator.c
1712
1713 systemd_efi_boot_generator_LDADD = \
1714         libsystemd-label.la \
1715         libsystemd-shared.la
1716
1717 # ------------------------------------------------------------------------------
1718 bootctl_SOURCES = \
1719         src/boot/boot.h \
1720         src/boot/boot-loader.h \
1721         src/boot/bootctl.c \
1722         src/boot/boot-loader.c \
1723         src/boot/boot-efi.c
1724
1725 bootctl_LDADD = \
1726         libsystemd-shared.la \
1727         libsystemd-id128-internal.la \
1728         libsystemd-daemon-internal.la
1729
1730 bin_PROGRAMS += \
1731         bootctl
1732
1733 dist_zshcompletion_DATA += \
1734         shell-completion/zsh/_bootctl
1735
1736 endif
1737
1738 # ------------------------------------------------------------------------------
1739 if HAVE_BLKID
1740 systemgenerator_PROGRAMS +=  \
1741         systemd-gpt-auto-generator
1742
1743 systemd_gpt_auto_generator_SOURCES = \
1744         src/gpt-auto-generator/gpt-auto-generator.c
1745
1746 systemd_gpt_auto_generator_LDADD = \
1747         libsystemd-label.la \
1748         libsystemd-id128-internal.la \
1749         libudev-internal.la \
1750         libsystemd-shared.la \
1751         $(BLKID_LIBS)
1752
1753 systemd_gpt_auto_generator_CFLAGS = \
1754         $(AM_CFLAGS) \
1755         $(BLKID_CFLAGS)
1756 endif
1757
1758 # ------------------------------------------------------------------------------
1759 systemd_rc_local_generator_SOURCES = \
1760         src/rc-local-generator/rc-local-generator.c
1761
1762 systemd_rc_local_generator_LDADD = \
1763         libsystemd-label.la \
1764         libsystemd-shared.la
1765
1766 # ------------------------------------------------------------------------------
1767 systemd_remount_fs_SOURCES = \
1768         src/remount-fs/remount-fs.c \
1769         src/core/mount-setup.c \
1770         src/core/mount-setup.h
1771
1772 systemd_remount_fs_LDADD = \
1773         libsystemd-label.la \
1774         libsystemd-shared.la
1775
1776 # ------------------------------------------------------------------------------
1777 systemd_cgroups_agent_SOURCES = \
1778         src/cgroups-agent/cgroups-agent.c
1779
1780 systemd_cgroups_agent_LDADD = \
1781         libsystemd-bus-internal.la \
1782         libsystemd-id128-internal.la \
1783         libsystemd-daemon-internal.la \
1784         libsystemd-shared.la
1785
1786 # ------------------------------------------------------------------------------
1787 systemctl_SOURCES = \
1788         src/systemctl/systemctl.c
1789
1790 systemctl_LDADD = \
1791         libsystemd-units.la \
1792         libsystemd-label.la \
1793         libsystemd-bus-internal.la \
1794         libsystemd-logs.la \
1795         libsystemd-login-internal.la \
1796         libsystemd-journal-internal.la \
1797         libsystemd-id128-internal.la \
1798         libsystemd-daemon-internal.la \
1799         libsystemd-shared.la
1800
1801 # ------------------------------------------------------------------------------
1802 systemd_notify_SOURCES = \
1803         src/notify/notify.c \
1804         src/readahead/sd-readahead.c
1805
1806 systemd_notify_LDADD = \
1807         libsystemd-daemon-internal.la \
1808         libsystemd-shared.la
1809
1810 # ------------------------------------------------------------------------------
1811 systemd_ask_password_SOURCES = \
1812         src/ask-password/ask-password.c
1813
1814 systemd_ask_password_LDADD = \
1815         libsystemd-label.la \
1816         libsystemd-shared.la
1817
1818 # ------------------------------------------------------------------------------
1819 systemd_reply_password_SOURCES = \
1820         src/reply-password/reply-password.c
1821
1822 systemd_reply_password_LDADD = \
1823         libsystemd-shared.la
1824
1825 # ------------------------------------------------------------------------------
1826 systemd_cgls_SOURCES = \
1827         src/cgls/cgls.c
1828
1829 systemd_cgls_LDADD = \
1830         libsystemd-shared.la
1831
1832 # ------------------------------------------------------------------------------
1833 systemd_cgtop_SOURCES = \
1834         src/cgtop/cgtop.c
1835
1836 systemd_cgtop_LDADD = \
1837         libsystemd-shared.la
1838
1839 # ------------------------------------------------------------------------------
1840 systemd_nspawn_SOURCES = \
1841         src/nspawn/nspawn.c \
1842         src/core/mount-setup.c \
1843         src/core/mount-setup.h \
1844         src/core/loopback-setup.c \
1845         src/core/loopback-setup.h
1846
1847 systemd_nspawn_LDADD = \
1848         libsystemd-label.la \
1849         libsystemd-capability.la \
1850         libsystemd-bus-internal.la \
1851         libsystemd-id128-internal.la \
1852         libsystemd-daemon-internal.la \
1853         libsystemd-shared.la \
1854         libsystemd-rtnl.la
1855
1856 # ------------------------------------------------------------------------------
1857 systemd_run_SOURCES = \
1858         src/run/run.c
1859
1860 systemd_run_LDADD = \
1861         libsystemd-label.la \
1862         libsystemd-capability.la \
1863         libsystemd-bus-internal.la \
1864         libsystemd-daemon-internal.la \
1865         libsystemd-id128-internal.la \
1866         libsystemd-shared.la
1867
1868 # ------------------------------------------------------------------------------
1869 systemd_stdio_bridge_SOURCES = \
1870         src/stdio-bridge/stdio-bridge.c
1871
1872 systemd_stdio_bridge_LDADD = \
1873         libsystemd-bus-internal.la \
1874         libsystemd-daemon-internal.la \
1875         libsystemd-id128-internal.la \
1876         libsystemd-shared.la
1877
1878 # ------------------------------------------------------------------------------
1879 systemd_tty_ask_password_agent_SOURCES = \
1880         src/tty-ask-password-agent/tty-ask-password-agent.c
1881
1882 systemd_tty_ask_password_agent_LDADD = \
1883         libsystemd-label.la \
1884         libsystemd-shared.la
1885
1886 # ------------------------------------------------------------------------------
1887 libsystemd_daemon_la_SOURCES = \
1888         src/libsystemd-daemon/libsystemd-daemon.sym \
1889         src/libsystemd-daemon/sd-daemon.c
1890
1891 libsystemd_daemon_internal_la_SOURCES = \
1892         $(libsystemd_daemon_la_SOURCES)
1893
1894 libsystemd_daemon_internal_la_CPPFLAGS = \
1895         $(AM_CPPFLAGS) \
1896         -DSD_DAEMON_DISABLE_MQ
1897
1898 libsystemd_daemon_la_CFLAGS = \
1899         $(AM_CFLAGS) \
1900         -fvisibility=hidden \
1901         -DSD_EXPORT_SYMBOLS
1902
1903 libsystemd_daemon_la_LDFLAGS = \
1904         $(AM_LDFLAGS) \
1905         -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
1906         -Wl,--version-script=$(top_srcdir)/src/libsystemd-daemon/libsystemd-daemon.sym
1907
1908 libsystemd_daemon_la_LIBADD =  \
1909         $(RT_LIBS)
1910
1911 pkginclude_HEADERS += \
1912         src/systemd/sd-daemon.h
1913
1914 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
1915 libsystemd-daemon-install-hook:
1916         libname=libsystemd-daemon.so && $(move-to-rootlibdir)
1917
1918 libsystemd-daemon-uninstall-hook:
1919         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so*
1920
1921 INSTALL_EXEC_HOOKS += libsystemd-daemon-install-hook
1922 UNINSTALL_EXEC_HOOKS += libsystemd-daemon-uninstall-hook
1923
1924 lib_LTLIBRARIES += \
1925         libsystemd-daemon.la
1926
1927 noinst_LTLIBRARIES += \
1928         libsystemd-daemon-internal.la
1929
1930 pkgconfiglib_DATA += \
1931         src/libsystemd-daemon/libsystemd-daemon.pc
1932
1933 EXTRA_DIST += \
1934         src/libsystemd-daemon/libsystemd-daemon.pc.in
1935
1936 # ------------------------------------------------------------------------------
1937 libsystemd_bus_la_SOURCES = \
1938         src/libsystemd-bus/libsystemd-bus.sym \
1939         src/systemd/sd-bus.h \
1940         src/systemd/sd-bus-protocol.h \
1941         src/systemd/sd-bus-vtable.h \
1942         src/systemd/sd-memfd.h \
1943         src/systemd/sd-utf8.h \
1944         src/systemd/sd-event.h \
1945         src/libsystemd-bus/sd-bus.c \
1946         src/libsystemd-bus/bus-control.c \
1947         src/libsystemd-bus/bus-control.h \
1948         src/libsystemd-bus/bus-error.c \
1949         src/libsystemd-bus/bus-error.h \
1950         src/libsystemd-bus/bus-internal.c \
1951         src/libsystemd-bus/bus-internal.h \
1952         src/libsystemd-bus/bus-socket.c \
1953         src/libsystemd-bus/bus-socket.h \
1954         src/libsystemd-bus/bus-kernel.c \
1955         src/libsystemd-bus/bus-kernel.h \
1956         src/libsystemd-bus/bus-container.c \
1957         src/libsystemd-bus/bus-container.h \
1958         src/libsystemd-bus/bus-message.c \
1959         src/libsystemd-bus/bus-message.h \
1960         src/libsystemd-bus/bus-signature.c \
1961         src/libsystemd-bus/bus-signature.h \
1962         src/libsystemd-bus/bus-type.c \
1963         src/libsystemd-bus/bus-type.h \
1964         src/libsystemd-bus/bus-match.c \
1965         src/libsystemd-bus/bus-match.h \
1966         src/libsystemd-bus/bus-bloom.c \
1967         src/libsystemd-bus/bus-bloom.h \
1968         src/libsystemd-bus/bus-introspect.c \
1969         src/libsystemd-bus/bus-introspect.h \
1970         src/libsystemd-bus/bus-objects.c \
1971         src/libsystemd-bus/bus-objects.h \
1972         src/libsystemd-bus/bus-convenience.c \
1973         src/libsystemd-bus/kdbus.h \
1974         src/libsystemd-bus/sd-memfd.c \
1975         src/libsystemd-bus/bus-util.c \
1976         src/libsystemd-bus/bus-util.h \
1977         src/libsystemd-bus/sd-utf8.c \
1978         src/libsystemd-bus/sd-event.c \
1979         src/libsystemd-bus/event-util.h
1980
1981 libsystemd_bus_la_LIBADD = \
1982         libsystemd-id128-internal.la \
1983         libsystemd-daemon-internal.la \
1984         libsystemd-shared.la
1985
1986 libsystemd_bus_la_CFLAGS = \
1987         $(AM_CFLAGS) \
1988         -pthread
1989
1990 libsystemd_bus_la_LDFLAGS = \
1991         $(AM_LDFLAGS) \
1992         -version-info $(LIBSYSTEMD_BUS_CURRENT):$(LIBSYSTEMD_BUS_REVISION):$(LIBSYSTEMD_BUS_AGE) \
1993         -Wl,--version-script=$(top_srcdir)/src/libsystemd-bus/libsystemd-bus.sym
1994
1995 pkgconfiglib_DATA += \
1996         src/libsystemd-bus/libsystemd-bus.pc
1997
1998 EXTRA_DIST += \
1999         src/libsystemd-bus/libsystemd-bus.pc.in
2000
2001 lib_LTLIBRARIES += \
2002         libsystemd-bus.la
2003
2004 libsystemd_bus_internal_la_SOURCES = \
2005         $(libsystemd_bus_la_SOURCES)
2006
2007 libsystemd_bus_internal_la_CFLAGS = \
2008         $(libsystemd_bus_la_CFLAGS)
2009
2010 noinst_LTLIBRARIES += \
2011         libsystemd-bus-internal.la
2012
2013 libsystemd_bus_dump_la_SOURCES = \
2014         src/libsystemd-bus/bus-dump.c \
2015         src/libsystemd-bus/bus-dump.h
2016
2017 libsystemd_bus_dump_la_CFLAGS = \
2018         $(AM_CFLAGS)
2019         $(CAP_CFLAGS)
2020
2021 noinst_LTLIBRARIES += \
2022         libsystemd-bus-dump.la
2023
2024 tests += \
2025         test-bus-marshal \
2026         test-bus-signature \
2027         test-bus-chat \
2028         test-bus-server \
2029         test-bus-match \
2030         test-bus-kernel \
2031         test-bus-kernel-bloom \
2032         test-bus-kernel-benchmark \
2033         test-bus-memfd \
2034         test-bus-zero-copy \
2035         test-bus-introspect \
2036         test-bus-objects \
2037         test-bus-error \
2038         test-event
2039
2040 bin_PROGRAMS += \
2041         busctl
2042
2043 test_bus_marshal_SOURCES = \
2044         src/libsystemd-bus/test-bus-marshal.c
2045
2046 test_bus_marshal_LDADD = \
2047         libsystemd-bus-internal.la \
2048         libsystemd-id128-internal.la \
2049         libsystemd-daemon-internal.la \
2050         libsystemd-shared.la \
2051         libsystemd-bus-dump.la \
2052         libsystemd-capability.la \
2053         $(GLIB_LIBS) \
2054         $(DBUS_LIBS) \
2055         $(CAP_LIBS)
2056
2057 test_bus_marshal_CFLAGS = \
2058         $(AM_CFLAGS) \
2059         $(GLIB_CFLAGS) \
2060         $(DBUS_CFLAGS) \
2061         $(CAP_CFLAGS)
2062
2063 test_bus_signature_SOURCES = \
2064         src/libsystemd-bus/test-bus-signature.c
2065
2066 test_bus_signature_LDADD = \
2067         libsystemd-shared.la \
2068         libsystemd-bus-internal.la
2069
2070 test_bus_chat_SOURCES = \
2071         src/libsystemd-bus/test-bus-chat.c
2072
2073 test_bus_chat_CFLAGS = \
2074         $(AM_CFLAGS) \
2075         -pthread
2076
2077 test_bus_chat_LDADD = \
2078         libsystemd-bus-internal.la \
2079         libsystemd-id128-internal.la \
2080         libsystemd-daemon-internal.la \
2081         libsystemd-shared.la
2082
2083 test_bus_server_SOURCES = \
2084         src/libsystemd-bus/test-bus-server.c
2085
2086 test_bus_server_CFLAGS = \
2087         $(AM_CFLAGS) \
2088         -pthread
2089
2090 test_bus_server_LDADD = \
2091         libsystemd-bus-internal.la \
2092         libsystemd-id128-internal.la \
2093         libsystemd-daemon-internal.la \
2094         libsystemd-shared.la
2095
2096 test_bus_objects_SOURCES = \
2097         src/libsystemd-bus/test-bus-objects.c
2098
2099 test_bus_objects_CFLAGS = \
2100         $(AM_CFLAGS) \
2101         $(CAP_CFLAGS) \
2102         -pthread
2103
2104 test_bus_objects_LDADD = \
2105         libsystemd-bus-internal.la \
2106         libsystemd-id128-internal.la \
2107         libsystemd-daemon-internal.la \
2108         libsystemd-shared.la \
2109         libsystemd-bus-dump.la \
2110         libsystemd-capability.la \
2111         $(CAP_LIBS)
2112
2113 test_bus_error_SOURCES = \
2114         src/libsystemd-bus/test-bus-error.c
2115
2116 test_bus_error_LDADD = \
2117         libsystemd-bus-internal.la \
2118         libsystemd-id128-internal.la \
2119         libsystemd-daemon-internal.la \
2120         libsystemd-shared.la
2121
2122 test_bus_match_SOURCES = \
2123         src/libsystemd-bus/test-bus-match.c
2124
2125 test_bus_match_LDADD = \
2126         libsystemd-bus-internal.la \
2127         libsystemd-id128-internal.la \
2128         libsystemd-daemon-internal.la \
2129         libsystemd-shared.la
2130
2131 test_bus_kernel_SOURCES = \
2132         src/libsystemd-bus/test-bus-kernel.c
2133
2134 test_bus_kernel_LDADD = \
2135         libsystemd-bus-internal.la \
2136         libsystemd-id128-internal.la \
2137         libsystemd-daemon-internal.la \
2138         libsystemd-shared.la \
2139         libsystemd-bus-dump.la \
2140         libsystemd-capability.la \
2141         $(CAP_LIBS)
2142
2143 test_bus_kernel_CFLAGS = \
2144         $(AM_CFLAGS) \
2145         $(CAP_CFLAGS)
2146
2147 test_bus_kernel_bloom_SOURCES = \
2148         src/libsystemd-bus/test-bus-kernel-bloom.c
2149
2150 test_bus_kernel_bloom_LDADD = \
2151         libsystemd-bus-internal.la \
2152         libsystemd-id128-internal.la \
2153         libsystemd-daemon-internal.la \
2154         libsystemd-shared.la
2155
2156 test_bus_kernel_benchmark_SOURCES = \
2157         src/libsystemd-bus/test-bus-kernel-benchmark.c
2158
2159 test_bus_kernel_benchmark_LDADD = \
2160         libsystemd-bus-internal.la \
2161         libsystemd-id128-internal.la \
2162         libsystemd-daemon-internal.la \
2163         libsystemd-shared.la
2164
2165 test_bus_memfd_SOURCES = \
2166         src/libsystemd-bus/test-bus-memfd.c
2167
2168 test_bus_memfd_LDADD = \
2169         libsystemd-bus-internal.la \
2170         libsystemd-shared.la
2171
2172 test_bus_zero_copy_SOURCES = \
2173         src/libsystemd-bus/test-bus-zero-copy.c
2174
2175 test_bus_zero_copy_LDADD = \
2176         libsystemd-bus-internal.la \
2177         libsystemd-id128-internal.la \
2178         libsystemd-daemon-internal.la \
2179         libsystemd-shared.la \
2180         libsystemd-bus-dump.la \
2181         libsystemd-capability.la \
2182         $(CAP_LIBS)
2183
2184 test_bus_zero_copy_CFLAGS = \
2185         $(AM_CFLAGS) \
2186         $(CAP_CFLAGS)
2187
2188 test_bus_introspect_SOURCES = \
2189         src/libsystemd-bus/test-bus-introspect.c
2190
2191 test_bus_introspect_LDADD = \
2192         libsystemd-shared.la \
2193         libsystemd-bus-internal.la
2194
2195 test_event_SOURCES = \
2196         src/libsystemd-bus/test-event.c
2197
2198 test_event_LDADD = \
2199         libsystemd-bus-internal.la \
2200         libsystemd-id128-internal.la \
2201         libsystemd-daemon-internal.la \
2202         libsystemd-shared.la
2203
2204 busctl_SOURCES = \
2205         src/libsystemd-bus/busctl.c
2206
2207 busctl_LDADD = \
2208         libsystemd-bus-internal.la \
2209         libsystemd-id128-internal.la \
2210         libsystemd-daemon-internal.la \
2211         libsystemd-shared.la \
2212         libsystemd-bus-dump.la \
2213         libsystemd-capability.la \
2214         $(CAP_LIBS)
2215
2216 busctl_CFLAGS = \
2217         $(AM_CFLAGS) \
2218         $(CAP_CFLAGS)
2219
2220 # ------------------------------------------------------------------------------
2221 if ENABLE_GTK_DOC
2222 SUBDIRS += \
2223         docs/libudev
2224
2225 noinst_DATA += \
2226         docs/html/libudev \
2227         docs/html/gudev
2228 endif
2229
2230 include_HEADERS += \
2231         src/libudev/libudev.h
2232
2233 lib_LTLIBRARIES += \
2234         libudev.la
2235
2236 libudev_la_SOURCES =\
2237         src/libudev/libudev.sym \
2238         src/libudev/libudev-private.h \
2239         src/libudev/libudev.c \
2240         src/libudev/libudev-list.c \
2241         src/libudev/libudev-util.c \
2242         src/libudev/libudev-device.c \
2243         src/libudev/libudev-enumerate.c \
2244         src/libudev/libudev-monitor.c \
2245         src/libudev/libudev-queue.c \
2246         src/libudev/libudev-hwdb-def.h \
2247         src/libudev/libudev-hwdb.c
2248
2249 libudev_la_CFLAGS = \
2250         $(AM_CFLAGS) \
2251         -fvisibility=hidden
2252
2253 libudev_la_LDFLAGS = \
2254         $(AM_LDFLAGS) \
2255         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
2256         -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
2257
2258 libudev_la_LIBADD = \
2259         libsystemd-daemon-internal.la \
2260         libsystemd-id128-internal.la \
2261         libsystemd-shared.la
2262
2263 pkgconfiglib_DATA += \
2264         src/libudev/libudev.pc
2265
2266 EXTRA_DIST += \
2267         src/libudev/libudev.pc.in
2268
2269 CLEANFILES += \
2270         src/libudev/libudev.pc \
2271         docs/html/libudev \
2272         docs/html/gudev
2273
2274 docs/html/libudev:
2275         $(AM_V_at)$(MKDIR_P) $(dir $@)
2276         $(AM_V_LN)$(LN_S) -f ../libudev/html $@
2277
2278 docs/html/gudev:
2279         $(AM_V_at)$(MKDIR_P) $(dir $@)
2280         $(AM_V_LN)$(LN_S) -f ../gudev/html $@
2281
2282 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2283 libudev-install-hook:
2284         libname=libudev.so && $(move-to-rootlibdir)
2285
2286 libudev-uninstall-hook:
2287         rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
2288
2289 INSTALL_EXEC_HOOKS += libudev-install-hook
2290 UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
2291
2292 # ------------------------------------------------------------------------------
2293 noinst_LTLIBRARIES += \
2294         libudev-internal.la
2295
2296 libudev_internal_la_SOURCES =\
2297         $(libudev_la_SOURCES) \
2298         src/libudev/libudev-device-private.c \
2299         src/libudev/libudev-queue-private.c
2300
2301 libudev_internal_la_CFLAGS = \
2302         $(AM_CFLAGS) \
2303         -fvisibility=default
2304
2305 # ------------------------------------------------------------------------------
2306 INSTALL_DIRS += \
2307         $(sysconfdir)/udev/rules.d \
2308         $(sysconfdir)/udev/hwdb.d
2309
2310 dist_network_DATA = \
2311         network/99-default.link
2312
2313 dist_udevrules_DATA += \
2314         rules/99-systemd.rules \
2315         rules/42-usb-hid-pm.rules \
2316         rules/50-udev-default.rules \
2317         rules/60-drm.rules \
2318         rules/60-keyboard.rules \
2319         rules/60-persistent-storage-tape.rules \
2320         rules/60-persistent-serial.rules \
2321         rules/60-persistent-input.rules \
2322         rules/60-persistent-alsa.rules \
2323         rules/60-persistent-storage.rules \
2324         rules/64-btrfs.rules \
2325         rules/75-net-description.rules \
2326         rules/75-tty-description.rules \
2327         rules/78-sound-card.rules \
2328         rules/80-net-setup-link.rules \
2329         rules/95-udev-late.rules
2330
2331 dist_udevhwdb_DATA = \
2332         hwdb/20-pci-vendor-model.hwdb \
2333         hwdb/20-pci-classes.hwdb \
2334         hwdb/20-usb-vendor-model.hwdb \
2335         hwdb/20-usb-classes.hwdb \
2336         hwdb/20-bluetooth-vendor-product.hwdb \
2337         hwdb/20-acpi-vendor.hwdb \
2338         hwdb/20-OUI.hwdb \
2339         hwdb/60-keyboard.hwdb
2340
2341 udevconfdir = $(sysconfdir)/udev
2342 dist_udevconf_DATA = \
2343         src/udev/udev.conf
2344
2345 sharepkgconfigdir = $(datadir)/pkgconfig
2346 sharepkgconfig_DATA = \
2347         src/udev/udev.pc
2348
2349 EXTRA_DIST += \
2350         rules/99-systemd.rules.in \
2351         src/udev/udev.pc.in
2352
2353 CLEANFILES += \
2354         rules/99-systemd.rules \
2355         src/udev/udev.pc
2356
2357 EXTRA_DIST += \
2358         units/systemd-udevd.service.in \
2359         units/systemd-udev-trigger.service.in \
2360         units/systemd-udev-settle.service.in
2361
2362 CLEANFILES += \
2363         units/systemd-udevd.service \
2364         units/systemd-udev-trigger.service \
2365         units/systemd-udev-settle.service
2366
2367 SOCKETS_TARGET_WANTS += \
2368         systemd-udevd-control.socket \
2369         systemd-udevd-kernel.socket
2370 SYSINIT_TARGET_WANTS += \
2371         systemd-udevd.service \
2372         systemd-udev-trigger.service
2373
2374 rootbin_PROGRAMS += \
2375         udevadm
2376
2377 rootlibexec_PROGRAMS += \
2378         systemd-udevd
2379
2380 noinst_LTLIBRARIES += \
2381         libudev-core.la
2382
2383 src/udev/keyboard-keys.txt: Makefile
2384         $(AM_V_at)$(MKDIR_P) $(dir $@)
2385         $(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/' > $@
2386
2387 src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt Makefile
2388         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
2389
2390 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf Makefile
2391         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
2392
2393 src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt Makefile
2394         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
2395
2396 libudev_core_la_SOURCES = \
2397         src/udev/udev.h \
2398         src/udev/udev-event.c \
2399         src/udev/udev-watch.c \
2400         src/udev/udev-node.c \
2401         src/udev/udev-rules.c \
2402         src/udev/udev-ctrl.c \
2403         src/udev/udev-builtin.c \
2404         src/udev/udev-builtin-btrfs.c \
2405         src/udev/udev-builtin-hwdb.c \
2406         src/udev/udev-builtin-input_id.c \
2407         src/udev/udev-builtin-keyboard.c \
2408         src/udev/udev-builtin-net_id.c \
2409         src/udev/udev-builtin-net_setup_link.c \
2410         src/udev/udev-builtin-path_id.c \
2411         src/udev/udev-builtin-usb_id.c \
2412         src/udev/net/link-config.h \
2413         src/udev/net/link-config.c \
2414         src/udev/net/ethtool-util.h \
2415         src/udev/net/ethtool-util.c
2416
2417 nodist_libudev_core_la_SOURCES = \
2418         src/udev/keyboard-keys-from-name.h \
2419         src/udev/keyboard-keys-to-name.h \
2420         src/udev/net/link-config-gperf.c
2421
2422 BUILT_SOURCES += \
2423         $(nodist_libudev_core_la_SOURCES)
2424
2425 CLEANFILES += \
2426         src/udev/keyboard-keys-from-name.gperf \
2427         src/udev/keyboard-keys.txt \
2428         src/udev/net/link-config-gperf.c
2429
2430 EXTRA_DIST += \
2431         src/udev/net/link-config-gperf.gperf
2432
2433 libudev_core_la_CFLAGS = \
2434         $(AM_CFLAGS) \
2435         $(BLKID_CFLAGS) \
2436         $(KMOD_CFLAGS)
2437
2438 libudev_core_la_LIBADD = \
2439         libudev-internal.la \
2440         libsystemd-label.la \
2441         libsystemd-daemon-internal.la \
2442         libsystemd-rtnl.la \
2443         libsystemd-id128-internal.la \
2444         libsystemd-shared.la \
2445         $(BLKID_LIBS) \
2446         $(KMOD_LIBS)
2447
2448 libudev_core_la_CPPFLAGS = \
2449         $(AM_CPPFLAGS) \
2450         -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
2451
2452 if ENABLE_FIRMWARE
2453 libudev_core_la_SOURCES += \
2454         src/udev/udev-builtin-firmware.c
2455
2456 dist_udevrules_DATA += \
2457         rules/50-firmware.rules
2458 endif
2459
2460 if HAVE_KMOD
2461 libudev_core_la_SOURCES += \
2462         src/udev/udev-builtin-kmod.c
2463
2464 dist_udevrules_DATA += \
2465         rules/80-drivers.rules
2466 endif
2467
2468 if HAVE_BLKID
2469 libudev_core_la_SOURCES += \
2470         src/udev/udev-builtin-blkid.c
2471 endif
2472
2473 if HAVE_ACL
2474 libudev_core_la_SOURCES += \
2475         src/udev/udev-builtin-uaccess.c \
2476         src/login/logind-acl.c \
2477         src/login/sd-login.c \
2478         src/systemd/sd-login.h \
2479         src/login/login-shared.c \
2480         src/login/login-shared.h
2481
2482 libudev_core_la_LIBADD += \
2483         libsystemd-acl.la
2484 endif
2485
2486 systemd_udevd_SOURCES = \
2487         src/udev/udevd.c
2488
2489 systemd_udevd_LDADD = \
2490         libudev-core.la
2491
2492 udevadm_SOURCES = \
2493         src/udev/udevadm.c \
2494         src/udev/udevadm-info.c \
2495         src/udev/udevadm-control.c \
2496         src/udev/udevadm-monitor.c \
2497         src/udev/udevadm-hwdb.c \
2498         src/udev/udevadm-settle.c \
2499         src/udev/udevadm-trigger.c \
2500         src/udev/udevadm-test.c \
2501         src/udev/udevadm-test-builtin.c
2502
2503 udevadm_LDADD = \
2504         libudev-core.la
2505
2506 # Update hwdb on installation. Do not bother if installing
2507 # in DESTDIR, since this is likely for packaging purposes.
2508 hwdb-update-hook:
2509         -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update
2510
2511 INSTALL_DATA_HOOKS += \
2512         hwdb-update-hook
2513
2514 hwdb-remove-hook:
2515         -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
2516
2517 # ------------------------------------------------------------------------------
2518 TESTS += \
2519         test/udev-test.pl \
2520         test/rules-test.sh
2521
2522 manual_tests += \
2523         test-libudev \
2524         test-udev
2525
2526 test_libudev_SOURCES = \
2527         src/test/test-libudev.c
2528
2529 test_libudev_LDADD = \
2530         libsystemd-label.la \
2531         libudev-internal.la \
2532         libsystemd-shared.la
2533
2534 test_udev_SOURCES = \
2535         src/test/test-udev.c
2536
2537 test_udev_LDADD = \
2538         libudev-core.la \
2539         $(BLKID_LIBS) \
2540         $(KMOD_LIBS) \
2541         $(SELINUX_LIBS)
2542
2543 if HAVE_ACL
2544 test_udev_LDADD += \
2545         libsystemd-acl.la
2546 endif
2547
2548 check_DATA += \
2549         test/sys
2550
2551 # packed sysfs test tree
2552 test/sys:
2553         $(AM_V_at)$(MKDIR_P) $(dir $@)
2554         $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
2555
2556 test-sys-distclean:
2557         -rm -rf test/sys
2558 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
2559
2560 EXTRA_DIST += \
2561         test/sys.tar.xz \
2562         test/udev-test.pl \
2563         test/rules-test.sh \
2564         test/rule-syntax-check.py
2565
2566 # ------------------------------------------------------------------------------
2567 ata_id_SOURCES = \
2568         src/udev/ata_id/ata_id.c
2569
2570 ata_id_LDADD = \
2571         libudev-internal.la \
2572         libsystemd-shared.la
2573
2574 udevlibexec_PROGRAMS += \
2575         ata_id
2576
2577 # ------------------------------------------------------------------------------
2578 cdrom_id_SOURCES = \
2579         src/udev/cdrom_id/cdrom_id.c
2580
2581 cdrom_id_LDADD = \
2582         libudev-internal.la \
2583         libsystemd-shared.la
2584
2585 udevlibexec_PROGRAMS += \
2586         cdrom_id
2587
2588 dist_udevrules_DATA += \
2589         rules/60-cdrom_id.rules
2590
2591 # ------------------------------------------------------------------------------
2592 collect_SOURCES = \
2593         src/udev/collect/collect.c
2594
2595 collect_LDADD = \
2596         libudev-internal.la \
2597         libsystemd-shared.la
2598
2599 udevlibexec_PROGRAMS += \
2600         collect
2601
2602 # ------------------------------------------------------------------------------
2603 scsi_id_SOURCES =\
2604         src/udev/scsi_id/scsi_id.c \
2605         src/udev/scsi_id/scsi_serial.c \
2606         src/udev/scsi_id/scsi.h \
2607         src/udev/scsi_id/scsi_id.h
2608
2609 scsi_id_LDADD = \
2610         libudev-internal.la \
2611         libsystemd-shared.la
2612
2613 udevlibexec_PROGRAMS += \
2614         scsi_id
2615
2616 EXTRA_DIST += \
2617         src/udev/scsi_id/README
2618
2619 # ------------------------------------------------------------------------------
2620 v4l_id_SOURCES = \
2621         src/udev/v4l_id/v4l_id.c
2622
2623 v4l_id_LDADD = \
2624         libudev-internal.la
2625
2626 udevlibexec_PROGRAMS += \
2627         v4l_id
2628
2629 dist_udevrules_DATA += \
2630         rules/60-persistent-v4l.rules
2631
2632 # ------------------------------------------------------------------------------
2633 accelerometer_SOURCES = \
2634         src/udev/accelerometer/accelerometer.c
2635
2636 accelerometer_LDADD = \
2637         libudev-internal.la -lm \
2638         libsystemd-shared.la
2639
2640 udevlibexec_PROGRAMS += \
2641         accelerometer
2642
2643 dist_udevrules_DATA += \
2644         rules/61-accelerometer.rules
2645
2646 # ------------------------------------------------------------------------------
2647 if ENABLE_GUDEV
2648 if ENABLE_GTK_DOC
2649 SUBDIRS += \
2650         docs/gudev
2651 endif
2652
2653 libgudev_includedir = \
2654         $(includedir)/gudev-1.0/gudev
2655
2656 libgudev_include_HEADERS = \
2657         src/gudev/gudev.h \
2658         src/gudev/gudevenums.h \
2659         src/gudev/gudevenumtypes.h \
2660         src/gudev/gudevtypes.h \
2661         src/gudev/gudevclient.h \
2662         src/gudev/gudevdevice.h \
2663         src/gudev/gudevenumerator.h
2664
2665 lib_LTLIBRARIES += libgudev-1.0.la
2666
2667 pkgconfiglib_DATA += \
2668         src/gudev/gudev-1.0.pc
2669
2670 CLEANFILES += \
2671         src/gudev/gudev-1.0.pc
2672
2673 libgudev_1_0_la_SOURCES = \
2674         src/gudev/gudevenums.h \
2675         src/gudev/gudevenumtypes.h \
2676         src/gudev/gudevenumtypes.h\
2677         src/gudev/gudevtypes.h \
2678         src/gudev/gudevclient.h \
2679         src/gudev/gudevclient.c \
2680         src/gudev/gudevdevice.h \
2681         src/gudev/gudevdevice.c \
2682         src/gudev/gudevenumerator.h \
2683         src/gudev/gudevenumerator.c \
2684         src/gudev/gudevprivate.h
2685
2686 nodist_libgudev_1_0_la_SOURCES = \
2687         src/gudev/gudevmarshal.h \
2688         src/gudev/gudevmarshal.c \
2689         src/gudev/gudevenumtypes.h \
2690         src/gudev/gudevenumtypes.c
2691
2692 BUILT_SOURCES += \
2693         $(nodist_libgudev_1_0_la_SOURCES)
2694
2695 libgudev_1_0_la_CPPFLAGS = \
2696         $(AM_CPPFLAGS) \
2697         -I$(top_builddir)/src\
2698         -I$(top_srcdir)/src\
2699         -I$(top_builddir)/src/gudev \
2700         -I$(top_srcdir)/src/gudev \
2701         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
2702         -D_GUDEV_COMPILATION \
2703         -DG_LOG_DOMAIN=\"GUdev\"
2704
2705 libgudev_1_0_la_CFLAGS = \
2706         $(AM_CFLAGS) \
2707         -fvisibility=default \
2708         $(GLIB_CFLAGS)
2709
2710 libgudev_1_0_la_LIBADD = \
2711         libudev.la \
2712         $(GLIB_LIBS)
2713
2714 libgudev_1_0_la_LDFLAGS = \
2715         $(AM_LDFLAGS) \
2716         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
2717         -export-dynamic -no-undefined \
2718         -export-symbols-regex '^g_udev_.*'
2719
2720 src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
2721         $(AM_V_at)$(MKDIR_P) $(dir $@)
2722         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
2723
2724 src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
2725         $(AM_V_at)$(MKDIR_P) $(dir $@)
2726         $(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
2727         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
2728
2729 src/gudev/gudevenumtypes.%: src/gudev/gudevenumtypes.%.template src/gudev/gudevenums.h
2730         $(AM_V_at)$(MKDIR_P) $(dir $@)
2731         $(AM_V_GEN)glib-mkenums --template $^ > $@
2732
2733 if HAVE_INTROSPECTION
2734 -include $(INTROSPECTION_MAKEFILE)
2735
2736 src/gudev/GUdev-1.0.gir: libgudev-1.0.la
2737
2738 src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
2739
2740 src_gudev_GUdev_1_0_gir_CFLAGS = \
2741         $(AM_CFLAGS) \
2742         $(INCLUDES) \
2743         -D_GUDEV_COMPILATION \
2744         -D_GUDEV_WORK_AROUND_DEV_T_BUG \
2745         -I$(top_srcdir)/src \
2746         -I$(top_builddir)/src \
2747         -I$(top_srcdir)/src/gudev \
2748         -I$(top_builddir)/src/gudev
2749
2750 src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
2751
2752 src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
2753         --pkg-export=gudev-1.0 \
2754         --warn-all
2755
2756 src_gudev_GUdev_1_0_gir_FILES = \
2757         src/gudev/gudev.h \
2758         src/gudev/gudevtypes.h \
2759         src/gudev/gudevenums.h \
2760         src/gudev/gudevenumtypes.h \
2761         src/gudev/gudevclient.h \
2762         src/gudev/gudevdevice.h \
2763         src/gudev/gudevenumerator.h \
2764         src/gudev/gudevclient.c \
2765         src/gudev/gudevdevice.c \
2766         src/gudev/gudevenumerator.c
2767
2768 INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
2769 INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
2770
2771 girdir = $(datadir)/gir-1.0
2772 gir_DATA = \
2773         src/gudev/GUdev-1.0.gir
2774
2775 typelibsdir = $(libdir)/girepository-1.0
2776 typelibs_DATA = \
2777         src/gudev/GUdev-1.0.typelib
2778
2779 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
2780 endif # HAVE_INTROSPECTION
2781
2782 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2783 libgudev-install-hook:
2784         libname=libgudev-1.0.so && $(move-to-rootlibdir)
2785
2786 libgudev-uninstall-hook:
2787         rm -f $(DESTDIR)$(rootlibdir)/libgudev-1.0.so*
2788
2789 INSTALL_EXEC_HOOKS += libgudev-install-hook
2790 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-hook
2791 endif
2792
2793 EXTRA_DIST += \
2794         src/gudev/gudev-1.0.pc.in \
2795         src/gudev/gudevmarshal.list \
2796         src/gudev/gudevenumtypes.h.template \
2797         src/gudev/gudevenumtypes.c.template \
2798         src/gudev/gjs-example.js \
2799         src/gudev/seed-example-enum.js \
2800         src/gudev/seed-example.js
2801
2802 # ------------------------------------------------------------------------------
2803 mtd_probe_SOURCES =  \
2804         src/udev/mtd_probe/mtd_probe.c \
2805         src/udev/mtd_probe/mtd_probe.h \
2806         src/udev/mtd_probe/probe_smartmedia.c
2807
2808 dist_udevrules_DATA += \
2809         rules/75-probe_mtd.rules
2810
2811 udevlibexec_PROGRAMS += \
2812         mtd_probe
2813
2814 # ------------------------------------------------------------------------------
2815 libsystemd_id128_la_SOURCES = \
2816         src/libsystemd-id128/libsystemd-id128.sym \
2817         src/libsystemd-id128/sd-id128.c
2818
2819 libsystemd_id128_la_CFLAGS = \
2820         $(AM_CFLAGS) \
2821         -fvisibility=hidden
2822
2823 libsystemd_id128_la_LDFLAGS = \
2824         $(AM_LDFLAGS) \
2825         -version-info $(LIBSYSTEMD_ID128_CURRENT):$(LIBSYSTEMD_ID128_REVISION):$(LIBSYSTEMD_ID128_AGE) \
2826         -Wl,--version-script=$(top_srcdir)/src/libsystemd-id128/libsystemd-id128.sym
2827
2828 libsystemd_id128_la_LIBADD = \
2829         libsystemd-daemon-internal.la \
2830         libsystemd-shared.la
2831
2832 libsystemd_id128_internal_la_SOURCES = \
2833         $(libsystemd_id128_la_SOURCES)
2834
2835 test_id128_SOURCES = \
2836         src/test/test-id128.c
2837
2838 test_id128_LDADD = \
2839         libsystemd-id128-internal.la \
2840         libsystemd-daemon-internal.la \
2841         libsystemd-shared.la
2842
2843 tests += \
2844         test-id128
2845
2846 pkginclude_HEADERS += \
2847         src/systemd/sd-id128.h
2848
2849 lib_LTLIBRARIES += \
2850         libsystemd-id128.la
2851
2852 noinst_LTLIBRARIES += \
2853         libsystemd-id128-internal.la
2854
2855 pkgconfiglib_DATA += \
2856         src/libsystemd-id128/libsystemd-id128.pc
2857
2858 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2859 libsystemd-id128-install-hook:
2860         libname=libsystemd-id128.so && $(move-to-rootlibdir)
2861
2862 libsystemd-id128-uninstall-hook:
2863         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-id128.so*
2864
2865 INSTALL_EXEC_HOOKS += libsystemd-id128-install-hook
2866 UNINSTALL_EXEC_HOOKS += libsystemd-id128-uninstall-hook
2867
2868 EXTRA_DIST += \
2869         src/libsystemd-id128/libsystemd-id128.pc.in
2870
2871 # ------------------------------------------------------------------------------
2872
2873 rootlibexec_PROGRAMS += \
2874         systemd-activate
2875
2876 systemd_activate_SOURCES = \
2877         src/activate/activate.c
2878
2879 systemd_activate_LDADD = \
2880         libsystemd-label.la \
2881         libsystemd-daemon-internal.la \
2882         libsystemd-shared.la
2883
2884 # ------------------------------------------------------------------------------
2885 systemd_journald_SOURCES = \
2886         src/journal/journald.c \
2887         src/journal/journald-server.h
2888
2889 systemd_journald_LDADD = \
2890         libsystemd-journal-core.la
2891
2892 systemd_cat_SOURCES = \
2893         src/journal/cat.c
2894
2895 systemd_cat_LDADD = \
2896         libsystemd-journal-core.la
2897
2898 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
2899 journalctl_CFLAGS = \
2900         $(AM_CFLAGS)
2901
2902 journalctl_SOURCES = \
2903         src/journal/journalctl.c
2904
2905 journalctl_LDADD = \
2906         libsystemd-journal-internal.la \
2907         libsystemd-id128-internal.la \
2908         libsystemd-logs.la \
2909         libsystemd-shared.la
2910
2911 if HAVE_ACL
2912 journalctl_LDADD += \
2913         libsystemd-acl.la
2914 endif
2915
2916 if HAVE_QRENCODE
2917 journalctl_SOURCES += \
2918         src/journal/journal-qrcode.c \
2919         src/journal/journal-qrcode.h
2920
2921 journalctl_CFLAGS += \
2922         $(QRENCODE_CFLAGS)
2923
2924 journalctl_LDADD += \
2925         $(QRENCODE_LIBS)
2926 endif
2927
2928 test_journal_SOURCES = \
2929         src/journal/test-journal.c
2930
2931 test_journal_LDADD = \
2932         libsystemd-journal-core.la
2933
2934 test_journal_send_SOURCES = \
2935         src/journal/test-journal-send.c
2936
2937 test_journal_send_LDADD = \
2938         libsystemd-journal-core.la
2939
2940 test_journal_syslog_SOURCES = \
2941         src/journal/test-journal-syslog.c
2942
2943 test_journal_syslog_LDADD = \
2944         libsystemd-journal-core.la
2945
2946 test_journal_match_SOURCES = \
2947         src/journal/test-journal-match.c
2948
2949 test_journal_match_LDADD = \
2950         libsystemd-journal-core.la
2951
2952 test_journal_enum_SOURCES = \
2953         src/journal/test-journal-enum.c
2954
2955 test_journal_enum_LDADD = \
2956         libsystemd-journal-core.la
2957
2958 test_journal_stream_SOURCES = \
2959         src/journal/test-journal-stream.c
2960
2961 test_journal_stream_LDADD = \
2962         libsystemd-journal-core.la
2963
2964 test_journal_flush_SOURCES = \
2965         src/journal/test-journal-flush.c
2966
2967 test_journal_flush_LDADD = \
2968         libsystemd-journal-core.la
2969
2970 test_journal_init_SOURCES = \
2971         src/journal/test-journal-init.c
2972
2973 test_journal_init_LDADD = \
2974         libsystemd-journal-core.la
2975
2976 test_journal_verify_SOURCES = \
2977         src/journal/test-journal-verify.c
2978
2979 test_journal_verify_LDADD = \
2980         libsystemd-journal-core.la
2981
2982 test_journal_interleaving_SOURCES = \
2983         src/journal/test-journal-interleaving.c
2984
2985 test_journal_interleaving_LDADD = \
2986         libsystemd-journal-core.la
2987
2988 test_mmap_cache_SOURCES = \
2989         src/journal/test-mmap-cache.c
2990
2991 test_mmap_cache_LDADD = \
2992         libsystemd-journal-core.la
2993
2994 test_catalog_SOURCES = \
2995         src/journal/test-catalog.c
2996
2997 test_catalog_CFLAGS = \
2998         $(AM_CFLAGS) \
2999         -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
3000
3001 test_catalog_LDADD = \
3002         libsystemd-journal-core.la
3003
3004 libsystemd_journal_la_SOURCES = \
3005         src/journal/libsystemd-journal.sym \
3006         src/journal/sd-journal.c \
3007         src/systemd/sd-journal.h \
3008         src/systemd/_sd-common.h \
3009         src/journal/journal-file.c \
3010         src/journal/journal-file.h \
3011         src/journal/journal-vacuum.c \
3012         src/journal/journal-vacuum.h \
3013         src/journal/journal-verify.c \
3014         src/journal/journal-verify.h \
3015         src/journal/lookup3.c \
3016         src/journal/lookup3.h \
3017         src/journal/journal-send.c \
3018         src/journal/journal-def.h \
3019         src/journal/compress.h \
3020         src/journal/catalog.c \
3021         src/journal/catalog.h \
3022         src/journal/mmap-cache.c \
3023         src/journal/mmap-cache.h
3024
3025 libsystemd_journal_la_CFLAGS = \
3026         $(AM_CFLAGS) \
3027         -fvisibility=hidden
3028
3029 libsystemd_journal_la_LDFLAGS = \
3030         $(AM_LDFLAGS) \
3031         -version-info $(LIBSYSTEMD_JOURNAL_CURRENT):$(LIBSYSTEMD_JOURNAL_REVISION):$(LIBSYSTEMD_JOURNAL_AGE) \
3032         -Wl,--version-script=$(top_srcdir)/src/journal/libsystemd-journal.sym
3033
3034 libsystemd_journal_la_LIBADD = \
3035         libsystemd-label.la \
3036         libsystemd-daemon-internal.la \
3037         libsystemd-id128-internal.la \
3038         libsystemd-shared.la
3039
3040 libsystemd_journal_internal_la_SOURCES = \
3041         $(libsystemd_journal_la_SOURCES)
3042
3043 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3044 libsystemd_journal_internal_la_CFLAGS = \
3045         $(AM_CFLAGS)
3046
3047 libsystemd_journal_internal_la_LIBADD =
3048
3049 if HAVE_XZ
3050 libsystemd_journal_la_SOURCES += \
3051         src/journal/compress.c
3052
3053 libsystemd_journal_la_CFLAGS += \
3054         $(XZ_CFLAGS)
3055
3056 libsystemd_journal_la_LIBADD += \
3057         $(XZ_LIBS)
3058
3059 libsystemd_journal_internal_la_CFLAGS += \
3060         $(XZ_CFLAGS)
3061
3062 libsystemd_journal_internal_la_LIBADD += \
3063         $(XZ_LIBS)
3064 endif
3065
3066 libsystemd_journal_core_la_SOURCES = \
3067         src/journal/journald-kmsg.c \
3068         src/journal/journald-kmsg.h \
3069         src/journal/journald-syslog.c \
3070         src/journal/journald-syslog.h \
3071         src/journal/journald-stream.c \
3072         src/journal/journald-stream.h \
3073         src/journal/journald-server.c \
3074         src/journal/journald-server.h \
3075         src/journal/journald-console.c \
3076         src/journal/journald-console.h \
3077         src/journal/journald-native.c \
3078         src/journal/journald-native.h \
3079         src/journal/journald-rate-limit.c \
3080         src/journal/journald-rate-limit.h \
3081         src/journal/journal-internal.h
3082
3083 nodist_libsystemd_journal_core_la_SOURCES = \
3084         src/journal/journald-gperf.c
3085
3086 libsystemd_journal_core_la_LIBADD = \
3087         libsystemd-journal-internal.la \
3088         libudev-internal.la \
3089         libsystemd-audit.la \
3090         libsystemd-capability.la \
3091         libsystemd-label.la \
3092         libsystemd-daemon-internal.la \
3093         libsystemd-id128-internal.la \
3094         libsystemd-shared.la
3095
3096 if ENABLE_LOGIND
3097 libsystemd_journal_core_la_LIBADD += \
3098         libsystemd-login-internal.la
3099 endif
3100
3101 if HAVE_ACL
3102 libsystemd_journal_core_la_LIBADD += \
3103         libsystemd-acl.la
3104 endif
3105
3106 noinst_LTLIBRARIES += \
3107         libsystemd-journal-core.la
3108
3109 if HAVE_GCRYPT
3110 libsystemd_journal_la_SOURCES += \
3111         src/journal/journal-authenticate.c \
3112         src/journal/journal-authenticate.h \
3113         src/journal/fsprg.c \
3114         src/journal/fsprg.h
3115
3116 libsystemd_journal_la_CFLAGS += \
3117         $(GCRYPT_CFLAGS) \
3118         -Wno-pointer-arith
3119
3120 libsystemd_journal_la_LIBADD += \
3121         $(GCRYPT_LIBS)
3122
3123 libsystemd_journal_internal_la_CFLAGS += \
3124         $(GCRYPT_CFLAGS) \
3125         -Wno-pointer-arith
3126
3127 libsystemd_journal_internal_la_LIBADD += \
3128         $(GCRYPT_LIBS)
3129 endif
3130
3131 # move lib from $(libdir) to $(rootlibdir) and update devel link, if
3132 # needed. Also, grant read access to new journal files to members of
3133 # "adm" and "wheel".
3134 libsystemd-journal-install-hook:
3135         libname=libsystemd-journal.so && $(move-to-rootlibdir)
3136         -$(MKDIR_P) $(DESTDIR)/var/log/journal
3137         -chown 0:0 $(DESTDIR)/var/log/journal
3138         -chmod 755 $(DESTDIR)/var/log/journal
3139         -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
3140         -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
3141
3142 libsystemd-journal-uninstall-hook:
3143         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so*
3144
3145 INSTALL_EXEC_HOOKS += libsystemd-journal-install-hook
3146 UNINSTALL_EXEC_HOOKS += libsystemd-journal-uninstall-hook
3147
3148 # ------------------------------------------------------------------------------
3149
3150 # Update catalog on installation. Do not bother if installing
3151 # in DESTDIR, since this is likely for packaging purposes.
3152 catalog-update-hook:
3153         -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
3154
3155 INSTALL_DATA_HOOKS += \
3156         catalog-update-hook
3157
3158 catalog-remove-hook:
3159         -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
3160
3161 UNINSTALL_DATA_HOOKS += \
3162         catalog-remove-hook
3163
3164 manual_tests += \
3165         test-journal-enum
3166
3167 tests += \
3168         test-journal \
3169         test-journal-send \
3170         test-journal-syslog \
3171         test-journal-match \
3172         test-journal-stream \
3173         test-journal-init \
3174         test-journal-verify \
3175         test-journal-interleaving \
3176         test-journal-flush \
3177         test-mmap-cache \
3178         test-catalog
3179
3180 pkginclude_HEADERS += \
3181         src/systemd/sd-journal.h \
3182         src/systemd/sd-messages.h \
3183         src/systemd/_sd-common.h
3184
3185 lib_LTLIBRARIES += \
3186         libsystemd-journal.la
3187
3188 noinst_LTLIBRARIES += \
3189         libsystemd-journal-internal.la
3190
3191 rootlibexec_PROGRAMS += \
3192         systemd-journald
3193
3194 rootbin_PROGRAMS += \
3195         journalctl
3196
3197 bin_PROGRAMS += \
3198         systemd-cat
3199
3200 dist_systemunit_DATA += \
3201         units/systemd-journald.socket
3202
3203 nodist_systemunit_DATA += \
3204         units/systemd-journald.service \
3205         units/systemd-journal-flush.service
3206
3207 dist_pkgsysconf_DATA += \
3208         src/journal/journald.conf
3209
3210 pkgconfiglib_DATA += \
3211         src/journal/libsystemd-journal.pc
3212
3213 dist_catalog_DATA = \
3214         catalog/systemd-fr.catalog \
3215         catalog/systemd.catalog
3216
3217 SOCKETS_TARGET_WANTS += \
3218         systemd-journald.socket
3219 SYSINIT_TARGET_WANTS += \
3220         systemd-journald.service \
3221         systemd-journal-flush.service
3222
3223 EXTRA_DIST += \
3224         src/journal/libsystemd-journal.pc.in \
3225         units/systemd-journald.service.in \
3226         units/systemd-journal-flush.service.in \
3227         src/journal/journald-gperf.gperf
3228
3229 CLEANFILES += \
3230         src/journal/journald-gperf.c
3231
3232 # ------------------------------------------------------------------------------
3233 if HAVE_MICROHTTPD
3234 gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
3235
3236 rootlibexec_PROGRAMS += \
3237         systemd-journal-gatewayd
3238
3239 systemd_journal_gatewayd_SOURCES = \
3240         src/journal/journal-gatewayd.c \
3241         src/journal/microhttpd-util.h \
3242         src/journal/microhttpd-util.c
3243
3244 systemd_journal_gatewayd_LDADD = \
3245         libsystemd-logs.la \
3246         libsystemd-journal-internal.la \
3247         libsystemd-id128-internal.la \
3248         libsystemd-daemon-internal.la \
3249         libsystemd-bus-internal.la \
3250         libsystemd-shared.la \
3251         $(MICROHTTPD_LIBS)
3252
3253 systemd_journal_gatewayd_CFLAGS = \
3254         $(AM_CFLAGS) \
3255         -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\" \
3256         $(MICROHTTPD_CFLAGS)
3257
3258 dist_systemunit_DATA += \
3259         units/systemd-journal-gatewayd.socket
3260
3261 nodist_systemunit_DATA += \
3262         units/systemd-journal-gatewayd.service
3263
3264 dist_gatewayddocumentroot_DATA = \
3265         src/journal/browse.html
3266
3267 endif
3268
3269 EXTRA_DIST += \
3270         units/systemd-journal-gatewayd.service.in
3271
3272 # ------------------------------------------------------------------------------
3273
3274 systemd_socket_proxyd_SOURCES = \
3275         src/socket-proxy/socket-proxyd.c
3276
3277 systemd_socket_proxyd_LDADD = \
3278         libsystemd-logs.la \
3279         libsystemd-bus-internal.la \
3280         libsystemd-journal-internal.la \
3281         libsystemd-id128-internal.la \
3282         libsystemd-daemon-internal.la \
3283         libsystemd-shared.la
3284
3285 # ------------------------------------------------------------------------------
3286 if ENABLE_COREDUMP
3287 systemd_coredump_SOURCES = \
3288         src/journal/coredump.c
3289
3290 systemd_coredump_LDADD = \
3291         libsystemd-journal-internal.la \
3292         libsystemd-label.la \
3293         libsystemd-shared.la
3294
3295 if ENABLE_LOGIND
3296 systemd_coredump_LDADD += \
3297         libsystemd-login-internal.la
3298 endif
3299
3300 rootlibexec_PROGRAMS += \
3301         systemd-coredump
3302
3303 systemd_coredumpctl_SOURCES = \
3304         src/journal/coredumpctl.c
3305
3306 systemd_coredumpctl_LDADD = \
3307         libsystemd-journal-internal.la \
3308         libsystemd-id128-internal.la \
3309         libsystemd-shared.la
3310
3311 bin_PROGRAMS += \
3312         systemd-coredumpctl
3313
3314 dist_bashcompletion_DATA += \
3315         shell-completion/bash/systemd-coredumpctl
3316
3317 dist_zshcompletion_DATA += \
3318         shell-completion/zsh/_systemd-coredumpctl
3319
3320 sysctl_DATA = \
3321         sysctl.d/50-coredump.conf
3322
3323 CLEANFILES += \
3324         sysctl.d/50-coredump.conf
3325 endif
3326
3327 EXTRA_DIST += \
3328         sysctl.d/50-coredump.conf.in
3329
3330 # ------------------------------------------------------------------------------
3331 if ENABLE_BINFMT
3332 systemd_binfmt_SOURCES = \
3333         src/binfmt/binfmt.c
3334
3335 systemd_binfmt_LDADD = \
3336         libsystemd-shared.la
3337
3338 rootlibexec_PROGRAMS += \
3339         systemd-binfmt
3340
3341 dist_systemunit_DATA += \
3342         units/proc-sys-fs-binfmt_misc.automount \
3343         units/proc-sys-fs-binfmt_misc.mount
3344
3345 nodist_systemunit_DATA += \
3346         units/systemd-binfmt.service
3347
3348 INSTALL_DIRS += \
3349         $(prefix)/lib/binfmt.d \
3350         $(sysconfdir)/binfmt.d
3351
3352 SYSINIT_TARGET_WANTS += \
3353         systemd-binfmt.service \
3354         proc-sys-fs-binfmt_misc.automount
3355
3356 endif
3357
3358 EXTRA_DIST += \
3359         units/systemd-binfmt.service.in
3360
3361 # ------------------------------------------------------------------------------
3362 if ENABLE_VCONSOLE
3363 systemd_vconsole_setup_SOURCES = \
3364         src/vconsole/vconsole-setup.c
3365
3366 systemd_vconsole_setup_LDADD = \
3367         libsystemd-shared.la
3368
3369 rootlibexec_PROGRAMS += \
3370         systemd-vconsole-setup
3371
3372 nodist_systemunit_DATA += \
3373         units/systemd-vconsole-setup.service
3374
3375 SYSINIT_TARGET_WANTS += \
3376         systemd-vconsole-setup.service
3377 endif
3378
3379 EXTRA_DIST += \
3380         units/systemd-vconsole-setup.service.in
3381
3382 # ------------------------------------------------------------------------------
3383 if ENABLE_READAHEAD
3384 systemd_readahead_SOURCES = \
3385         src/readahead/readahead.c \
3386         src/readahead/readahead-collect.c \
3387         src/readahead/readahead-replay.c \
3388         src/readahead/readahead-analyze.c \
3389         src/readahead/readahead-common.c \
3390         src/readahead/readahead-common.h
3391
3392 systemd_readahead_LDADD = \
3393         libsystemd-daemon-internal.la \
3394         libudev-internal.la \
3395         libsystemd-shared.la
3396
3397 dist_doc_DATA += \
3398         src/readahead/sd-readahead.c \
3399         src/systemd/sd-readahead.h
3400
3401 rootlibexec_PROGRAMS += \
3402         systemd-readahead
3403
3404 dist_systemunit_DATA += \
3405         units/systemd-readahead-drop.service \
3406         units/systemd-readahead-done.timer
3407
3408 nodist_systemunit_DATA += \
3409         units/systemd-readahead-collect.service \
3410         units/systemd-readahead-replay.service \
3411         units/systemd-readahead-done.service
3412
3413 endif
3414
3415 EXTRA_DIST += \
3416         units/systemd-readahead-collect.service.in \
3417         units/systemd-readahead-replay.service.in \
3418         units/systemd-readahead-done.service.in
3419
3420 # ------------------------------------------------------------------------------
3421 if ENABLE_BOOTCHART
3422 systemd_bootchart_SOURCES = \
3423         src/bootchart/bootchart.c \
3424         src/bootchart/bootchart.h \
3425         src/bootchart/store.c \
3426         src/bootchart/store.h \
3427         src/bootchart/svg.c \
3428         src/bootchart/svg.h
3429
3430 systemd_bootchart_LDADD = \
3431         libsystemd-journal-internal.la \
3432         libsystemd-shared.la
3433
3434 rootlibexec_PROGRAMS += \
3435         systemd-bootchart
3436
3437 dist_pkgsysconf_DATA += \
3438         src/bootchart/bootchart.conf
3439 endif
3440
3441 # ------------------------------------------------------------------------------
3442 if ENABLE_QUOTACHECK
3443 rootlibexec_PROGRAMS += \
3444         systemd-quotacheck
3445
3446 nodist_systemunit_DATA += \
3447         units/systemd-quotacheck.service
3448
3449 systemd_quotacheck_SOURCES = \
3450         src/quotacheck/quotacheck.c
3451
3452 systemd_quotacheck_LDADD = \
3453         libsystemd-shared.la
3454 endif
3455
3456 EXTRA_DIST += \
3457         units/systemd-quotacheck.service.in
3458
3459 nodist_systemunit_DATA += \
3460         units/quotaon.service
3461
3462 # ------------------------------------------------------------------------------
3463 if ENABLE_RANDOMSEED
3464 rootlibexec_PROGRAMS += \
3465         systemd-random-seed
3466
3467 nodist_systemunit_DATA += \
3468         units/systemd-random-seed.service
3469
3470 systemd_random_seed_SOURCES = \
3471         src/random-seed/random-seed.c
3472
3473 systemd_random_seed_LDADD = \
3474         libsystemd-label.la \
3475         libsystemd-shared.la
3476
3477 SYSINIT_TARGET_WANTS += \
3478         systemd-random-seed.service
3479
3480 endif
3481
3482 EXTRA_DIST += \
3483         units/systemd-random-seed.service.in
3484
3485 # ------------------------------------------------------------------------------
3486 if ENABLE_BACKLIGHT
3487 rootlibexec_PROGRAMS += \
3488         systemd-backlight
3489
3490 nodist_systemunit_DATA += \
3491         units/systemd-backlight@.service
3492
3493 systemd_backlight_SOURCES = \
3494         src/backlight/backlight.c
3495
3496 systemd_backlight_LDADD = \
3497         libsystemd-label.la \
3498         libudev-internal.la \
3499         libsystemd-shared.la
3500 endif
3501
3502 EXTRA_DIST += \
3503         units/systemd-backlight@.service.in
3504
3505 # ------------------------------------------------------------------------------
3506 if ENABLE_RFKILL
3507 rootlibexec_PROGRAMS += \
3508         systemd-rfkill
3509
3510 nodist_systemunit_DATA += \
3511         units/systemd-rfkill@.service
3512
3513 systemd_rfkill_SOURCES = \
3514         src/rfkill/rfkill.c
3515
3516 systemd_rfkill_LDADD = \
3517         libsystemd-label.la \
3518         libudev-internal.la \
3519         libsystemd-shared.la
3520 endif
3521
3522 EXTRA_DIST += \
3523         units/systemd-rfkill@.service.in
3524
3525 # ------------------------------------------------------------------------------
3526 if HAVE_LIBCRYPTSETUP
3527 rootlibexec_PROGRAMS += \
3528         systemd-cryptsetup
3529
3530 systemgenerator_PROGRAMS += \
3531         systemd-cryptsetup-generator
3532
3533 dist_systemunit_DATA += \
3534         units/cryptsetup.target
3535
3536 systemd_cryptsetup_SOURCES = \
3537         src/cryptsetup/cryptsetup.c
3538
3539 systemd_cryptsetup_CFLAGS = \
3540         $(AM_CFLAGS) \
3541         $(LIBCRYPTSETUP_CFLAGS)
3542
3543 systemd_cryptsetup_LDADD = \
3544         libsystemd-label.la \
3545         libudev-internal.la \
3546         libsystemd-shared.la \
3547         $(LIBCRYPTSETUP_LIBS)
3548
3549 systemd_cryptsetup_generator_SOURCES = \
3550         src/cryptsetup/cryptsetup-generator.c
3551
3552 systemd_cryptsetup_generator_LDADD = \
3553         libsystemd-label.la \
3554         libsystemd-shared.la
3555
3556 SYSINIT_TARGET_WANTS += \
3557         cryptsetup.target
3558
3559 endif
3560
3561 # ------------------------------------------------------------------------------
3562 if ENABLE_HOSTNAMED
3563 systemd_hostnamed_SOURCES = \
3564         src/hostname/hostnamed.c
3565
3566 systemd_hostnamed_LDADD = \
3567         libsystemd-label.la \
3568         libsystemd-bus-internal.la \
3569         libsystemd-id128-internal.la \
3570         libsystemd-daemon-internal.la \
3571         libsystemd-shared.la
3572
3573 rootlibexec_PROGRAMS += \
3574         systemd-hostnamed
3575
3576 nodist_systemunit_DATA += \
3577         units/systemd-hostnamed.service
3578
3579 dist_dbuspolicy_DATA += \
3580         src/hostname/org.freedesktop.hostname1.conf
3581
3582 dist_dbussystemservice_DATA += \
3583         src/hostname/org.freedesktop.hostname1.service
3584
3585 polkitpolicy_files += \
3586         src/hostname/org.freedesktop.hostname1.policy
3587
3588 SYSTEM_UNIT_ALIASES += \
3589         systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
3590
3591 hostnamectl_SOURCES = \
3592         src/hostname/hostnamectl.c
3593
3594 hostnamectl_LDADD = \
3595         libsystemd-bus-internal.la \
3596         libsystemd-id128-internal.la \
3597         libsystemd-daemon-internal.la \
3598         libsystemd-shared.la
3599
3600 bin_PROGRAMS += \
3601         hostnamectl
3602
3603 dist_bashcompletion_DATA += \
3604         shell-completion/bash/hostnamectl
3605
3606 dist_zshcompletion_DATA += \
3607         shell-completion/zsh/_hostnamectl
3608
3609 endif
3610
3611 polkitpolicy_in_files += \
3612         src/hostname/org.freedesktop.hostname1.policy.in
3613
3614 EXTRA_DIST += \
3615         units/systemd-hostnamed.service.in
3616
3617 # ------------------------------------------------------------------------------
3618 if ENABLE_LOCALED
3619 systemd_localed_SOURCES = \
3620         src/locale/localed.c
3621
3622 systemd_localed_LDADD = \
3623         libsystemd-label.la \
3624         libsystemd-bus-internal.la \
3625         libsystemd-id128-internal.la \
3626         libsystemd-daemon-internal.la \
3627         libsystemd-shared.la
3628
3629 nodist_systemunit_DATA += \
3630         units/systemd-localed.service
3631
3632 rootlibexec_PROGRAMS += \
3633         systemd-localed
3634
3635 dist_dbuspolicy_DATA += \
3636         src/locale/org.freedesktop.locale1.conf
3637
3638 dist_dbussystemservice_DATA += \
3639         src/locale/org.freedesktop.locale1.service
3640
3641 polkitpolicy_files += \
3642         src/locale/org.freedesktop.locale1.policy
3643
3644 SYSTEM_UNIT_ALIASES += \
3645         systemd-localed.service dbus-org.freedesktop.locale1.service
3646
3647 dist_pkgdata_DATA += \
3648         src/locale/kbd-model-map
3649
3650 dist_noinst_SCRIPT = \
3651         src/locale/generate-kbd-model-map
3652
3653 update-kbd-model-map: src/locale/generate-kbd-model-map
3654         $PYTHON $< > src/locale/kbd-model-map
3655
3656 localectl_SOURCES = \
3657         src/locale/localectl.c
3658
3659 localectl_LDADD = \
3660         libsystemd-bus-internal.la \
3661         libsystemd-id128-internal.la \
3662         libsystemd-daemon-internal.la \
3663         libsystemd-shared.la
3664
3665 bin_PROGRAMS += \
3666         localectl
3667
3668 dist_bashcompletion_DATA += \
3669         shell-completion/bash/localectl
3670
3671 dist_zshcompletion_DATA += \
3672         shell-completion/zsh/_localectl
3673
3674 endif
3675
3676 polkitpolicy_in_files += \
3677         src/locale/org.freedesktop.locale1.policy.in
3678
3679 EXTRA_DIST += \
3680         units/systemd-localed.service.in
3681
3682 # ------------------------------------------------------------------------------
3683 if ENABLE_TIMEDATED
3684 systemd_timedated_SOURCES = \
3685         src/timedate/timedated.c
3686
3687 systemd_timedated_LDADD = \
3688         libsystemd-label.la \
3689         libsystemd-bus-internal.la \
3690         libsystemd-id128-internal.la \
3691         libsystemd-daemon-internal.la \
3692         libsystemd-shared.la
3693
3694 rootlibexec_PROGRAMS += \
3695         systemd-timedated
3696
3697 dist_dbussystemservice_DATA += \
3698         src/timedate/org.freedesktop.timedate1.service
3699
3700 dist_dbuspolicy_DATA += \
3701         src/timedate/org.freedesktop.timedate1.conf
3702
3703 nodist_systemunit_DATA += \
3704         units/systemd-timedated.service
3705
3706 polkitpolicy_files += \
3707         src/timedate/org.freedesktop.timedate1.policy
3708
3709 INSTALL_DIRS += \
3710         $(prefix)/lib/systemd/ntp-units.d \
3711         $(sysconfdir)/systemd/ntp-units.d
3712
3713 SYSTEM_UNIT_ALIASES += \
3714         systemd-timedated.service dbus-org.freedesktop.timedate1.service
3715
3716 timedatectl_SOURCES = \
3717         src/timedate/timedatectl.c
3718
3719 timedatectl_LDADD = \
3720         libsystemd-bus-internal.la \
3721         libsystemd-id128-internal.la \
3722         libsystemd-daemon-internal.la \
3723         libsystemd-shared.la
3724
3725 bin_PROGRAMS += \
3726         timedatectl
3727
3728 dist_bashcompletion_DATA += \
3729         shell-completion/bash/timedatectl
3730
3731 dist_zshcompletion_DATA += \
3732         shell-completion/zsh/_timedatectl
3733 endif
3734
3735 polkitpolicy_in_files += \
3736         src/timedate/org.freedesktop.timedate1.policy.in
3737
3738 EXTRA_DIST += \
3739         units/systemd-timedated.service.in
3740
3741 # ------------------------------------------------------------------------------
3742 if HAVE_MYHOSTNAME
3743 libnss_myhostname_la_SOURCES = \
3744         src/nss-myhostname/nss-myhostname.c \
3745         src/nss-myhostname/ifconf.h \
3746         src/nss-myhostname/netlink.c
3747
3748 libnss_myhostname_la_LDFLAGS = \
3749         $(AM_LDFLAGS) \
3750         -module \
3751         -export-dynamic \
3752         -avoid-version \
3753         -shared \
3754         -shrext .so.2
3755
3756 lib_LTLIBRARIES += \
3757         libnss_myhostname.la
3758 endif
3759
3760 # ------------------------------------------------------------------------------
3761 if ENABLE_MACHINED
3762 systemd_machined_SOURCES = \
3763         src/machine/machined.c \
3764         src/machine/machined.h
3765
3766 systemd_machined_LDADD = \
3767         libsystemd-machine-core.la
3768
3769 rootlibexec_PROGRAMS += \
3770         systemd-machined
3771
3772 libsystemd_machine_core_la_SOURCES = \
3773         src/machine/machined-dbus.c \
3774         src/machine/machine.c \
3775         src/machine/machine.h \
3776         src/machine/machine-dbus.c
3777
3778 libsystemd_machine_core_la_LIBADD = \
3779         libsystemd-label.la \
3780         libsystemd-audit.la \
3781         libsystemd-daemon-internal.la \
3782         libsystemd-bus-internal.la \
3783         libsystemd-id128-internal.la \
3784         libudev-internal.la \
3785         libsystemd-shared.la
3786
3787 noinst_LTLIBRARIES += \
3788         libsystemd-machine-core.la
3789
3790 machinectl_SOURCES = \
3791         src/machine/machinectl.c
3792
3793 machinectl_LDADD = \
3794         libsystemd-bus-internal.la \
3795         libsystemd-id128-internal.la \
3796         libsystemd-daemon-internal.la \
3797         libsystemd-shared.la
3798
3799 rootbin_PROGRAMS += \
3800         machinectl
3801
3802 test_machine_tables_SOURCES = \
3803         src/machine/test-machine-tables.c
3804
3805 test_machine_tables_LDADD = \
3806         libsystemd-machine-core.la
3807
3808 tests += \
3809         test-machine-tables
3810
3811 nodist_systemunit_DATA += \
3812         units/systemd-machined.service
3813
3814 dist_systemunit_DATA += \
3815         units/machine.slice
3816
3817 dist_dbussystemservice_DATA += \
3818         src/machine/org.freedesktop.machine1.service
3819
3820 dist_dbuspolicy_DATA += \
3821         src/machine/org.freedesktop.machine1.conf
3822
3823 dist_zshcompletion_DATA += \
3824         shell-completion/zsh/_machinectl
3825
3826 SYSTEM_UNIT_ALIASES += \
3827         systemd-machined.service dbus-org.freedesktop.machine1.service
3828
3829 EXTRA_DIST += \
3830         units/systemd-machined.service.in
3831
3832 endif
3833
3834 # ------------------------------------------------------------------------------
3835 if ENABLE_NETWORKD
3836 rootlibexec_PROGRAMS += \
3837         systemd-networkd
3838
3839 systemd_networkd_SOURCES = \
3840         src/network/networkd.h \
3841         src/network/networkd.c \
3842         src/network/networkd-link.c \
3843         src/network/networkd-bridge.c \
3844         src/network/networkd-network.c \
3845         src/network/networkd-address.c \
3846         src/network/networkd-route.c \
3847         src/network/networkd-manager.c
3848
3849 nodist_systemd_networkd_SOURCES = \
3850         src/network/networkd-gperf.c
3851
3852 systemd_networkd_LDADD = \
3853         libudev-internal.la \
3854         libsystemd-daemon-internal.la \
3855         libsystemd-bus-internal.la \
3856         libsystemd-id128-internal.la \
3857         libsystemd-rtnl.la \
3858         libsystemd-shared.la
3859
3860 nodist_systemunit_DATA += \
3861         units/systemd-networkd.service
3862
3863 MULTI_USER_TARGET_WANTS += \
3864         systemd-networkd.service
3865
3866 test_network_SOURCES = \
3867         src/network/test-network.c \
3868         src/network/networkd.h \
3869         src/network/networkd-link.c \
3870         src/network/networkd-bridge.c \
3871         src/network/networkd-network.c \
3872         src/network/networkd-address.c \
3873         src/network/networkd-route.c \
3874         src/network/networkd-manager.c \
3875         src/network/networkd-gperf.c
3876
3877 test_network_LDADD = \
3878         libudev-internal.la \
3879         libsystemd-bus-internal.la \
3880         libsystemd-id128-internal.la \
3881         libsystemd-rtnl.la \
3882         libsystemd-shared.la
3883
3884 tests += test-network
3885
3886 EXTRA_DIST += \
3887         src/network/networkd-gperf.gperf \
3888         units/systemd-networkd.service.in
3889
3890 CLEANFILES += \
3891         src/network/networkd-gperf.c
3892 endif
3893
3894 # ------------------------------------------------------------------------------
3895 if ENABLE_LOGIND
3896 systemd_logind_SOURCES = \
3897         src/login/logind.c \
3898         src/login/logind.h
3899
3900 nodist_systemd_logind_SOURCES = \
3901         src/login/logind-gperf.c
3902
3903 systemd_logind_LDADD = \
3904         libsystemd-logind-core.la
3905
3906 libsystemd_logind_core_la_SOURCES = \
3907         src/login/logind-core.c \
3908         src/login/logind-device.c \
3909         src/login/logind-device.h \
3910         src/login/logind-button.c \
3911         src/login/logind-button.h \
3912         src/login/logind-action.c \
3913         src/login/logind-action.h \
3914         src/login/logind-seat.c \
3915         src/login/logind-seat.h \
3916         src/login/logind-session.c \
3917         src/login/logind-session.h \
3918         src/login/logind-session-device.c \
3919         src/login/logind-session-device.h \
3920         src/login/logind-user.c \
3921         src/login/logind-user.h \
3922         src/login/logind-inhibit.c \
3923         src/login/logind-inhibit.h \
3924         src/login/logind-dbus.c \
3925         src/login/logind-session-dbus.c \
3926         src/login/logind-seat-dbus.c \
3927         src/login/logind-user-dbus.c \
3928         src/login/logind-acl.h \
3929         src/login/login-shared.c \
3930         src/login/login-shared.h
3931
3932 libsystemd_logind_core_la_LIBADD = \
3933         libsystemd-label.la \
3934         libsystemd-capability.la \
3935         libsystemd-audit.la \
3936         libsystemd-daemon-internal.la \
3937         libsystemd-id128-internal.la \
3938         libsystemd-bus-internal.la \
3939         libudev-internal.la \
3940         libsystemd-shared.la
3941
3942 if HAVE_ACL
3943 libsystemd_logind_core_la_SOURCES += \
3944         src/login/logind-acl.c
3945
3946 libsystemd_logind_core_la_LIBADD += \
3947         libsystemd-acl.la
3948 endif
3949
3950 noinst_LTLIBRARIES += \
3951         libsystemd-logind-core.la
3952
3953 systemd_user_sessions_SOURCES = \
3954         src/login/user-sessions.c
3955
3956 systemd_user_sessions_LDADD = \
3957         libsystemd-shared.la
3958
3959 rootlibexec_PROGRAMS += \
3960         systemd-logind \
3961         systemd-user-sessions
3962
3963 loginctl_SOURCES = \
3964         src/login/loginctl.c \
3965         src/login/sysfs-show.c
3966
3967 loginctl_LDADD = \
3968         libsystemd-bus-internal.la \
3969         libudev-internal.la \
3970         libsystemd-shared.la \
3971         libsystemd-id128-internal.la \
3972         libsystemd-daemon-internal.la
3973
3974 rootbin_PROGRAMS += \
3975         loginctl
3976
3977 dist_bashcompletion_DATA += \
3978         shell-completion/bash/loginctl
3979
3980 dist_zshcompletion_DATA += \
3981         shell-completion/zsh/_loginctl \
3982         shell-completion/zsh/_systemd-inhibit
3983
3984 systemd_inhibit_SOURCES = \
3985         src/login/inhibit.c
3986
3987 systemd_inhibit_LDADD = \
3988         libsystemd-bus-internal.la \
3989         libsystemd-id128-internal.la \
3990         libsystemd-daemon-internal.la \
3991         libsystemd-shared.la
3992
3993 rootbin_PROGRAMS += \
3994         systemd-inhibit
3995
3996 test_login_SOURCES = \
3997         src/login/test-login.c
3998
3999 test_login_LDADD = \
4000         libsystemd-login-internal.la \
4001         libsystemd-shared.la
4002
4003 test_login_shared_SOURCES = \
4004         src/login/test-login-shared.c
4005
4006 test_login_shared_LDADD = \
4007         libsystemd-login-internal.la \
4008         libsystemd-shared.la
4009
4010 test_inhibit_SOURCES = \
4011         src/login/test-inhibit.c
4012
4013 test_inhibit_LDADD = \
4014         libsystemd-bus-internal.la \
4015         libsystemd-daemon-internal.la \
4016         libsystemd-id128-internal.la \
4017         libsystemd-shared.la
4018
4019 test_login_tables_SOURCES = \
4020         src/login/test-login-tables.c
4021
4022 test_login_tables_LDADD = \
4023         libsystemd-logind-core.la
4024
4025 manual_tests += \
4026         test-login \
4027         test-inhibit
4028
4029 tests += \
4030         test-login-tables \
4031         test-login-shared
4032
4033 libsystemd_login_la_SOURCES = \
4034         src/login/libsystemd-login.sym \
4035         src/login/sd-login.c \
4036         src/systemd/sd-login.h \
4037         src/login/login-shared.c \
4038         src/login/login-shared.h
4039
4040 libsystemd_login_la_CFLAGS = \
4041         $(AM_CFLAGS) \
4042         -fvisibility=hidden
4043
4044 libsystemd_login_la_LDFLAGS = \
4045         $(AM_LDFLAGS) \
4046         -version-info $(LIBSYSTEMD_LOGIN_CURRENT):$(LIBSYSTEMD_LOGIN_REVISION):$(LIBSYSTEMD_LOGIN_AGE) \
4047         -Wl,--version-script=$(top_srcdir)/src/login/libsystemd-login.sym
4048
4049 libsystemd_login_la_LIBADD = \
4050         libsystemd-daemon-internal.la \
4051         libsystemd-shared.la
4052
4053 libsystemd_login_internal_la_SOURCES = \
4054         $(libsystemd_login_la_SOURCES)
4055
4056 if HAVE_PAM
4057 pam_systemd_la_SOURCES = \
4058         src/login/pam-module.c
4059
4060 pam_systemd_la_CFLAGS = \
4061         $(AM_CFLAGS) \
4062         $(PAM_CFLAGS) \
4063         -fvisibility=hidden
4064
4065 pam_systemd_la_LDFLAGS = \
4066         $(AM_LDFLAGS) \
4067         -module \
4068         -export-dynamic \
4069         -avoid-version \
4070         -shared \
4071         -export-symbols-regex '^pam_sm_.*'
4072
4073 pam_systemd_la_LIBADD = \
4074         libsystemd-capability.la \
4075         libsystemd-audit.la \
4076         libsystemd-bus-internal.la \
4077         libsystemd-id128-internal.la \
4078         libsystemd-daemon-internal.la \
4079         libsystemd-shared.la \
4080         $(PAM_LIBS)
4081
4082 pamlib_LTLIBRARIES = \
4083         pam_systemd.la
4084
4085 dist_pamconf_DATA = \
4086         src/login/systemd-user
4087 endif
4088
4089 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
4090 libsystemd-login-install-hook:
4091         libname=libsystemd-login.so && $(move-to-rootlibdir)
4092
4093 libsystemd-login-uninstall-hook:
4094         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-login.so*
4095
4096 INSTALL_EXEC_HOOKS += libsystemd-login-install-hook
4097 UNINSTALL_EXEC_HOOKS += libsystemd-login-uninstall-hook
4098
4099 nodist_systemunit_DATA += \
4100         units/systemd-logind.service \
4101         units/systemd-user-sessions.service
4102
4103 dist_systemunit_DATA += \
4104         units/user.slice
4105
4106 dist_dbussystemservice_DATA += \
4107         src/login/org.freedesktop.login1.service
4108
4109 dist_dbuspolicy_DATA += \
4110         src/login/org.freedesktop.login1.conf
4111
4112 dist_pkgsysconf_DATA += \
4113         src/login/logind.conf
4114
4115 pkginclude_HEADERS += \
4116         src/systemd/sd-login.h
4117
4118 lib_LTLIBRARIES += \
4119         libsystemd-login.la
4120
4121 noinst_LTLIBRARIES += \
4122         libsystemd-login-internal.la
4123
4124 pkgconfiglib_DATA += \
4125         src/login/libsystemd-login.pc
4126
4127 polkitpolicy_files += \
4128         src/login/org.freedesktop.login1.policy
4129
4130 INSTALL_DIRS += \
4131         $(systemdstatedir)
4132
4133 MULTI_USER_TARGET_WANTS += \
4134         systemd-logind.service \
4135         systemd-user-sessions.service
4136
4137 SYSTEM_UNIT_ALIASES += \
4138         systemd-logind.service dbus-org.freedesktop.login1.service
4139
4140 systemd_multi_seat_x_SOURCES = \
4141         src/login/multi-seat-x.c
4142
4143 systemd_multi_seat_x_LDADD = \
4144         libsystemd-label.la \
4145         libsystemd-shared.la
4146
4147 rootlibexec_PROGRAMS += \
4148         systemd-multi-seat-x
4149
4150 dist_udevrules_DATA += \
4151         src/login/70-uaccess.rules \
4152         src/login/70-power-switch.rules
4153
4154 nodist_udevrules_DATA += \
4155         src/login/71-seat.rules \
4156         src/login/73-seat-late.rules
4157
4158 CLEANFILES += \
4159         src/login/logind-gperf.c \
4160         src/login/71-seat.rules \
4161         src/login/73-seat-late.rules
4162 endif
4163
4164 polkitpolicy_in_files += \
4165         src/login/org.freedesktop.login1.policy.in
4166
4167 EXTRA_DIST += \
4168         src/login/logind-gperf.gperf \
4169         src/login/libsystemd-login.pc.in \
4170         src/login/71-seat.rules.in \
4171         src/login/73-seat-late.rules.in \
4172         units/systemd-logind.service.in \
4173         units/systemd-user-sessions.service.in
4174
4175 # ------------------------------------------------------------------------------
4176 if HAVE_PYTHON_DEVEL
4177 pkgpyexec_LTLIBRARIES = \
4178         _journal.la \
4179         id128.la \
4180         _daemon.la \
4181         _reader.la \
4182         login.la
4183
4184 _journal_la_SOURCES = \
4185         src/python-systemd/_journal.c
4186
4187 _journal_la_CFLAGS = \
4188         $(AM_CFLAGS) \
4189         -fvisibility=default \
4190         $(PYTHON_DEVEL_CFLAGS)
4191
4192 _journal_la_LDFLAGS = \
4193         $(AM_LDFLAGS) \
4194         -shared \
4195         -module \
4196         -avoid-version
4197
4198 _journal_la_LIBADD = \
4199         $(PYTHON_DEVEL_LIBS) \
4200         libsystemd-journal.la
4201
4202 id128_la_SOURCES = \
4203         src/python-systemd/id128.c \
4204         src/python-systemd/id128-constants.h \
4205         src/python-systemd/pyutil.c \
4206         src/python-systemd/pyutil.h
4207
4208 id128_la_CFLAGS = \
4209         $(AM_CFLAGS) \
4210         -fvisibility=default \
4211         $(PYTHON_DEVEL_CFLAGS) \
4212         -I$(top_builddir)/src/python-systemd
4213
4214 id128_la_LDFLAGS = \
4215         $(AM_LDFLAGS) \
4216         -shared \
4217         -module \
4218         -avoid-version
4219
4220 id128_la_LIBADD = \
4221         $(PYTHON_DEVEL_LIBS) \
4222         libsystemd-id128.la
4223
4224 _daemon_la_SOURCES = \
4225         src/python-systemd/_daemon.c \
4226         src/python-systemd/pyutil.c \
4227         src/python-systemd/pyutil.h
4228
4229 _daemon_la_CFLAGS = \
4230         $(AM_CFLAGS) \
4231         -fvisibility=default \
4232         $(PYTHON_DEVEL_CFLAGS) \
4233         -I$(top_builddir)/src/python-systemd
4234
4235 _daemon_la_LDFLAGS = \
4236         $(AM_LDFLAGS) \
4237         -shared \
4238         -module \
4239         -avoid-version
4240
4241 _daemon_la_LIBADD = \
4242         $(PYTHON_DEVEL_LIBS) \
4243         libsystemd-daemon.la
4244
4245 _reader_la_SOURCES = \
4246         src/python-systemd/_reader.c \
4247         src/python-systemd/pyutil.c \
4248         src/python-systemd/pyutil.h
4249
4250 _reader_la_CFLAGS = \
4251         $(AM_CFLAGS) \
4252         -fvisibility=default \
4253         $(PYTHON_DEVEL_CFLAGS)
4254
4255 _reader_la_LDFLAGS = \
4256         $(AM_LDFLAGS) \
4257         -shared \
4258         -module \
4259         -avoid-version
4260
4261 _reader_la_LIBADD = \
4262         $(PYTHON_DEVEL_LIBS) \
4263         libsystemd-journal.la \
4264         libsystemd-id128.la \
4265         libsystemd-daemon-internal.la \
4266         libsystemd-shared.la
4267
4268 login_la_SOURCES = \
4269         src/python-systemd/login.c \
4270         src/python-systemd/pyutil.c \
4271         src/python-systemd/pyutil.h
4272
4273 login_la_CFLAGS = \
4274         $(AM_CFLAGS) \
4275         -fvisibility=default \
4276         $(PYTHON_DEVEL_CFLAGS)
4277
4278 login_la_LDFLAGS = \
4279         $(AM_LDFLAGS) \
4280         -shared \
4281         -module \
4282         -avoid-version
4283
4284 login_la_LIBADD = \
4285         $(PYTHON_DEVEL_LIBS) \
4286         libsystemd-journal.la \
4287         libsystemd-login.la \
4288         libsystemd-daemon-internal.la \
4289         libsystemd-shared.la
4290
4291 dist_pkgpyexec_PYTHON = \
4292         src/python-systemd/journal.py \
4293         src/python-systemd/daemon.py \
4294         src/python-systemd/__init__.py
4295
4296 src/python-systemd/id128-constants.h: src/systemd/sd-messages.h Makefile
4297         $(AM_V_at)$(MKDIR_P) $(dir $@)
4298         $(AM_V_GEN)$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
4299
4300 BUILT_SOURCES += \
4301         src/python-systemd/id128-constants.h
4302
4303 SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
4304 sphinx-%:
4305         $(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
4306         $(AM_V_GEN)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) $(top_srcdir)/src/python-systemd/docs $(top_builddir)/docs/html/python-systemd/
4307         $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/html/python-systemd/
4308
4309 python-shell:
4310         $(AM_V_at)echo "Starting python with $(DESTDIR)$(pyexecdir)"
4311         $(AM_V_at)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(PYTHON)
4312
4313 destdir-sphinx: all
4314         dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
4315                 $(MAKE) DESTDIR="$$dir" install && \
4316                 $(MAKE) DESTDIR="$$dir" sphinx-html && \
4317                 rm -rf "$$dir"
4318
4319 endif
4320
4321 CLEAN_LOCAL_HOOKS += clean-sphinx
4322
4323 clean-sphinx:
4324         -rm -rf docs/html/python-systemd/
4325
4326 # Remove Python stuff, e.g. to force rebuilding for a different Python version.
4327 clean-python:
4328         -rm -rf src/python-systemd/.libs src/python-systemd/*.l[ao]
4329         -rm -f _daemon.la id128.la _journal.la login.la _reader.la
4330
4331 # ------------------------------------------------------------------------------
4332 substitutions = \
4333        '|rootlibexecdir=$(rootlibexecdir)|' \
4334        '|rootbindir=$(rootbindir)|' \
4335        '|bindir=$(bindir)|' \
4336        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
4337        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
4338        '|pkgsysconfdir=$(pkgsysconfdir)|' \
4339        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
4340        '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
4341        '|pkgdatadir=$(pkgdatadir)|' \
4342        '|systemunitdir=$(systemunitdir)|' \
4343        '|userunitdir=$(userunitdir)|' \
4344        '|systempresetdir=$(systempresetdir)|' \
4345        '|userpresetdir=$(userpresetdir)|' \
4346        '|udevhwdbdir=$(udevhwdbdir)|' \
4347        '|udevrulesdir=$(udevrulesdir)|' \
4348        '|catalogdir=$(catalogdir)|' \
4349        '|tmpfilesdir=$(tmpfilesdir)|' \
4350        '|sysctldir=$(sysctldir)|' \
4351        '|systemgeneratordir=$(systemgeneratordir)|' \
4352        '|usergeneratordir=$(usergeneratordir)|' \
4353        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
4354        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
4355        '|PACKAGE_URL=$(PACKAGE_URL)|' \
4356        '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
4357        '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
4358        '|prefix=$(prefix)|' \
4359        '|exec_prefix=$(exec_prefix)|' \
4360        '|libdir=$(libdir)|' \
4361        '|includedir=$(includedir)|' \
4362        '|VERSION=$(VERSION)|' \
4363        '|rootprefix=$(rootprefix)|' \
4364        '|udevlibexecdir=$(udevlibexecdir)|' \
4365        '|SUSHELL=$(SUSHELL)|' \
4366        '|DEBUGTTY=$(DEBUGTTY)|' \
4367        '|KILL=$(KILL)|' \
4368        '|KMOD=$(KMOD)|' \
4369        '|MKDIR_P=$(MKDIR_P)|' \
4370        '|QUOTAON=$(QUOTAON)|' \
4371        '|QUOTACHECK=$(QUOTACHECK)|' \
4372        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
4373        '|VARLOGDIR=$(varlogdir)|' \
4374        '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
4375        '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
4376        '|PYTHON=$(PYTHON)|' \
4377        '|PYTHON_BINARY=$(PYTHON_BINARY)|'
4378
4379 SED_PROCESS = \
4380         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
4381         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
4382                 < $< > $@
4383
4384 units/%: units/%.in Makefile
4385         $(SED_PROCESS)
4386
4387 man/%: man/%.in Makefile
4388         $(SED_PROCESS)
4389
4390 sysctl.d/%: sysctl.d/%.in Makefile
4391         $(SED_PROCESS)
4392
4393 %.pc: %.pc.in Makefile
4394         $(SED_PROCESS)
4395
4396 src/core/macros.%: src/core/macros.%.in Makefile
4397         $(SED_PROCESS)
4398
4399 src/%.policy.in: src/%.policy.in.in Makefile
4400         $(SED_PROCESS)
4401
4402 %.rules: %.rules.in Makefile
4403         $(SED_PROCESS)
4404
4405 %.sh: %.sh.in Makefile
4406         $(SED_PROCESS)
4407         $(AM_V_GEN)chmod +x $@
4408
4409 src/%.c: src/%.gperf
4410         $(AM_V_at)$(MKDIR_P) $(dir $@)
4411         $(AM_V_GPERF)$(GPERF) < $< > $@
4412
4413 src/%: src/%.m4
4414         $(AM_V_at)$(MKDIR_P) $(dir $@)
4415         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
4416
4417 units/%: units/%.m4 Makefile
4418         $(AM_V_M4)$(MKDIR_P) $(dir $@)
4419         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
4420
4421 units/user/%: units/%.m4 Makefile
4422         $(AM_V_M4)$(MKDIR_P) $(dir $@)
4423         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
4424
4425 if ENABLE_POLKIT
4426 nodist_polkitpolicy_DATA = \
4427         $(polkitpolicy_files) \
4428         $(polkitpolicy_in_in_files:.policy.in.in=.policy)
4429 endif
4430
4431 EXTRA_DIST += \
4432         $(polkitpolicy_in_files) \
4433         $(polkitpolicy_in_in_files)
4434
4435 CLEANFILES += \
4436         $(nodist_systemunit_DATA) \
4437         $(nodist_userunit_DATA) \
4438         $(pkgconfigdata_DATA) \
4439         $(pkgconfiglib_DATA) \
4440         $(nodist_polkitpolicy_DATA)
4441
4442 # ------------------------------------------------------------------------------
4443 if ENABLE_MANPAGES
4444 man/custom-entities.ent: Makefile
4445         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
4446         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
4447          echo '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">,$(substitutions))))') \
4448          > $@ # '
4449
4450 DISTCLEANFILES += \
4451         man/custom-entities.ent
4452
4453 XSLTPROC_FLAGS = \
4454         --nonet \
4455         --stringparam man.output.quietly 1 \
4456         --stringparam funcsynopsis.style ansi \
4457         --stringparam man.authors.section.enabled 0 \
4458         --stringparam man.copyright.section.enabled 0 \
4459         --stringparam systemd.version $(VERSION) \
4460         --path '$(builddir)/man:$(srcdir)/man'
4461
4462 XSLTPROC_PROCESS_MAN = \
4463         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
4464
4465 XSLTPROC_PROCESS_HTML = \
4466         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
4467
4468 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
4469         $(XSLTPROC_PROCESS_MAN)
4470
4471 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
4472         $(XSLTPROC_PROCESS_MAN)
4473
4474 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
4475         $(XSLTPROC_PROCESS_MAN)
4476
4477 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
4478         $(XSLTPROC_PROCESS_MAN)
4479
4480 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
4481         $(XSLTPROC_PROCESS_MAN)
4482
4483 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
4484         $(XSLTPROC_PROCESS_HTML)
4485
4486 define html-alias
4487         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
4488 endef
4489
4490 endif
4491
4492 EXTRA_DIST += \
4493         man/custom-html.xsl \
4494         man/custom-man.xsl
4495
4496 # ------------------------------------------------------------------------------
4497 if HAVE_SYSV_COMPAT
4498 sysvinit_DATA = \
4499         docs/sysvinit/README
4500
4501 varlog_DATA = \
4502         docs/var-log/README
4503
4504 docs/sysvinit/README: docs/sysvinit/README.in
4505         $(SED_PROCESS)
4506
4507 docs/var-log/README: docs/var-log/README.in
4508         $(SED_PROCESS)
4509
4510 CLEANFILES += \
4511         docs/sysvinit/README \
4512         docs/var-log/README
4513 endif
4514
4515 EXTRA_DIST += \
4516         docs/sysvinit/README.in \
4517         docs/var-log/README.in
4518
4519 SOCKETS_TARGET_WANTS += \
4520         systemd-initctl.socket \
4521         systemd-shutdownd.socket
4522
4523 if HAVE_SYSV_COMPAT
4524 RUNLEVEL1_TARGET_WANTS += \
4525         systemd-update-utmp-runlevel.service
4526 RUNLEVEL2_TARGET_WANTS += \
4527         systemd-update-utmp-runlevel.service
4528 RUNLEVEL3_TARGET_WANTS += \
4529         systemd-update-utmp-runlevel.service
4530 RUNLEVEL4_TARGET_WANTS += \
4531         systemd-update-utmp-runlevel.service
4532 RUNLEVEL5_TARGET_WANTS += \
4533         systemd-update-utmp-runlevel.service
4534 endif
4535 SYSINIT_TARGET_WANTS += \
4536         systemd-update-utmp.service
4537 LOCAL_FS_TARGET_WANTS += \
4538         systemd-remount-fs.service \
4539         tmp.mount
4540 MULTI_USER_TARGET_WANTS += \
4541         getty.target \
4542         systemd-ask-password-wall.path
4543 SYSINIT_TARGET_WANTS += \
4544         dev-hugepages.mount \
4545         dev-mqueue.mount \
4546         sys-kernel-config.mount \
4547         sys-kernel-debug.mount \
4548         sys-fs-fuse-connections.mount \
4549         systemd-sysctl.service \
4550         systemd-ask-password-console.path
4551
4552 if HAVE_SYSV_COMPAT
4553 SYSTEM_UNIT_ALIASES += \
4554         poweroff.target runlevel0.target \
4555         rescue.target runlevel1.target \
4556         multi-user.target runlevel2.target \
4557         multi-user.target runlevel3.target \
4558         multi-user.target runlevel4.target \
4559         graphical.target runlevel5.target \
4560         reboot.target runlevel6.target
4561 endif
4562
4563 SYSTEM_UNIT_ALIASES += \
4564         graphical.target default.target \
4565         reboot.target ctrl-alt-del.target \
4566         getty@.service autovt@.service
4567
4568 USER_UNIT_ALIASES += \
4569         $(systemunitdir)/shutdown.target shutdown.target \
4570         $(systemunitdir)/sockets.target sockets.target \
4571         $(systemunitdir)/timers.target timers.target \
4572         $(systemunitdir)/paths.target paths.target \
4573         $(systemunitdir)/bluetooth.target bluetooth.target \
4574         $(systemunitdir)/printer.target printer.target \
4575         $(systemunitdir)/sound.target sound.target \
4576         $(systemunitdir)/smartcard.target smartcard.target
4577
4578 GENERAL_ALIASES += \
4579         $(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
4580         $(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \
4581         $(pkgsysconfdir)/user $(sysconfdir)/xdg/systemd/user \
4582         ../system-services/org.freedesktop.systemd1.service $(dbussessionservicedir)/org.freedesktop.systemd1.service
4583
4584 if HAVE_SYSV_COMPAT
4585 INSTALL_DIRS += \
4586         $(systemunitdir)/runlevel1.target.wants \
4587         $(systemunitdir)/runlevel2.target.wants \
4588         $(systemunitdir)/runlevel3.target.wants \
4589         $(systemunitdir)/runlevel4.target.wants \
4590         $(systemunitdir)/runlevel5.target.wants
4591 endif
4592
4593 INSTALL_DIRS += \
4594         $(prefix)/lib/modules-load.d \
4595         $(sysconfdir)/modules-load.d \
4596         $(prefix)/lib/systemd/network \
4597         $(sysconfdir)/systemd/network \
4598         $(prefix)/lib/sysctl.d \
4599         $(sysconfdir)/sysctl.d \
4600         $(prefix)/lib/kernel/install.d \
4601         $(sysconfdir)/kernel/install.d \
4602         $(systemshutdowndir) \
4603         $(systemsleepdir) \
4604         $(systemgeneratordir) \
4605         $(usergeneratordir) \
4606         \
4607         $(userunitdir) \
4608         $(pkgsysconfdir)/system \
4609         $(pkgsysconfdir)/system/multi-user.target.wants \
4610         $(pkgsysconfdir)/system/getty.target.wants \
4611         $(pkgsysconfdir)/user \
4612         $(dbussessionservicedir) \
4613         $(sysconfdir)/xdg/systemd
4614
4615 install-exec-hook: $(INSTALL_EXEC_HOOKS)
4616
4617 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
4618
4619 install-data-hook: $(INSTALL_DATA_HOOKS)
4620
4621 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
4622
4623 clean-local: $(CLEAN_LOCAL_HOOKS)
4624         rm -rf $(abs_srcdir)/install-tree
4625         rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
4626               $(abs_srcdir)/hwdb/iab.txt
4627
4628 DISTCHECK_CONFIGURE_FLAGS = \
4629         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
4630         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
4631         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
4632         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
4633         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
4634         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
4635         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
4636         --with-rootprefix=$$dc_install_base \
4637         --disable-split-usr
4638
4639 if HAVE_SYSV_COMPAT
4640 DISTCHECK_CONFIGURE_FLAGS += \
4641         --with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
4642         --with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
4643 else
4644 DISTCHECK_CONFIGURE_FLAGS += \
4645         --with-sysvinit-path= \
4646         --with-sysvrcnd-path=
4647 endif
4648
4649 if ENABLE_GTK_DOC
4650 DISTCHECK_CONFIGURE_FLAGS += \
4651         --enable-gtk-doc
4652 endif
4653
4654 hwdb-update:
4655         ( cd $(top_srcdir)/hwdb && \
4656         wget -N http://www.linux-usb.org/usb.ids \
4657                 http://pci-ids.ucw.cz/v2.2/pci.ids \
4658                 http://standards.ieee.org/develop/regauth/oui/oui.txt \
4659                 http://standards.ieee.org/develop/regauth/iab/iab.txt && \
4660         ./ids-update.pl )
4661
4662 kdbus-update:
4663         ( cd $(top_srcdir)/src/libsystemd-bus/ && \
4664         wget -N https://d-bus.googlecode.com/git/kdbus.h )
4665
4666 upload: all distcheck
4667         cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
4668         scp systemd-$(VERSION).tar.xz fdo:/srv/www.freedesktop.org/www/software/systemd/
4669         scp man/*.html tango:public/systemd-man/
4670
4671 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
4672 doc-sync: all destdir-sphinx
4673         gtkdoc-rebase --html-dir=docs/libudev/html --online
4674         rsync -rlv --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
4675         gtkdoc-rebase --html-dir=docs/gudev/html --online
4676         rsync -rlv --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
4677         rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
4678         rsync -rlv --delete --omit-dir-times docs/html/python-systemd/ $(www_target)/python-systemd/
4679
4680 git-tag:
4681         git tag "v$(VERSION)" -m "systemd $(VERSION)"
4682
4683 install-tree: all
4684         rm -rf $(abs_srcdir)/install-tree
4685         $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
4686         tree $(abs_srcdir)/install-tree
4687
4688 # Let's run all tests of the test suite, but under valgrind. Let's
4689 # exclude the one perl script we have in there
4690 valgrind-tests: $(TESTS)
4691         $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
4692                 echo "Running $$f"; \
4693                 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=4194400 --error-exitcode=55 $(builddir)/$$f ; \
4694         done
4695
4696 exported-%: %
4697         $(AM_V_GEN)nm -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
4698
4699 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
4700         $(AM_V_GEN)cat $^ > $@
4701
4702 check-api-docs: exported man
4703         $(AM_V_GEN)for symbol in `cat exported` ; do \
4704                 if test -f $(builddir)/man/$$symbol.html ; then \
4705                         echo "  Symbol $$symbol() is documented." ; \
4706                 else \
4707                         echo "‣ Symbol $$symbol() lacks documentation." ; \
4708                 fi ; \
4709         done
4710
4711 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
4712 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
4713
4714 undefined defined: $(ALL_OBJECTS)
4715         $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
4716                 nm -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
4717         done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
4718
4719 CLEANFILES += \
4720         defined \
4721         undefined
4722
4723 check-api-unused: defined undefined exported
4724         ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
4725
4726 # Stupid test that everything purported to be exported really is
4727
4728 define generate-sym-test
4729         $(AM_V_at)$(MKDIR_P) $(dir $@)
4730         $(AM_V_at)printf '#include <stdio.h>\n' > $@
4731         $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
4732         $(AM_V_at)printf 'void* functions[] = {\n' >> $@
4733         $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
4734         $(AM_V_at)printf '};\nint main(void) {\n' >> $@
4735         $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
4736         $(AM_V_at)printf 'return 0; }\n' >> $@
4737 endef
4738
4739 test-libsystemd-bus-sym.c: \
4740         src/libsystemd-bus/libsystemd-bus.sym \
4741         src/systemd/sd-bus.h \
4742         src/systemd/sd-utf8.h \
4743         Makefile
4744         $(generate-sym-test)
4745
4746 test-libsystemd-daemon-sym.c: \
4747         src/libsystemd-daemon/libsystemd-daemon.sym \
4748         src/systemd/sd-daemon.h \
4749         Makefile
4750         $(generate-sym-test)
4751
4752 test-libsystemd-id128-sym.c: \
4753         src/libsystemd-id128/libsystemd-id128.sym \
4754         src/systemd/sd-id128.h \
4755         Makefile
4756         $(generate-sym-test)
4757
4758 test-libsystemd-journal-sym.c: \
4759         src/journal/libsystemd-journal.sym \
4760         src/systemd/sd-journal.h \
4761         Makefile
4762         $(generate-sym-test)
4763
4764 test-libsystemd-login-sym.c: \
4765         src/login/libsystemd-login.sym \
4766         src/systemd/sd-login.h \
4767         Makefile
4768         $(generate-sym-test)
4769
4770 test-libudev-sym.c: \
4771         src/libudev/libudev.sym \
4772         src/udev/udev.h \
4773         Makefile
4774         $(generate-sym-test)
4775
4776 test_libsystemd_bus_sym_SOURCES = \
4777         test-libsystemd-bus-sym.c
4778 test_libsystemd_bus_sym_LDADD = \
4779         libsystemd-bus.la
4780
4781 test_libsystemd_daemon_sym_SOURCES = \
4782         test-libsystemd-daemon-sym.c
4783 test_libsystemd_daemon_sym_LDADD = \
4784         libsystemd-daemon.la
4785
4786 test_libsystemd_id128_sym_SOURCES = \
4787         test-libsystemd-id128-sym.c
4788 test_libsystemd_id128_sym_LDADD = \
4789         libsystemd-id128.la
4790
4791 test_libsystemd_journal_sym_SOURCES = \
4792         test-libsystemd-journal-sym.c
4793 test_libsystemd_journal_sym_LDADD = \
4794         libsystemd-journal.la
4795
4796 test_libsystemd_login_sym_SOURCES = \
4797         test-libsystemd-login-sym.c
4798 test_libsystemd_login_sym_LDADD = \
4799         libsystemd-login.la
4800
4801 test_libudev_sym_SOURCES = \
4802         test-libudev-sym.c
4803 test_libudev_sym_LDADD = \
4804         libudev.la
4805
4806 BUILT_SOURCES += \
4807         $(test_libsystemd_bus_sym_SOURCES) \
4808         $(test_libsystemd_daemon_sym_SOURCES) \
4809         $(test_libsystemd_id128_sym_SOURCES) \
4810         $(test_libsystemd_journal_sym_SOURCES) \
4811         $(test_libsystemd_login_sym_SOURCES) \
4812         $(test_libudev_sym_SOURCES)
4813
4814 tests += \
4815         test-libsystemd-bus-sym \
4816         test-libsystemd-daemon-sym \
4817         test-libsystemd-id128-sym \
4818         test-libsystemd-journal-sym \
4819         test-libsystemd-login-sym \
4820         test-libudev-sym