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