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