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