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