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