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