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