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