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