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