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