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