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