chiark / gitweb /
machined: various simplifications
[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/bootctl.c
2483
2484 bootctl_CPPFLAGS = \
2485         $(AM_CPPFLAGS) \
2486         -DEFI_MACHINE_TYPE_NAME=\"$(EFI_MACHINE_TYPE_NAME)\" \
2487         -DSD_BOOTLIBDIR=\"$(sd_bootlibdir)\"
2488
2489 bootctl_CFLAGS = \
2490         $(AM_CFLAGS) \
2491         $(BLKID_CFLAGS)
2492
2493 bootctl_LDADD = \
2494         libsystemd-shared.la \
2495         libsystemd-internal.la \
2496         $(BLKID_LIBS)
2497
2498 bin_PROGRAMS += \
2499         bootctl
2500
2501 dist_bashcompletion_DATA += \
2502         shell-completion/bash/bootctl
2503
2504 dist_zshcompletion_DATA += \
2505         shell-completion/zsh/_bootctl
2506
2507 # ------------------------------------------------------------------------------
2508 if HAVE_GNUEFI
2509 efi_cppflags = \
2510         $(EFI_CPPFLAGS) \
2511         -I$(top_builddir) -include config.h \
2512         -I$(EFI_INC_DIR)/efi \
2513         -I$(EFI_INC_DIR)/efi/$(EFI_ARCH) \
2514         -DEFI_MACHINE_TYPE_NAME=\"$(EFI_MACHINE_TYPE_NAME)\"
2515
2516 efi_cflags = \
2517         $(EFI_CFLAGS) \
2518         -Wall \
2519         -Wextra \
2520         -nostdinc \
2521         -ggdb -O0 \
2522         -fpic \
2523         -fshort-wchar \
2524         -nostdinc \
2525         -ffreestanding \
2526         -fno-strict-aliasing \
2527         -fno-stack-protector \
2528         -Wsign-compare \
2529         -mno-sse \
2530         -mno-mmx
2531
2532 if ARCH_X86_64
2533 efi_cflags += \
2534         -mno-red-zone \
2535         -DEFI_FUNCTION_WRAPPER \
2536         -DGNU_EFI_USE_MS_ABI
2537 endif
2538
2539 efi_ldflags = \
2540         $(EFI_LDFLAGS) \
2541         -T $(EFI_LDS_DIR)/elf_$(EFI_ARCH)_efi.lds \
2542         -shared \
2543         -Bsymbolic \
2544         -nostdlib \
2545         -znocombreloc \
2546         -L $(EFI_LIB_DIR) \
2547         $(EFI_LDS_DIR)/crt0-efi-$(EFI_ARCH).o
2548
2549 # ------------------------------------------------------------------------------
2550 sd_boot_headers = \
2551         src/sd-boot/util.h \
2552         src/sd-boot/console.h \
2553         src/sd-boot/graphics.h \
2554         src/sd-boot/pefile.h
2555
2556 sd_boot_sources = \
2557         src/sd-boot/util.c \
2558         src/sd-boot/console.c \
2559         src/sd-boot/graphics.c \
2560         src/sd-boot/pefile.c \
2561         src/sd-boot/sd-boot.c
2562
2563 sd_boot_objects = $(addprefix $(top_builddir)/,$(sd_boot_sources:.c=.o))
2564 sd_boot_solib = $(top_builddir)/src/sd-boot/sd_boot.so
2565 sd_boot = sd-boot$(EFI_MACHINE_TYPE_NAME).efi
2566
2567 sd_bootlib_DATA = $(sd_boot)
2568 CLEANFILES += $(sd_boot_objects) $(sd_boot_solib) $(sd_boot)
2569 EXTRA_DIST += $(sd_boot_sources) $(sd_boot_headers)
2570
2571 $(top_builddir)/src/sd-boot/%.o: $(top_srcdir)/src/sd-boot/%.c $(addprefix $(top_srcdir)/,$(sd_boot_headers))
2572         @$(MKDIR_P) $(top_builddir)/src/sd-boot/
2573         $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
2574
2575 $(sd_boot_solib): $(sd_boot_objects)
2576         $(AM_V_CCLD)$(LD) $(efi_ldflags) $(sd_boot_objects) \
2577                 -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
2578         nm -D -u $@ | grep ' U ' && exit 1 || :
2579
2580 $(sd_boot): $(sd_boot_solib)
2581         $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
2582           -j .dynsym -j .rel -j .rela -j .reloc \
2583           --target=efi-app-$(EFI_ARCH) $< $@
2584
2585 # ------------------------------------------------------------------------------
2586 stub_headers = \
2587         src/sd-boot/util.h \
2588         src/sd-boot/pefile.h \
2589         src/sd-boot/linux.h
2590
2591 stub_sources = \
2592         src/sd-boot/util.c \
2593         src/sd-boot/pefile.c \
2594         src/sd-boot/linux.c \
2595         src/sd-boot/stub.c
2596
2597 stub_objects = $(addprefix $(top_builddir)/,$(stub_sources:.c=.o))
2598 stub_solib = $(top_builddir)/src/sd-boot/stub.so
2599 stub = linux$(EFI_MACHINE_TYPE_NAME).efi.stub
2600
2601 sd_bootlib_DATA += $(stub)
2602 CLEANFILES += $(stub_objects) $(stub_solib) $(stub)
2603 EXTRA_DIST += $(stub_sources) $(stub_headers)
2604
2605 $(top_builddir)/src/sd-boot/%.o: $(top_srcdir)/src/sd-boot/%.c $(addprefix $(top_srcdir)/,$(stub_headers))
2606         @$(MKDIR_P) $(top_builddir)/src/sd-boot/
2607         $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
2608
2609 $(stub_solib): $(stub_objects)
2610         $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
2611                 -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
2612         nm -D -u $@ | grep ' U ' && exit 1 || :
2613
2614 $(stub): $(stub_solib)
2615         $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
2616           -j .dynsym -j .rel -j .rela -j .reloc \
2617           --target=efi-app-$(EFI_ARCH) $< $@
2618
2619 # ------------------------------------------------------------------------------
2620 CLEANFILES += test-efi-disk.img
2621 EXTRA_DIST += test/test-efi-create-disk.sh
2622
2623 test-efi-disk.img: $(sd_boot) $(stub) test/test-efi-create-disk.sh
2624         $(AM_V_GEN)test/test-efi-create-disk.sh
2625
2626 test-efi: test-efi-disk.img
2627         $(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img
2628 endif
2629 endif
2630
2631 # ------------------------------------------------------------------------------
2632 if HAVE_BLKID
2633 systemgenerator_PROGRAMS +=  \
2634         systemd-gpt-auto-generator
2635
2636 systemd_gpt_auto_generator_SOURCES = \
2637         src/gpt-auto-generator/gpt-auto-generator.c \
2638         src/shared/blkid-util.h
2639
2640 systemd_gpt_auto_generator_LDADD = \
2641         libsystemd-label.la \
2642         libsystemd-internal.la \
2643         libudev-internal.la \
2644         libsystemd-shared.la \
2645         $(BLKID_LIBS)
2646
2647 systemd_gpt_auto_generator_CFLAGS = \
2648         $(AM_CFLAGS) \
2649         $(BLKID_CFLAGS)
2650 endif
2651
2652 # ------------------------------------------------------------------------------
2653 if ENABLE_KDBUS
2654 systemgenerator_PROGRAMS +=  \
2655         systemd-dbus1-generator
2656
2657 systemd_dbus1_generator_SOURCES = \
2658         src/dbus1-generator/dbus1-generator.c
2659
2660 systemd_dbus1_generator_LDADD = \
2661         libsystemd-label.la \
2662         libsystemd-internal.la \
2663         libsystemd-shared.la
2664
2665 dbus1-generator-install-hook:
2666         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
2667         $(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2668         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2669
2670 dbus1-generator-uninstall-hook:
2671         rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2672
2673 dist_xinitrc_SCRIPTS = \
2674         xorg/50-systemd-user.sh
2675
2676 INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
2677 UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
2678 endif
2679
2680 # ------------------------------------------------------------------------------
2681 systemd_sysv_generator_SOURCES = \
2682         src/sysv-generator/sysv-generator.c
2683
2684 systemd_sysv_generator_LDADD = \
2685         libsystemd-core.la \
2686         libsystemd-label.la \
2687         libsystemd-shared.la
2688
2689 # ------------------------------------------------------------------------------
2690 systemd_rc_local_generator_SOURCES = \
2691         src/rc-local-generator/rc-local-generator.c
2692
2693 systemd_rc_local_generator_LDADD = \
2694         libsystemd-label.la \
2695         libsystemd-shared.la
2696
2697 # ------------------------------------------------------------------------------
2698 systemd_remount_fs_SOURCES = \
2699         src/remount-fs/remount-fs.c \
2700         src/core/mount-setup.c \
2701         src/core/mount-setup.h
2702
2703 systemd_remount_fs_LDADD = \
2704         libsystemd-label.la \
2705         libsystemd-shared.la
2706
2707 # ------------------------------------------------------------------------------
2708 systemd_cgroups_agent_SOURCES = \
2709         src/cgroups-agent/cgroups-agent.c
2710
2711 systemd_cgroups_agent_LDADD = \
2712         libsystemd-internal.la \
2713         libsystemd-shared.la
2714
2715 # ------------------------------------------------------------------------------
2716 systemd_escape_SOURCES = \
2717         src/escape/escape.c
2718
2719 systemd_escape_LDADD = \
2720         libsystemd-shared.la
2721
2722 # -----------------------------------------------------------------------------
2723 systemctl_SOURCES = \
2724         src/systemctl/systemctl.c
2725
2726 systemctl_LDADD = \
2727         libsystemd-units.la \
2728         libsystemd-label.la \
2729         libsystemd-internal.la \
2730         libsystemd-logs.la \
2731         libsystemd-journal-internal.la \
2732         libsystemd-shared.la
2733
2734 # ------------------------------------------------------------------------------
2735 systemd_notify_SOURCES = \
2736         src/notify/notify.c
2737
2738 systemd_notify_LDADD = \
2739         libsystemd-internal.la \
2740         libsystemd-shared.la
2741
2742 # ------------------------------------------------------------------------------
2743 systemd_path_SOURCES = \
2744         src/path/path.c
2745
2746 systemd_path_LDADD = \
2747         libsystemd-internal.la \
2748         libsystemd-shared.la
2749
2750 # ------------------------------------------------------------------------------
2751 systemd_ask_password_SOURCES = \
2752         src/ask-password/ask-password.c
2753
2754 systemd_ask_password_LDADD = \
2755         libsystemd-label.la \
2756         libsystemd-shared.la
2757
2758 # ------------------------------------------------------------------------------
2759 systemd_reply_password_SOURCES = \
2760         src/reply-password/reply-password.c
2761
2762 systemd_reply_password_LDADD = \
2763         libsystemd-shared.la
2764
2765 # ------------------------------------------------------------------------------
2766 systemd_cgls_SOURCES = \
2767         src/cgls/cgls.c
2768
2769 systemd_cgls_LDADD = \
2770         libsystemd-internal.la \
2771         libsystemd-shared.la
2772
2773 # ------------------------------------------------------------------------------
2774 systemd_cgtop_SOURCES = \
2775         src/cgtop/cgtop.c
2776
2777 systemd_cgtop_LDADD = \
2778         libsystemd-shared.la
2779
2780 # ------------------------------------------------------------------------------
2781 systemd_nspawn_SOURCES = \
2782         src/nspawn/nspawn.c \
2783         src/core/mount-setup.c \
2784         src/core/mount-setup.h \
2785         src/core/loopback-setup.c \
2786         src/core/loopback-setup.h
2787
2788 systemd_nspawn_CFLAGS = \
2789         $(AM_CFLAGS) \
2790         $(SECCOMP_CFLAGS) \
2791         $(BLKID_CFLAGS)
2792
2793 systemd_nspawn_LDADD = \
2794         libsystemd-label.la \
2795         libsystemd-internal.la \
2796         libudev-internal.la \
2797         libsystemd-shared.la \
2798         $(BLKID_LIBS)
2799
2800 if HAVE_SECCOMP
2801 systemd_nspawn_LDADD += \
2802         libsystemd-seccomp.la \
2803         $(SECCOMP_LIBS)
2804 endif
2805
2806 if HAVE_LIBIPTC
2807 systemd_nspawn_LDADD += \
2808         libsystemd-fw.la
2809 endif
2810
2811 # ------------------------------------------------------------------------------
2812 systemd_run_SOURCES = \
2813         src/run/run.c
2814
2815 systemd_run_LDADD = \
2816         libsystemd-label.la \
2817         libsystemd-internal.la \
2818         libsystemd-shared.la
2819
2820 # ------------------------------------------------------------------------------
2821 noinst_LTLIBRARIES += \
2822         libsystemd-proxy.la
2823
2824 libsystemd_proxy_la_SOURCES = \
2825         src/bus-proxyd/bus-xml-policy.c \
2826         src/bus-proxyd/bus-xml-policy.h \
2827         src/bus-proxyd/driver.c \
2828         src/bus-proxyd/driver.h \
2829         src/bus-proxyd/proxy.c \
2830         src/bus-proxyd/proxy.h \
2831         src/bus-proxyd/synthesize.c \
2832         src/bus-proxyd/synthesize.h
2833
2834 libsystemd_proxy_la_CFLAGS = \
2835         $(AM_CFLAGS) \
2836         -pthread
2837
2838 libsystemd_proxy_la_LIBADD = \
2839         libsystemd-internal.la \
2840         libsystemd-shared.la
2841
2842 systemd_bus_proxyd_SOURCES = \
2843         src/bus-proxyd/bus-proxyd.c
2844
2845 systemd_bus_proxyd_CFLAGS = \
2846         $(AM_CFLAGS) \
2847         -pthread
2848
2849 systemd_bus_proxyd_LDADD = \
2850         libsystemd-proxy.la \
2851         libsystemd-internal.la \
2852         libsystemd-shared.la
2853
2854 systemd_stdio_bridge_SOURCES = \
2855         src/bus-proxyd/stdio-bridge.c
2856
2857 systemd_stdio_bridge_LDADD = \
2858         libsystemd-proxy.la \
2859         libsystemd-internal.la \
2860         libsystemd-shared.la
2861
2862 if ENABLE_KDBUS
2863 nodist_systemunit_DATA += \
2864         units/systemd-bus-proxyd.service
2865
2866 dist_systemunit_DATA += \
2867         units/systemd-bus-proxyd.socket
2868
2869 nodist_userunit_DATA += \
2870         units/user/systemd-bus-proxyd.service
2871
2872 dist_userunit_DATA += \
2873         units/user/systemd-bus-proxyd.socket
2874 endif
2875
2876 EXTRA_DIST += \
2877         units/systemd-bus-proxyd.service.m4.in \
2878         units/user/systemd-bus-proxyd.service.in
2879
2880 CLEANFILES += \
2881         units/systemd-bus-proxyd.service.m4
2882
2883 if HAVE_SMACK
2884 bus-proxyd-set-cap-hook:
2885         -$(SETCAP) cap_mac_admin+ei $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd
2886
2887 INSTALL_EXEC_HOOKS += bus-proxyd-set-cap-hook
2888 endif
2889
2890 # ------------------------------------------------------------------------------
2891 systemd_tty_ask_password_agent_SOURCES = \
2892         src/tty-ask-password-agent/tty-ask-password-agent.c
2893
2894 systemd_tty_ask_password_agent_LDADD = \
2895         libsystemd-label.la \
2896         libsystemd-shared.la
2897
2898 # ------------------------------------------------------------------------------
2899 libsystemd_internal_la_SOURCES = \
2900         src/systemd/sd-bus.h \
2901         src/systemd/sd-bus-protocol.h \
2902         src/systemd/sd-bus-vtable.h \
2903         src/systemd/sd-utf8.h \
2904         src/systemd/sd-event.h \
2905         src/systemd/sd-rtnl.h \
2906         src/systemd/sd-resolve.h \
2907         src/systemd/sd-login.h \
2908         src/systemd/sd-id128.h \
2909         src/systemd/sd-daemon.h \
2910         src/systemd/sd-path.h \
2911         src/systemd/sd-network.h \
2912         src/systemd/sd-hwdb.h \
2913         src/libsystemd/sd-bus/sd-bus.c \
2914         src/libsystemd/sd-bus/bus-control.c \
2915         src/libsystemd/sd-bus/bus-control.h \
2916         src/libsystemd/sd-bus/bus-error.c \
2917         src/libsystemd/sd-bus/bus-error.h \
2918         src/libsystemd/sd-bus/bus-common-errors.h \
2919         src/libsystemd/sd-bus/bus-common-errors.c \
2920         src/libsystemd/sd-bus/bus-internal.c \
2921         src/libsystemd/sd-bus/bus-internal.h \
2922         src/libsystemd/sd-bus/bus-socket.c \
2923         src/libsystemd/sd-bus/bus-socket.h \
2924         src/libsystemd/sd-bus/bus-kernel.c \
2925         src/libsystemd/sd-bus/bus-kernel.h \
2926         src/libsystemd/sd-bus/bus-container.c \
2927         src/libsystemd/sd-bus/bus-container.h \
2928         src/libsystemd/sd-bus/bus-message.c \
2929         src/libsystemd/sd-bus/bus-message.h \
2930         src/libsystemd/sd-bus/bus-creds.c \
2931         src/libsystemd/sd-bus/bus-creds.h \
2932         src/libsystemd/sd-bus/bus-signature.c \
2933         src/libsystemd/sd-bus/bus-signature.h \
2934         src/libsystemd/sd-bus/bus-type.c \
2935         src/libsystemd/sd-bus/bus-type.h \
2936         src/libsystemd/sd-bus/bus-match.c \
2937         src/libsystemd/sd-bus/bus-match.h \
2938         src/libsystemd/sd-bus/bus-bloom.c \
2939         src/libsystemd/sd-bus/bus-bloom.h \
2940         src/libsystemd/sd-bus/bus-introspect.c \
2941         src/libsystemd/sd-bus/bus-introspect.h \
2942         src/libsystemd/sd-bus/bus-objects.c \
2943         src/libsystemd/sd-bus/bus-objects.h \
2944         src/libsystemd/sd-bus/bus-gvariant.c \
2945         src/libsystemd/sd-bus/bus-gvariant.h \
2946         src/libsystemd/sd-bus/bus-convenience.c \
2947         src/libsystemd/sd-bus/bus-track.c \
2948         src/libsystemd/sd-bus/bus-track.h \
2949         src/libsystemd/sd-bus/bus-util.c \
2950         src/libsystemd/sd-bus/bus-util.h \
2951         src/libsystemd/sd-bus/bus-slot.c \
2952         src/libsystemd/sd-bus/bus-slot.h \
2953         src/libsystemd/sd-bus/bus-protocol.h \
2954         src/libsystemd/sd-bus/kdbus.h \
2955         src/libsystemd/sd-utf8/sd-utf8.c \
2956         src/libsystemd/sd-event/sd-event.c \
2957         src/libsystemd/sd-event/event-util.h \
2958         src/libsystemd/sd-rtnl/sd-rtnl.c \
2959         src/libsystemd/sd-rtnl/rtnl-internal.h \
2960         src/libsystemd/sd-rtnl/rtnl-message.c \
2961         src/libsystemd/sd-rtnl/rtnl-types.h \
2962         src/libsystemd/sd-rtnl/rtnl-types.c \
2963         src/libsystemd/sd-rtnl/rtnl-util.h \
2964         src/libsystemd/sd-rtnl/rtnl-util.c \
2965         src/libsystemd/sd-rtnl/local-addresses.h \
2966         src/libsystemd/sd-rtnl/local-addresses.c \
2967         src/libsystemd/sd-id128/sd-id128.c \
2968         src/libsystemd/sd-daemon/sd-daemon.c \
2969         src/libsystemd/sd-login/sd-login.c \
2970         src/libsystemd/sd-path/sd-path.c \
2971         src/libsystemd/sd-network/sd-network.c \
2972         src/libsystemd/sd-network/network-util.h \
2973         src/libsystemd/sd-network/network-util.c \
2974         src/libsystemd/sd-hwdb/sd-hwdb.c \
2975         src/libsystemd/sd-hwdb/hwdb-util.h \
2976         src/libsystemd/sd-hwdb/hwdb-internal.h
2977
2978 nodist_libsystemd_internal_la_SOURCES = \
2979         src/libsystemd/libsystemd.sym
2980
2981 libsystemd_internal_la_CFLAGS = \
2982         $(AM_CFLAGS) \
2983         -pthread
2984
2985 libsystemd_internal_la_LIBADD = \
2986         $(RT_LIBS)
2987
2988 libsystemd_resolve_la_SOURCES = \
2989         src/libsystemd/sd-resolve/sd-resolve.c \
2990         src/libsystemd/sd-resolve/resolve-util.h
2991
2992 libsystemd_resolve_la_CFLAGS = \
2993         $(AM_CFLAGS) \
2994         -pthread
2995
2996 libsystemd_resolve_la_LIBADD = \
2997         -lresolv
2998
2999 noinst_LTLIBRARIES += \
3000         libsystemd-internal.la \
3001         libsystemd-resolve.la
3002
3003 libsystemd_dump_la_SOURCES = \
3004         src/libsystemd/sd-bus/bus-dump.c \
3005         src/libsystemd/sd-bus/bus-dump.h
3006
3007 noinst_LTLIBRARIES += \
3008         libsystemd-dump.la
3009
3010 EXTRA_DIST += \
3011         src/libsystemd/libsystemd.sym.m4 \
3012         src/libsystemd/libsystemd.pc.in \
3013         src/libsystemd/sd-bus/DIFFERENCES \
3014         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
3015
3016 CLEANFILES += \
3017         src/libsystemd/libsystemd.sym
3018
3019 BUILT_SOURCES += \
3020         src/libsystemd/libsystemd.sym
3021
3022 libsystemd_la_SOURCES = \
3023         $(libsystemd_internal_la_SOURCES) \
3024         $(libsystemd_resolve_la_SOURCES) \
3025         $(libsystemd_journal_internal_la_SOURCES)
3026
3027 nodist_libsystemd_la_SOURCES = \
3028         $(nodist_libsystemd_internal_la_SOURCES)
3029
3030 libsystemd_la_CFLAGS = \
3031         $(libsystemd_internal_la_CFLAGS) \
3032         $(libsystemd_resolve_la_CFLAGS) \
3033         $(libsystemd_journal_internal_la_CFLAGS)
3034
3035 libsystemd_la_LDFLAGS = \
3036         $(AM_LDFLAGS) \
3037         -version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
3038         -Wl,--version-script=$(top_builddir)/src/libsystemd/libsystemd.sym
3039
3040 libsystemd_la_LIBADD = \
3041         libsystemd-shared.la \
3042         $(libsystemd_internal_la_LIBADD) \
3043         $(libsystemd_journal_internal_la_LIBADD) \
3044         $(libsystemd_resolve_la_LIBADD)
3045
3046 libsystemd-install-hook:
3047         libname=libsystemd.so && $(move-to-rootlibdir)
3048
3049 libsystemd-uninstall-hook:
3050         rm -f $(DESTDIR)$(rootlibdir)/libsystemd.so*
3051
3052 INSTALL_EXEC_HOOKS += libsystemd-install-hook
3053 UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook
3054
3055 pkgconfiglib_DATA += \
3056         src/libsystemd/libsystemd.pc
3057
3058 pkginclude_HEADERS += \
3059         src/systemd/sd-login.h \
3060         src/systemd/sd-id128.h \
3061         src/systemd/sd-daemon.h
3062
3063 if ENABLE_KDBUS
3064 pkginclude_HEADERS += \
3065         src/systemd/sd-bus.h \
3066         src/systemd/sd-bus-protocol.h \
3067         src/systemd/sd-bus-vtable.h \
3068         src/systemd/sd-utf8.h \
3069         src/systemd/sd-event.h \
3070         src/systemd/sd-rtnl.h \
3071         src/systemd/sd-resolve.h \
3072         src/systemd/sd-path.h
3073 endif
3074
3075 lib_LTLIBRARIES += \
3076         libsystemd.la
3077
3078 tests += \
3079         test-bus-marshal \
3080         test-bus-signature \
3081         test-bus-chat \
3082         test-bus-cleanup \
3083         test-bus-server \
3084         test-bus-match \
3085         test-bus-kernel \
3086         test-bus-kernel-bloom \
3087         test-bus-kernel-benchmark \
3088         test-bus-zero-copy \
3089         test-bus-introspect \
3090         test-bus-objects \
3091         test-bus-error \
3092         test-bus-creds \
3093         test-bus-gvariant \
3094         test-event \
3095         test-rtnl \
3096         test-local-addresses \
3097         test-resolve
3098
3099 bin_PROGRAMS += \
3100         busctl
3101
3102 test_bus_marshal_SOURCES = \
3103         src/libsystemd/sd-bus/test-bus-marshal.c
3104
3105 test_bus_marshal_LDADD = \
3106         libsystemd-dump.la \
3107         libsystemd-internal.la \
3108         libsystemd-shared.la \
3109         $(GLIB_LIBS) \
3110         $(DBUS_LIBS)
3111
3112 test_bus_marshal_CFLAGS = \
3113         $(AM_CFLAGS) \
3114         $(GLIB_CFLAGS) \
3115         $(DBUS_CFLAGS)
3116
3117 test_bus_signature_SOURCES = \
3118         src/libsystemd/sd-bus/test-bus-signature.c
3119
3120 test_bus_signature_LDADD = \
3121         libsystemd-internal.la \
3122         libsystemd-shared.la
3123
3124 test_bus_chat_SOURCES = \
3125         src/libsystemd/sd-bus/test-bus-chat.c
3126
3127 test_bus_chat_CFLAGS = \
3128         $(AM_CFLAGS) \
3129         -pthread
3130
3131 test_bus_chat_LDADD = \
3132         libsystemd-internal.la \
3133         libsystemd-shared.la
3134
3135 test_bus_cleanup_SOURCES = \
3136         src/libsystemd/sd-bus/test-bus-cleanup.c
3137
3138 test_bus_cleanup_CFLAGS = \
3139         $(AM_CFLAGS) \
3140         $(SECCOMP_CFLAGS)
3141
3142 test_bus_cleanup_LDADD = \
3143         libsystemd-internal.la \
3144         libsystemd-shared.la
3145
3146 test_bus_server_SOURCES = \
3147         src/libsystemd/sd-bus/test-bus-server.c
3148
3149 test_bus_server_CFLAGS = \
3150         $(AM_CFLAGS) \
3151         -pthread
3152
3153 test_bus_server_LDADD = \
3154         libsystemd-internal.la \
3155         libsystemd-shared.la
3156
3157 test_bus_objects_SOURCES = \
3158         src/libsystemd/sd-bus/test-bus-objects.c
3159
3160 test_bus_objects_CFLAGS = \
3161         $(AM_CFLAGS) \
3162         -pthread
3163
3164 test_bus_objects_LDADD = \
3165         libsystemd-dump.la \
3166         libsystemd-internal.la \
3167         libsystemd-shared.la
3168
3169 test_bus_error_SOURCES = \
3170         src/libsystemd/sd-bus/test-bus-error.c
3171
3172 test_bus_error_LDADD = \
3173         libsystemd-internal.la \
3174         libsystemd-shared.la
3175
3176 test_bus_gvariant_SOURCES = \
3177         src/libsystemd/sd-bus/test-bus-gvariant.c
3178
3179 test_bus_gvariant_LDADD = \
3180         libsystemd-dump.la \
3181         libsystemd-internal.la \
3182         libsystemd-shared.la \
3183         $(GLIB_LIBS)
3184
3185 test_bus_gvariant_CFLAGS = \
3186         $(AM_CFLAGS) \
3187         $(GLIB_CFLAGS)
3188
3189 test_bus_creds_SOURCES = \
3190         src/libsystemd/sd-bus/test-bus-creds.c
3191
3192 test_bus_creds_LDADD = \
3193         libsystemd-dump.la \
3194         libsystemd-internal.la \
3195         libsystemd-shared.la
3196
3197 test_bus_match_SOURCES = \
3198         src/libsystemd/sd-bus/test-bus-match.c
3199
3200 test_bus_match_LDADD = \
3201         libsystemd-internal.la \
3202         libsystemd-shared.la
3203
3204 test_bus_kernel_SOURCES = \
3205         src/libsystemd/sd-bus/test-bus-kernel.c
3206
3207 test_bus_kernel_LDADD = \
3208         libsystemd-dump.la \
3209         libsystemd-internal.la \
3210         libsystemd-shared.la
3211
3212 test_bus_kernel_bloom_SOURCES = \
3213         src/libsystemd/sd-bus/test-bus-kernel-bloom.c
3214
3215 test_bus_kernel_bloom_LDADD = \
3216         libsystemd-internal.la \
3217         libsystemd-shared.la
3218
3219 test_bus_kernel_benchmark_SOURCES = \
3220         src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
3221
3222 test_bus_kernel_benchmark_LDADD = \
3223         libsystemd-internal.la \
3224         libsystemd-shared.la
3225
3226 test_bus_zero_copy_SOURCES = \
3227         src/libsystemd/sd-bus/test-bus-zero-copy.c
3228
3229 test_bus_zero_copy_LDADD = \
3230         libsystemd-dump.la \
3231         libsystemd-internal.la \
3232         libsystemd-shared.la
3233
3234 test_bus_introspect_SOURCES = \
3235         src/libsystemd/sd-bus/test-bus-introspect.c
3236
3237 test_bus_introspect_LDADD = \
3238         libsystemd-internal.la \
3239         libsystemd-shared.la
3240
3241 test_event_SOURCES = \
3242         src/libsystemd/sd-event/test-event.c
3243
3244 test_event_LDADD = \
3245         libsystemd-internal.la \
3246         libsystemd-shared.la
3247
3248 test_rtnl_SOURCES = \
3249         src/libsystemd/sd-rtnl/test-rtnl.c
3250
3251 test_rtnl_LDADD = \
3252         libsystemd-internal.la \
3253         libsystemd-shared.la
3254
3255 test_local_addresses_SOURCES = \
3256         src/libsystemd/sd-rtnl/test-local-addresses.c
3257
3258 test_local_addresses_LDADD = \
3259         libsystemd-internal.la \
3260         libsystemd-shared.la
3261
3262 test_resolve_SOURCES = \
3263         src/libsystemd/sd-resolve/test-resolve.c
3264
3265 test_resolve_LDADD = \
3266         libsystemd-resolve.la \
3267         libsystemd-internal.la \
3268         libsystemd-shared.la
3269
3270 test_resolve_CFLAGS = \
3271         $(AM_CFLAGS) \
3272         -pthread
3273
3274 busctl_SOURCES = \
3275         src/libsystemd/sd-bus/busctl.c \
3276         src/libsystemd/sd-bus/busctl-introspect.c \
3277         src/libsystemd/sd-bus/busctl-introspect.h
3278
3279 busctl_LDADD = \
3280         libsystemd-dump.la \
3281         libsystemd-internal.la \
3282         libsystemd-shared.la
3283
3284 # ------------------------------------------------------------------------------
3285 noinst_LTLIBRARIES += \
3286         libsystemd-network.la
3287
3288 libsystemd_network_la_CFLAGS = \
3289         $(AM_CFLAGS) \
3290         $(KMOD_CFLAGS)
3291
3292 libsystemd_network_la_SOURCES = \
3293         src/systemd/sd-dhcp-client.h \
3294         src/systemd/sd-dhcp-server.h \
3295         src/systemd/sd-dhcp-lease.h \
3296         src/systemd/sd-ipv4ll.h \
3297         src/systemd/sd-icmp6-nd.h \
3298         src/systemd/sd-dhcp6-client.h \
3299         src/systemd/sd-dhcp6-lease.h \
3300         src/systemd/sd-pppoe.h \
3301         src/systemd/sd-lldp.h \
3302         src/libsystemd-network/sd-dhcp-client.c \
3303         src/libsystemd-network/sd-dhcp-server.c \
3304         src/libsystemd-network/dhcp-network.c \
3305         src/libsystemd-network/dhcp-option.c \
3306         src/libsystemd-network/dhcp-packet.c \
3307         src/libsystemd-network/dhcp-internal.h \
3308         src/libsystemd-network/dhcp-server-internal.h \
3309         src/libsystemd-network/dhcp-protocol.h \
3310         src/libsystemd-network/dhcp-lease-internal.h \
3311         src/libsystemd-network/sd-dhcp-lease.c \
3312         src/libsystemd-network/sd-ipv4ll.c \
3313         src/libsystemd-network/ipv4ll-network.c \
3314         src/libsystemd-network/ipv4ll-packet.c \
3315         src/libsystemd-network/ipv4ll-internal.h \
3316         src/libsystemd-network/sd-pppoe.c \
3317         src/libsystemd-network/network-internal.c \
3318         src/libsystemd-network/network-internal.h \
3319         src/libsystemd-network/sd-icmp6-nd.c \
3320         src/libsystemd-network/sd-dhcp6-client.c \
3321         src/libsystemd-network/dhcp6-internal.h \
3322         src/libsystemd-network/dhcp6-protocol.h \
3323         src/libsystemd-network/dhcp6-network.c \
3324         src/libsystemd-network/dhcp6-option.c \
3325         src/libsystemd-network/dhcp6-lease-internal.h \
3326         src/libsystemd-network/sd-dhcp6-lease.c \
3327         src/libsystemd-network/dhcp-identifier.h \
3328         src/libsystemd-network/dhcp-identifier.c \
3329         src/libsystemd-network/lldp.h \
3330         src/libsystemd-network/lldp-tlv.h \
3331         src/libsystemd-network/lldp-tlv.c \
3332         src/libsystemd-network/lldp-network.h \
3333         src/libsystemd-network/lldp-network.c \
3334         src/libsystemd-network/lldp-port.h \
3335         src/libsystemd-network/lldp-port.c \
3336         src/libsystemd-network/lldp-internal.h \
3337         src/libsystemd-network/lldp-internal.c \
3338         src/libsystemd-network/lldp-util.h \
3339         src/libsystemd-network/sd-lldp.c
3340
3341 libsystemd_network_la_LIBADD = \
3342         libudev-internal.la \
3343         libsystemd-label.la \
3344         libsystemd-internal.la \
3345         libsystemd-shared.la \
3346         $(KMOD_LIBS)
3347
3348 test_dhcp_option_SOURCES = \
3349         src/libsystemd-network/dhcp-protocol.h \
3350         src/libsystemd-network/dhcp-internal.h \
3351         src/libsystemd-network/test-dhcp-option.c
3352
3353 test_dhcp_option_LDADD = \
3354         libsystemd-network.la \
3355         libsystemd-internal.la \
3356         libsystemd-shared.la
3357
3358 test_dhcp_client_SOURCES = \
3359         src/systemd/sd-dhcp-client.h \
3360         src/libsystemd-network/dhcp-protocol.h \
3361         src/libsystemd-network/dhcp-internal.h \
3362         src/libsystemd-network/test-dhcp-client.c
3363
3364 test_dhcp_client_LDADD = \
3365         libsystemd-network.la \
3366         libsystemd-label.la \
3367         libsystemd-internal.la \
3368         libsystemd-shared.la
3369
3370 test_dhcp_server_SOURCES = \
3371         src/libsystemd-network/test-dhcp-server.c
3372
3373 test_dhcp_server_LDADD = \
3374         libsystemd-network.la \
3375         libsystemd-internal.la \
3376         libsystemd-shared.la
3377
3378 test_ipv4ll_SOURCES = \
3379         src/systemd/sd-ipv4ll.h \
3380         src/libsystemd-network/ipv4ll-internal.h \
3381         src/libsystemd-network/test-ipv4ll.c
3382
3383 test_ipv4ll_LDADD = \
3384         libsystemd-network.la \
3385         libsystemd-label.la \
3386         libsystemd-internal.la \
3387         libsystemd-shared.la
3388
3389 test_pppoe_SOURCES = \
3390         src/systemd/sd-pppoe.h \
3391         src/libsystemd-network/test-pppoe.c
3392
3393 test_pppoe_LDADD = \
3394         libsystemd-network.la \
3395         libsystemd-shared.la
3396
3397 test_icmp6_rs_SOURCES = \
3398         src/systemd/sd-dhcp6-client.h \
3399         src/systemd/sd-icmp6-nd.h \
3400         src/libsystemd-network/dhcp6-internal.h \
3401         src/libsystemd-network/test-icmp6-rs.c \
3402         src/libsystemd-network/dhcp-identifier.h \
3403         src/libsystemd-network/dhcp-identifier.c
3404
3405 test_icmp6_rs_LDADD = \
3406         libsystemd-network.la \
3407         libsystemd-internal.la \
3408         libsystemd-shared.la
3409
3410 test_dhcp6_client_SOURCES = \
3411         src/systemd/sd-dhcp6-client.h \
3412         src/libsystemd-network/dhcp6-internal.h \
3413         src/libsystemd-network/test-dhcp6-client.c \
3414         src/libsystemd-network/dhcp-identifier.h \
3415         src/libsystemd-network/dhcp-identifier.c
3416
3417 test_dhcp6_client_LDADD = \
3418         libsystemd-network.la \
3419         libsystemd-internal.la \
3420         libsystemd-shared.la
3421
3422 test_lldp_SOURCES = \
3423        src/libsystemd-network/lldp.h \
3424        src/libsystemd-network/lldp-tlv.h \
3425        src/libsystemd-network/lldp-tlv.c \
3426        src/libsystemd-network/test-lldp.c
3427
3428 test_lldp_LDADD = \
3429         libsystemd-network.la \
3430         libsystemd-internal.la \
3431         libsystemd-shared.la
3432
3433 tests += \
3434         test-dhcp-option \
3435         test-dhcp-client \
3436         test-dhcp-server \
3437         test-ipv4ll \
3438         test-icmp6-rs \
3439         test-dhcp6-client \
3440         test-lldp
3441
3442 manual_tests += \
3443         test-pppoe
3444
3445 # ------------------------------------------------------------------------------
3446 if ENABLE_TERMINAL
3447 noinst_LTLIBRARIES += \
3448         libsystemd-terminal.la
3449
3450 rootlibexec_PROGRAMS += \
3451         systemd-consoled
3452
3453 noinst_PROGRAMS += \
3454         systemd-evcat \
3455         systemd-modeset \
3456         systemd-subterm
3457
3458 dist_pkgdata_DATA += \
3459        src/libsystemd-terminal/unifont-glyph-array.bin
3460
3461 nodist_userunit_DATA += \
3462         units/user/systemd-consoled.service
3463
3464 USER_DEFAULT_TARGET_WANTS += \
3465         systemd-consoled.service
3466
3467 tests += \
3468         test-term-page \
3469         test-term-parser \
3470         test-unifont
3471 endif
3472
3473 EXTRA_DIST += \
3474         units/user/systemd-consoled.service.in
3475
3476 libsystemd_terminal_la_CFLAGS = \
3477         $(AM_CFLAGS) \
3478         $(TERMINAL_CFLAGS)
3479
3480 libsystemd_terminal_la_SOURCES = \
3481         src/libsystemd-terminal/grdev.h \
3482         src/libsystemd-terminal/grdev-internal.h \
3483         src/libsystemd-terminal/grdev.c \
3484         src/libsystemd-terminal/grdev-drm.c \
3485         src/libsystemd-terminal/idev.h \
3486         src/libsystemd-terminal/idev-internal.h \
3487         src/libsystemd-terminal/idev.c \
3488         src/libsystemd-terminal/idev-evdev.c \
3489         src/libsystemd-terminal/idev-keyboard.c \
3490         src/libsystemd-terminal/sysview.h \
3491         src/libsystemd-terminal/sysview-internal.h \
3492         src/libsystemd-terminal/sysview.c \
3493         src/libsystemd-terminal/term.h \
3494         src/libsystemd-terminal/term-internal.h \
3495         src/libsystemd-terminal/term-charset.c \
3496         src/libsystemd-terminal/term-page.c \
3497         src/libsystemd-terminal/term-parser.c \
3498         src/libsystemd-terminal/term-screen.c \
3499         src/libsystemd-terminal/term-wcwidth.c \
3500         src/libsystemd-terminal/unifont.h \
3501         src/libsystemd-terminal/unifont-def.h \
3502         src/libsystemd-terminal/unifont.c
3503
3504 libsystemd_terminal_la_LIBADD = \
3505         libudev-internal.la \
3506         libsystemd-internal.la \
3507         libsystemd-shared.la \
3508         $(TERMINAL_LIBS)
3509
3510 systemd_consoled_CFLAGS = \
3511         $(AM_CFLAGS) \
3512         $(TERMINAL_CFLAGS)
3513
3514 systemd_consoled_SOURCES = \
3515         src/console/consoled.h \
3516         src/console/consoled.c \
3517         src/console/consoled-display.c \
3518         src/console/consoled-manager.c \
3519         src/console/consoled-session.c \
3520         src/console/consoled-terminal.c \
3521         src/console/consoled-workspace.c
3522
3523 systemd_consoled_LDADD = \
3524         libsystemd-terminal.la \
3525         libsystemd-internal.la \
3526         libsystemd-shared.la \
3527         $(TERMINAL_LIBS)
3528
3529 systemd_evcat_CFLAGS = \
3530         $(AM_CFLAGS) \
3531         $(TERMINAL_CFLAGS)
3532
3533 systemd_evcat_SOURCES = \
3534         src/libsystemd-terminal/evcat.c
3535
3536 systemd_evcat_LDADD = \
3537         libsystemd-terminal.la \
3538         libsystemd-internal.la \
3539         libsystemd-shared.la \
3540         $(TERMINAL_LIBS)
3541
3542 systemd_modeset_CFLAGS = \
3543         $(AM_CFLAGS) \
3544         $(TERMINAL_CFLAGS)
3545
3546 systemd_modeset_SOURCES = \
3547         src/libsystemd-terminal/modeset.c
3548
3549 systemd_modeset_LDADD = \
3550         libsystemd-terminal.la \
3551         libsystemd-internal.la \
3552         libsystemd-shared.la \
3553         $(TERMINAL_LIBS)
3554
3555 systemd_subterm_SOURCES = \
3556         src/libsystemd-terminal/subterm.c
3557
3558 systemd_subterm_LDADD = \
3559         libsystemd-terminal.la \
3560         libsystemd-internal.la \
3561         libsystemd-shared.la
3562
3563 test_term_page_SOURCES = \
3564         src/libsystemd-terminal/test-term-page.c
3565
3566 test_term_page_LDADD = \
3567         libsystemd-terminal.la \
3568         libsystemd-internal.la \
3569         libsystemd-shared.la
3570
3571 test_term_parser_SOURCES = \
3572         src/libsystemd-terminal/test-term-parser.c
3573
3574 test_term_parser_LDADD = \
3575         libsystemd-terminal.la \
3576         libsystemd-internal.la \
3577         libsystemd-shared.la
3578
3579 test_unifont_SOURCES = \
3580         src/libsystemd-terminal/test-unifont.c
3581
3582 test_unifont_LDADD = \
3583         libsystemd-terminal.la \
3584         libsystemd-internal.la \
3585         libsystemd-shared.la
3586
3587 src/libsystemd-terminal/unifont-glyph-array.bin: tools/compile-unifont.py $(UNIFONT)
3588         $(AM_V_GEN)$(PYTHON) $< <$(UNIFONT) >$@
3589
3590 # ------------------------------------------------------------------------------
3591 if ENABLE_GTK_DOC
3592 SUBDIRS += \
3593         docs/libudev
3594
3595 noinst_DATA += \
3596         docs/html/libudev \
3597         docs/html/gudev
3598 endif
3599
3600 include_HEADERS += \
3601         src/libudev/libudev.h
3602
3603 lib_LTLIBRARIES += \
3604         libudev.la
3605
3606 libudev_la_SOURCES =\
3607         src/libudev/libudev.sym \
3608         src/libudev/libudev-private.h \
3609         src/libudev/libudev.c \
3610         src/libudev/libudev-list.c \
3611         src/libudev/libudev-util.c \
3612         src/libudev/libudev-device.c \
3613         src/libudev/libudev-enumerate.c \
3614         src/libudev/libudev-monitor.c \
3615         src/libudev/libudev-queue.c \
3616         src/libudev/libudev-hwdb.c
3617
3618 libudev_la_CFLAGS = \
3619         $(AM_CFLAGS) \
3620         -fvisibility=hidden
3621
3622 libudev_la_LDFLAGS = \
3623         $(AM_LDFLAGS) \
3624         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
3625         -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
3626
3627 libudev_la_LIBADD = \
3628         libsystemd-internal.la \
3629         libsystemd-shared.la
3630
3631 pkgconfiglib_DATA += \
3632         src/libudev/libudev.pc
3633
3634 EXTRA_DIST += \
3635         src/libudev/libudev.pc.in
3636
3637 CLEANFILES += \
3638         src/libudev/libudev.pc \
3639         docs/html/libudev \
3640         docs/html/gudev
3641
3642 docs/html/libudev:
3643         $(AM_V_at)$(MKDIR_P) $(dir $@)
3644         $(AM_V_LN)$(LN_S) -f ../libudev/html $@
3645
3646 docs/html/gudev:
3647         $(AM_V_at)$(MKDIR_P) $(dir $@)
3648         $(AM_V_LN)$(LN_S) -f ../gudev/html $@
3649
3650 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
3651 libudev-install-hook:
3652         libname=libudev.so && $(move-to-rootlibdir)
3653
3654 libudev-uninstall-hook:
3655         rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
3656
3657 INSTALL_EXEC_HOOKS += libudev-install-hook
3658 UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
3659
3660 # ------------------------------------------------------------------------------
3661 noinst_LTLIBRARIES += \
3662         libudev-internal.la
3663
3664 libudev_internal_la_SOURCES =\
3665         $(libudev_la_SOURCES) \
3666         src/libudev/libudev-device-private.c
3667
3668 libudev_internal_la_CFLAGS = \
3669         $(AM_CFLAGS) \
3670         -fvisibility=default
3671
3672 # ------------------------------------------------------------------------------
3673 INSTALL_DIRS += \
3674         $(sysconfdir)/udev/rules.d
3675
3676 dist_network_DATA = \
3677         network/99-default.link \
3678         network/80-container-host0.network \
3679         network/80-container-ve.network
3680
3681 dist_udevrules_DATA += \
3682         rules/42-usb-hid-pm.rules \
3683         rules/50-udev-default.rules \
3684         rules/60-drm.rules \
3685         rules/60-keyboard.rules \
3686         rules/60-persistent-storage-tape.rules \
3687         rules/60-persistent-serial.rules \
3688         rules/60-persistent-input.rules \
3689         rules/60-persistent-alsa.rules \
3690         rules/60-persistent-storage.rules \
3691         rules/64-btrfs.rules \
3692         rules/70-mouse.rules \
3693         rules/70-touchpad.rules \
3694         rules/75-net-description.rules \
3695         rules/75-tty-description.rules \
3696         rules/78-sound-card.rules \
3697         rules/80-net-setup-link.rules \
3698         rules/95-udev-late.rules
3699
3700 nodist_udevrules_DATA += \
3701         rules/99-systemd.rules
3702
3703 udevconfdir = $(sysconfdir)/udev
3704 dist_udevconf_DATA = \
3705         src/udev/udev.conf
3706
3707 sharepkgconfigdir = $(datadir)/pkgconfig
3708 sharepkgconfig_DATA = \
3709         src/udev/udev.pc
3710
3711 EXTRA_DIST += \
3712         rules/99-systemd.rules.in \
3713         src/udev/udev.pc.in
3714
3715 CLEANFILES += \
3716         rules/99-systemd.rules \
3717         src/udev/udev.pc
3718
3719 EXTRA_DIST += \
3720         units/systemd-udevd.service.in \
3721         units/systemd-udev-trigger.service.in \
3722         units/systemd-udev-settle.service.in
3723
3724 CLEANFILES += \
3725         units/systemd-udevd.service \
3726         units/systemd-udev-trigger.service \
3727         units/systemd-udev-settle.service
3728
3729 SOCKETS_TARGET_WANTS += \
3730         systemd-udevd-control.socket \
3731         systemd-udevd-kernel.socket
3732
3733 SYSINIT_TARGET_WANTS += \
3734         systemd-udevd.service \
3735         systemd-udev-trigger.service
3736
3737 rootbin_PROGRAMS += \
3738         udevadm
3739
3740 rootlibexec_PROGRAMS += \
3741         systemd-udevd
3742
3743 noinst_LTLIBRARIES += \
3744         libudev-core.la
3745
3746 src/udev/keyboard-keys.txt:
3747         $(AM_V_at)$(MKDIR_P) $(dir $@)
3748         $(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/' > $@
3749
3750 src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt
3751         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
3752
3753 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
3754         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
3755
3756 src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt
3757         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
3758
3759 libudev_core_la_SOURCES = \
3760         src/udev/udev.h \
3761         src/udev/udev-event.c \
3762         src/udev/udev-watch.c \
3763         src/udev/udev-node.c \
3764         src/udev/udev-rules.c \
3765         src/udev/udev-ctrl.c \
3766         src/udev/udev-builtin.c \
3767         src/udev/udev-builtin-btrfs.c \
3768         src/udev/udev-builtin-hwdb.c \
3769         src/udev/udev-builtin-input_id.c \
3770         src/udev/udev-builtin-keyboard.c \
3771         src/udev/udev-builtin-net_id.c \
3772         src/udev/udev-builtin-net_setup_link.c \
3773         src/udev/udev-builtin-path_id.c \
3774         src/udev/udev-builtin-usb_id.c \
3775         src/udev/net/link-config.h \
3776         src/udev/net/link-config.c \
3777         src/udev/net/ethtool-util.h \
3778         src/udev/net/ethtool-util.c
3779
3780 nodist_libudev_core_la_SOURCES = \
3781         src/udev/keyboard-keys-from-name.h \
3782         src/udev/keyboard-keys-to-name.h \
3783         src/udev/net/link-config-gperf.c
3784
3785 BUILT_SOURCES += \
3786         $(nodist_libudev_core_la_SOURCES)
3787
3788 CLEANFILES += \
3789         src/udev/keyboard-keys-from-name.gperf \
3790         src/udev/keyboard-keys.txt \
3791         src/udev/net/link-config-gperf.c
3792
3793 EXTRA_DIST += \
3794         src/udev/net/link-config-gperf.gperf
3795
3796 libudev_core_la_CFLAGS = \
3797         $(AM_CFLAGS) \
3798         $(BLKID_CFLAGS) \
3799         $(KMOD_CFLAGS)
3800
3801 libudev_core_la_LIBADD = \
3802         libudev-internal.la \
3803         libsystemd-label.la \
3804         libsystemd-internal.la \
3805         libsystemd-network.la \
3806         libsystemd-shared.la \
3807         $(BLKID_LIBS) \
3808         $(KMOD_LIBS)
3809
3810 if HAVE_KMOD
3811 libudev_core_la_SOURCES += \
3812         src/udev/udev-builtin-kmod.c
3813
3814 dist_udevrules_DATA += \
3815         rules/80-drivers.rules
3816 endif
3817
3818 if HAVE_BLKID
3819 libudev_core_la_SOURCES += \
3820         src/udev/udev-builtin-blkid.c
3821 endif
3822
3823 if HAVE_ACL
3824 libudev_core_la_SOURCES += \
3825         src/udev/udev-builtin-uaccess.c \
3826         src/login/logind-acl.c \
3827         src/libsystemd/sd-login/sd-login.c \
3828         src/systemd/sd-login.h
3829
3830 libudev_core_la_LIBADD += \
3831         libsystemd-acl.la
3832 endif
3833
3834 systemd_udevd_SOURCES = \
3835         src/udev/udevd.c
3836
3837 systemd_udevd_LDADD = \
3838         libudev-core.la
3839
3840 udevadm_SOURCES = \
3841         src/udev/udevadm.c \
3842         src/udev/udevadm-info.c \
3843         src/udev/udevadm-control.c \
3844         src/udev/udevadm-monitor.c \
3845         src/udev/udevadm-hwdb.c \
3846         src/udev/udevadm-settle.c \
3847         src/udev/udevadm-trigger.c \
3848         src/udev/udevadm-test.c \
3849         src/udev/udevadm-test-builtin.c \
3850         src/udev/udevadm-util.c \
3851         src/udev/udevadm-util.h
3852
3853 udevadm_LDADD = \
3854         libudev-core.la
3855
3856 # ------------------------------------------------------------------------------
3857 if ENABLE_HWDB
3858 INSTALL_DIRS += \
3859         $(sysconfdir)/udev/hwdb.d
3860
3861 systemd_hwdb_SOURCES = \
3862         src/libsystemd/sd-hwdb/hwdb-internal.h \
3863         src/hwdb/hwdb.c
3864
3865 systemd_hwdb_LDADD = \
3866         libsystemd-shared.la \
3867         libsystemd-internal.la \
3868         libudev-internal.la
3869
3870 rootbin_PROGRAMS += \
3871         systemd-hwdb
3872
3873 dist_udevhwdb_DATA = \
3874         hwdb/20-pci-vendor-model.hwdb \
3875         hwdb/20-pci-classes.hwdb \
3876         hwdb/20-usb-vendor-model.hwdb \
3877         hwdb/20-usb-classes.hwdb \
3878         hwdb/20-sdio-vendor-model.hwdb \
3879         hwdb/20-sdio-classes.hwdb \
3880         hwdb/20-bluetooth-vendor-product.hwdb \
3881         hwdb/20-acpi-vendor.hwdb \
3882         hwdb/20-OUI.hwdb \
3883         hwdb/20-net-ifname.hwdb \
3884         hwdb/60-keyboard.hwdb \
3885         hwdb/70-mouse.hwdb \
3886         hwdb/70-touchpad.hwdb
3887
3888 EXTRA_DIST += \
3889         units/systemd-hwdb-update.service.in
3890
3891 CLEANFILES += \
3892         units/systemd-hwdb-update.service
3893
3894 SYSINIT_TARGET_WANTS += \
3895         systemd-hwdb-update.service
3896
3897 # Update hwdb on installation. Do not bother if installing
3898 # in DESTDIR, since this is likely for packaging purposes.
3899 hwdb-update-hook:
3900         -test -n "$(DESTDIR)" || $(rootbindir)/systemd-hwdb update
3901
3902 INSTALL_DATA_HOOKS += \
3903         hwdb-update-hook
3904
3905 hwdb-remove-hook:
3906         -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
3907 endif
3908
3909 # ------------------------------------------------------------------------------
3910 TESTS += \
3911         test/udev-test.pl \
3912         $(NULL)
3913
3914 if HAVE_PYTHON
3915 TESTS += \
3916         test/rule-syntax-check.py \
3917         test/sysv-generator-test.py \
3918         $(NULL)
3919 endif
3920
3921 manual_tests += \
3922         test-libudev \
3923         test-udev
3924
3925 test_libudev_SOURCES = \
3926         src/test/test-libudev.c
3927
3928 test_libudev_LDADD = \
3929         libsystemd-label.la \
3930         libudev-internal.la \
3931         libsystemd-shared.la \
3932         libsystemd-internal.la
3933
3934 test_udev_SOURCES = \
3935         src/test/test-udev.c
3936
3937 test_udev_LDADD = \
3938         libudev-core.la  \
3939         $(BLKID_LIBS) \
3940         $(KMOD_LIBS) \
3941         $(SELINUX_LIBS)
3942
3943 if HAVE_ACL
3944 test_udev_LDADD += \
3945         libsystemd-acl.la
3946 endif
3947
3948 check_DATA += \
3949         test/sys
3950
3951 # packed sysfs test tree
3952 test/sys:
3953         $(AM_V_at)$(MKDIR_P) $(dir $@)
3954         $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
3955
3956 test-sys-distclean:
3957         -rm -rf test/sys
3958 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
3959
3960 EXTRA_DIST += \
3961         test/sys.tar.xz \
3962         test/udev-test.pl \
3963         test/rule-syntax-check.py \
3964         test/sysv-generator-test.py \
3965         $(NULL)
3966
3967
3968 # ------------------------------------------------------------------------------
3969 ata_id_SOURCES = \
3970         src/udev/ata_id/ata_id.c
3971
3972 ata_id_LDADD = \
3973         libudev-internal.la \
3974         libsystemd-shared.la
3975
3976 udevlibexec_PROGRAMS += \
3977         ata_id
3978
3979 # ------------------------------------------------------------------------------
3980 cdrom_id_SOURCES = \
3981         src/udev/cdrom_id/cdrom_id.c
3982
3983 cdrom_id_LDADD = \
3984         libudev-internal.la \
3985         libsystemd-shared.la
3986
3987 udevlibexec_PROGRAMS += \
3988         cdrom_id
3989
3990 dist_udevrules_DATA += \
3991         rules/60-cdrom_id.rules
3992
3993 # ------------------------------------------------------------------------------
3994 collect_SOURCES = \
3995         src/udev/collect/collect.c
3996
3997 collect_LDADD = \
3998         libudev-internal.la \
3999         libsystemd-shared.la
4000
4001 udevlibexec_PROGRAMS += \
4002         collect
4003
4004 # ------------------------------------------------------------------------------
4005 scsi_id_SOURCES =\
4006         src/udev/scsi_id/scsi_id.c \
4007         src/udev/scsi_id/scsi_serial.c \
4008         src/udev/scsi_id/scsi.h \
4009         src/udev/scsi_id/scsi_id.h
4010
4011 scsi_id_LDADD = \
4012         libudev-internal.la \
4013         libsystemd-shared.la
4014
4015 udevlibexec_PROGRAMS += \
4016         scsi_id
4017
4018 EXTRA_DIST += \
4019         src/udev/scsi_id/README
4020
4021 # ------------------------------------------------------------------------------
4022 v4l_id_SOURCES = \
4023         src/udev/v4l_id/v4l_id.c
4024
4025 v4l_id_LDADD = \
4026         libudev-internal.la \
4027         libsystemd-shared.la
4028
4029 udevlibexec_PROGRAMS += \
4030         v4l_id
4031
4032 dist_udevrules_DATA += \
4033         rules/60-persistent-v4l.rules
4034
4035 # ------------------------------------------------------------------------------
4036 accelerometer_SOURCES = \
4037         src/udev/accelerometer/accelerometer.c
4038
4039 accelerometer_LDADD = \
4040         libudev-internal.la \
4041         libsystemd-shared.la
4042
4043 udevlibexec_PROGRAMS += \
4044         accelerometer
4045
4046 dist_udevrules_DATA += \
4047         rules/61-accelerometer.rules
4048
4049 # ------------------------------------------------------------------------------
4050 if ENABLE_GUDEV
4051 if ENABLE_GTK_DOC
4052 SUBDIRS += \
4053         docs/gudev
4054 endif
4055
4056 libgudev_includedir = \
4057         $(includedir)/gudev-1.0/gudev
4058
4059 libgudev_include_HEADERS = \
4060         src/gudev/gudev.h \
4061         src/gudev/gudevenums.h \
4062         src/gudev/gudevenumtypes.h \
4063         src/gudev/gudevtypes.h \
4064         src/gudev/gudevclient.h \
4065         src/gudev/gudevdevice.h \
4066         src/gudev/gudevenumerator.h
4067
4068 lib_LTLIBRARIES += libgudev-1.0.la
4069
4070 pkgconfiglib_DATA += \
4071         src/gudev/gudev-1.0.pc
4072
4073 CLEANFILES += \
4074         src/gudev/gudev-1.0.pc
4075
4076 libgudev_1_0_la_SOURCES = \
4077         src/gudev/libgudev-1.0.sym \
4078         src/gudev/gudevenums.h \
4079         src/gudev/gudevenumtypes.h \
4080         src/gudev/gudevenumtypes.h\
4081         src/gudev/gudevtypes.h \
4082         src/gudev/gudevclient.h \
4083         src/gudev/gudevclient.c \
4084         src/gudev/gudevdevice.h \
4085         src/gudev/gudevdevice.c \
4086         src/gudev/gudevenumerator.h \
4087         src/gudev/gudevenumerator.c \
4088         src/gudev/gudevprivate.h
4089
4090 nodist_libgudev_1_0_la_SOURCES = \
4091         src/gudev/gudevmarshal.h \
4092         src/gudev/gudevmarshal.c \
4093         src/gudev/gudevenumtypes.h \
4094         src/gudev/gudevenumtypes.c
4095
4096 BUILT_SOURCES += \
4097         $(nodist_libgudev_1_0_la_SOURCES)
4098
4099 libgudev_1_0_la_CPPFLAGS = \
4100         $(AM_CPPFLAGS) \
4101         -I$(top_builddir)/src\
4102         -I$(top_srcdir)/src\
4103         -I$(top_builddir)/src/gudev \
4104         -I$(top_srcdir)/src/gudev \
4105         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
4106         -D_GUDEV_COMPILATION \
4107         -DG_LOG_DOMAIN=\"GUdev\"
4108
4109 libgudev_1_0_la_CFLAGS = \
4110         $(AM_CFLAGS) \
4111         -fvisibility=default \
4112         $(GLIB_CFLAGS)
4113
4114 libgudev_1_0_la_LIBADD = \
4115         libudev.la \
4116         $(GLIB_LIBS)
4117
4118 libgudev_1_0_la_LDFLAGS = \
4119         $(AM_LDFLAGS) \
4120         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
4121         -export-dynamic \
4122         -no-undefined \
4123         -Wl,--version-script=$(top_srcdir)/src/gudev/libgudev-1.0.sym
4124
4125 src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
4126         $(AM_V_at)$(MKDIR_P) $(dir $@)
4127         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
4128
4129 src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
4130         $(AM_V_at)$(MKDIR_P) $(dir $@)
4131         $(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
4132         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
4133
4134 src/gudev/gudevenumtypes.%: src/gudev/gudevenumtypes.%.template src/gudev/gudevenums.h
4135         $(AM_V_at)$(MKDIR_P) $(dir $@)
4136         $(AM_V_GEN)glib-mkenums --template $^ > $@
4137
4138 if HAVE_INTROSPECTION
4139 -include $(INTROSPECTION_MAKEFILE)
4140
4141 src/gudev/GUdev-1.0.gir: libgudev-1.0.la
4142
4143 src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
4144
4145 src_gudev_GUdev_1_0_gir_CFLAGS = \
4146         $(AM_CFLAGS) \
4147         $(INCLUDES) \
4148         -D_GUDEV_COMPILATION \
4149         -D_GUDEV_WORK_AROUND_DEV_T_BUG \
4150         -I$(top_srcdir)/src \
4151         -I$(top_builddir)/src \
4152         -I$(top_srcdir)/src/gudev \
4153         -I$(top_builddir)/src/gudev
4154
4155 src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
4156
4157 src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
4158         --pkg-export=gudev-1.0 \
4159         --warn-all
4160
4161 src_gudev_GUdev_1_0_gir_FILES = \
4162         src/gudev/gudev.h \
4163         src/gudev/gudevtypes.h \
4164         src/gudev/gudevenums.h \
4165         src/gudev/gudevenumtypes.h \
4166         src/gudev/gudevclient.h \
4167         src/gudev/gudevdevice.h \
4168         src/gudev/gudevenumerator.h \
4169         src/gudev/gudevclient.c \
4170         src/gudev/gudevdevice.c \
4171         src/gudev/gudevenumerator.c
4172
4173 INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
4174 INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
4175
4176 girdir = $(datadir)/gir-1.0
4177 gir_DATA = \
4178         src/gudev/GUdev-1.0.gir
4179
4180 typelibsdir = $(libdir)/girepository-1.0
4181 typelibs_DATA = \
4182         src/gudev/GUdev-1.0.typelib
4183
4184 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
4185 endif # HAVE_INTROSPECTION
4186 endif
4187
4188 EXTRA_DIST += \
4189         src/gudev/gudev-1.0.pc.in \
4190         src/gudev/gudevmarshal.list \
4191         src/gudev/gudevenumtypes.h.template \
4192         src/gudev/gudevenumtypes.c.template \
4193         src/gudev/gjs-example.js \
4194         src/gudev/seed-example-enum.js \
4195         src/gudev/seed-example.js
4196
4197 # ------------------------------------------------------------------------------
4198 mtd_probe_SOURCES =  \
4199         src/udev/mtd_probe/mtd_probe.c \
4200         src/udev/mtd_probe/mtd_probe.h \
4201         src/udev/mtd_probe/probe_smartmedia.c
4202
4203 dist_udevrules_DATA += \
4204         rules/75-probe_mtd.rules
4205
4206 udevlibexec_PROGRAMS += \
4207         mtd_probe
4208
4209 # ------------------------------------------------------------------------------
4210 test_id128_SOURCES = \
4211         src/test/test-id128.c
4212
4213 test_id128_LDADD = \
4214         libsystemd-internal.la \
4215         libsystemd-shared.la
4216
4217 tests += \
4218         test-id128
4219
4220 # ------------------------------------------------------------------------------
4221
4222 rootlibexec_PROGRAMS += \
4223         systemd-activate
4224
4225 systemd_activate_SOURCES = \
4226         src/activate/activate.c
4227
4228 systemd_activate_LDADD = \
4229         libsystemd-label.la \
4230         libsystemd-internal.la \
4231         libsystemd-shared.la
4232
4233 # ------------------------------------------------------------------------------
4234 systemd_journald_SOURCES = \
4235         src/journal/journald.c \
4236         src/journal/journald-server.h
4237
4238 systemd_journald_LDADD = \
4239         libsystemd-journal-core.la \
4240         libsystemd-internal.la \
4241         libsystemd-shared.la
4242
4243 systemd_cat_SOURCES = \
4244         src/journal/cat.c
4245
4246 systemd_cat_LDADD = \
4247         libsystemd-journal-core.la
4248
4249 if HAVE_MICROHTTPD
4250 rootlibexec_PROGRAMS += \
4251         systemd-journal-remote
4252
4253 systemd_journal_remote_SOURCES = \
4254         src/journal-remote/journal-remote-parse.h \
4255         src/journal-remote/journal-remote-parse.c \
4256         src/journal-remote/journal-remote-write.h \
4257         src/journal-remote/journal-remote-write.c \
4258         src/journal-remote/journal-remote.h \
4259         src/journal-remote/journal-remote.c
4260
4261 systemd_journal_remote_LDADD = \
4262         libsystemd-internal.la \
4263         libsystemd-journal-core.la
4264
4265 systemd_journal_remote_SOURCES += \
4266         src/journal-remote/microhttpd-util.h \
4267         src/journal-remote/microhttpd-util.c
4268
4269 systemd_journal_remote_CFLAGS = \
4270         $(AM_CFLAGS) \
4271         $(MICROHTTPD_CFLAGS)
4272
4273 systemd_journal_remote_LDADD += \
4274         $(MICROHTTPD_LIBS)
4275
4276 if ENABLE_SYSUSERS
4277 dist_sysusers_DATA += \
4278         sysusers.d/systemd-remote.conf
4279 endif
4280
4281 if ENABLE_TMPFILES
4282 dist_tmpfiles_DATA += \
4283         tmpfiles.d/systemd-remote.conf
4284 endif
4285
4286 if HAVE_GNUTLS
4287 systemd_journal_remote_LDADD += \
4288         $(GNUTLS_LIBS)
4289
4290 # systemd-journal-remote make sense mostly with full crypto stack
4291 dist_systemunit_DATA += \
4292         units/systemd-journal-remote.socket
4293
4294 nodist_systemunit_DATA += \
4295         units/systemd-journal-remote.service
4296
4297 EXTRA_DIST += \
4298         units/systemd-journal-remote.service.in
4299
4300 journal-remote-install-hook: journal-install-hook
4301         -$(MKDIR_P) $(DESTDIR)/var/log/journal/remote
4302         -chown 0:0 $(DESTDIR)/var/log/journal/remote
4303         -chmod 755 $(DESTDIR)/var/log/journal/remote
4304
4305 INSTALL_EXEC_HOOKS += journal-remote-install-hook
4306
4307 endif
4308
4309 nodist_pkgsysconf_DATA += \
4310         src/journal-remote/journal-remote.conf
4311
4312 EXTRA_DIST += \
4313         src/journal-remote/journal-remote.conf.in
4314
4315 CLEANFILES += \
4316         src/journal-remote/journal-remote.conf
4317 endif
4318
4319 if HAVE_LIBCURL
4320 rootlibexec_PROGRAMS += \
4321         systemd-journal-upload
4322
4323 systemd_journal_upload_SOURCES = \
4324         src/journal-remote/journal-upload.h \
4325         src/journal-remote/journal-upload.c \
4326         src/journal-remote/journal-upload-journal.c
4327
4328 systemd_journal_upload_CFLAGS = \
4329         $(AM_CFLAGS) \
4330         $(LIBCURL_CFLAGS)
4331
4332 systemd_journal_upload_LDADD = \
4333         libsystemd-internal.la \
4334         libsystemd-journal-internal.la \
4335         libsystemd-shared.la \
4336         $(LIBCURL_LIBS)
4337
4338 nodist_systemunit_DATA += \
4339         units/systemd-journal-upload.service
4340
4341 EXTRA_DIST += \
4342         units/systemd-journal-upload.service.in
4343
4344 nodist_pkgsysconf_DATA += \
4345         src/journal-remote/journal-upload.conf
4346
4347 EXTRA_DIST += \
4348         src/journal-remote/journal-upload.conf.in
4349
4350 CLEANFILES += \
4351         src/journal-remote/journal-upload.conf
4352 endif
4353
4354 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
4355 journalctl_CFLAGS = \
4356         $(AM_CFLAGS)
4357
4358 journalctl_SOURCES = \
4359         src/journal/journalctl.c
4360
4361 journalctl_LDADD = \
4362         libsystemd-journal-internal.la \
4363         libsystemd-internal.la \
4364         libsystemd-logs.la \
4365         libsystemd-shared.la
4366
4367 if HAVE_ACL
4368 journalctl_LDADD += \
4369         libsystemd-acl.la
4370 endif
4371
4372 if HAVE_QRENCODE
4373 journalctl_SOURCES += \
4374         src/journal/journal-qrcode.c \
4375         src/journal/journal-qrcode.h
4376
4377 journalctl_CFLAGS += \
4378         $(QRENCODE_CFLAGS)
4379
4380 journalctl_LDADD += \
4381         $(QRENCODE_LIBS)
4382 endif
4383
4384 test_journal_SOURCES = \
4385         src/journal/test-journal.c
4386
4387 test_journal_LDADD = \
4388         libsystemd-journal-core.la
4389
4390 test_journal_send_SOURCES = \
4391         src/journal/test-journal-send.c
4392
4393 test_journal_send_LDADD = \
4394         libsystemd-journal-core.la
4395
4396 test_journal_syslog_SOURCES = \
4397         src/journal/test-journal-syslog.c
4398
4399 test_journal_syslog_LDADD = \
4400         libsystemd-journal-core.la
4401
4402 test_journal_match_SOURCES = \
4403         src/journal/test-journal-match.c
4404
4405 test_journal_match_LDADD = \
4406         libsystemd-journal-core.la
4407
4408 test_journal_enum_SOURCES = \
4409         src/journal/test-journal-enum.c
4410
4411 test_journal_enum_LDADD = \
4412         libsystemd-journal-core.la
4413
4414 test_journal_stream_SOURCES = \
4415         src/journal/test-journal-stream.c
4416
4417 test_journal_stream_LDADD = \
4418         libsystemd-journal-core.la
4419
4420 test_journal_flush_SOURCES = \
4421         src/journal/test-journal-flush.c
4422
4423 test_journal_flush_LDADD = \
4424         libsystemd-journal-core.la
4425
4426 test_journal_init_SOURCES = \
4427         src/journal/test-journal-init.c
4428
4429 test_journal_init_LDADD = \
4430         libsystemd-journal-core.la
4431
4432 test_journal_verify_SOURCES = \
4433         src/journal/test-journal-verify.c
4434
4435 test_journal_verify_LDADD = \
4436         libsystemd-journal-core.la
4437
4438 test_journal_interleaving_SOURCES = \
4439         src/journal/test-journal-interleaving.c
4440
4441 test_journal_interleaving_LDADD = \
4442         libsystemd-journal-core.la
4443
4444 test_mmap_cache_SOURCES = \
4445         src/journal/test-mmap-cache.c
4446
4447 test_mmap_cache_LDADD = \
4448         libsystemd-journal-core.la
4449
4450 test_catalog_SOURCES = \
4451         src/journal/test-catalog.c
4452
4453 test_catalog_CPPFLAGS = \
4454         $(AM_CPPFLAGS) \
4455         -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
4456
4457 test_catalog_LDADD = \
4458         libsystemd-journal-core.la
4459
4460 test_compress_SOURCES = \
4461         src/journal/test-compress.c
4462
4463 test_compress_LDADD = \
4464         libsystemd-journal-internal.la \
4465         libsystemd-shared.la
4466
4467 test_compress_benchmark_SOURCES = \
4468         src/journal/test-compress-benchmark.c
4469
4470 test_compress_benchmark_LDADD = \
4471         libsystemd-journal-internal.la \
4472         libsystemd-shared.la
4473
4474 libsystemd_journal_core_la_SOURCES = \
4475         src/journal/journald-kmsg.c \
4476         src/journal/journald-kmsg.h \
4477         src/journal/journald-syslog.c \
4478         src/journal/journald-syslog.h \
4479         src/journal/journald-stream.c \
4480         src/journal/journald-stream.h \
4481         src/journal/journald-server.c \
4482         src/journal/journald-server.h \
4483         src/journal/journald-console.c \
4484         src/journal/journald-console.h \
4485         src/journal/journald-wall.c \
4486         src/journal/journald-wall.h \
4487         src/journal/journald-native.c \
4488         src/journal/journald-native.h \
4489         src/journal/journald-audit.c \
4490         src/journal/journald-audit.h \
4491         src/journal/journald-rate-limit.c \
4492         src/journal/journald-rate-limit.h \
4493         src/journal/journal-internal.h
4494
4495 nodist_libsystemd_journal_core_la_SOURCES = \
4496         src/journal/journald-gperf.c
4497
4498 libsystemd_journal_core_la_LIBADD = \
4499         libsystemd-journal-internal.la \
4500         libudev-internal.la \
4501         libsystemd-label.la \
4502         libsystemd-internal.la \
4503         libsystemd-shared.la
4504
4505 if HAVE_ACL
4506 libsystemd_journal_core_la_LIBADD += \
4507         libsystemd-acl.la
4508 endif
4509
4510 noinst_LTLIBRARIES += \
4511         libsystemd-journal-core.la
4512
4513 journal-install-hook:
4514         -$(MKDIR_P) $(DESTDIR)/var/log/journal
4515         -chown 0:0 $(DESTDIR)/var/log/journal
4516         -chmod 755 $(DESTDIR)/var/log/journal
4517         -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
4518         -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
4519
4520 journal-uninstall-hook:
4521         -rmdir $(DESTDIR)/var/log/journal/remote
4522         -rmdir $(DESTDIR)/var/log/journal/
4523
4524 INSTALL_EXEC_HOOKS += journal-install-hook
4525 UNINSTALL_EXEC_HOOKS += journal-uninstall-hook
4526
4527 # ------------------------------------------------------------------------------
4528 # Update catalog on installation. Do not bother if installing
4529 # in DESTDIR, since this is likely for packaging purposes.
4530 catalog-update-hook:
4531         -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
4532
4533 INSTALL_DATA_HOOKS += \
4534         catalog-update-hook
4535
4536 catalog-remove-hook:
4537         -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
4538
4539 UNINSTALL_DATA_HOOKS += \
4540         catalog-remove-hook
4541
4542 manual_tests += \
4543         test-journal-enum
4544
4545 tests += \
4546         test-journal \
4547         test-journal-send \
4548         test-journal-syslog \
4549         test-journal-match \
4550         test-journal-stream \
4551         test-journal-init \
4552         test-journal-verify \
4553         test-journal-interleaving \
4554         test-journal-flush \
4555         test-mmap-cache \
4556         test-catalog
4557
4558 if HAVE_COMPRESSION
4559 tests += \
4560         test-compress \
4561         test-compress-benchmark
4562 endif
4563
4564 pkginclude_HEADERS += \
4565         src/systemd/sd-journal.h \
4566         src/systemd/sd-messages.h \
4567         src/systemd/_sd-common.h
4568
4569 libsystemd_journal_internal_la_SOURCES = \
4570         src/journal/sd-journal.c \
4571         src/systemd/sd-journal.h \
4572         src/systemd/_sd-common.h \
4573         src/journal/journal-file.c \
4574         src/journal/journal-file.h \
4575         src/journal/journal-vacuum.c \
4576         src/journal/journal-vacuum.h \
4577         src/journal/journal-verify.c \
4578         src/journal/journal-verify.h \
4579         src/journal/lookup3.c \
4580         src/journal/lookup3.h \
4581         src/journal/journal-send.c \
4582         src/journal/journal-def.h \
4583         src/journal/compress.h \
4584         src/journal/catalog.c \
4585         src/journal/catalog.h \
4586         src/journal/mmap-cache.c \
4587         src/journal/mmap-cache.h \
4588         src/journal/compress.c
4589
4590 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
4591 libsystemd_journal_internal_la_CFLAGS = \
4592         $(AM_CFLAGS)
4593
4594 libsystemd_journal_internal_la_LIBADD = \
4595         libsystemd-label.la
4596
4597 if HAVE_XZ
4598 libsystemd_journal_internal_la_CFLAGS += \
4599         $(XZ_CFLAGS)
4600
4601 libsystemd_journal_internal_la_LIBADD += \
4602         $(XZ_LIBS)
4603 endif
4604
4605 if HAVE_LZ4
4606 libsystemd_journal_internal_la_LIBADD += \
4607         -llz4
4608 endif
4609
4610 if HAVE_GCRYPT
4611 libsystemd_journal_internal_la_SOURCES += \
4612         src/journal/journal-authenticate.c \
4613         src/journal/journal-authenticate.h \
4614         src/journal/fsprg.c \
4615         src/journal/fsprg.h
4616
4617 libsystemd_journal_internal_la_LIBADD += \
4618         $(GCRYPT_LIBS)
4619
4620 # fsprg.c is a drop-in file using void pointer arithmetic
4621 libsystemd_journal_internal_la_CFLAGS += \
4622         $(GCRYPT_CFLAGS) \
4623         -Wno-pointer-arith
4624 endif
4625
4626 noinst_LTLIBRARIES += \
4627         libsystemd-journal-internal.la
4628
4629 rootlibexec_PROGRAMS += \
4630         systemd-journald
4631
4632 rootbin_PROGRAMS += \
4633         journalctl
4634
4635 bin_PROGRAMS += \
4636         systemd-cat
4637
4638 dist_systemunit_DATA += \
4639         units/systemd-journald.socket \
4640         units/systemd-journald-dev-log.socket \
4641         units/systemd-journald-audit.socket
4642
4643 nodist_systemunit_DATA += \
4644         units/systemd-journald.service \
4645         units/systemd-journal-flush.service \
4646         units/systemd-journal-catalog-update.service
4647
4648 dist_pkgsysconf_DATA += \
4649         src/journal/journald.conf
4650
4651 dist_catalog_DATA = \
4652         catalog/systemd.fr.catalog \
4653         catalog/systemd.it.catalog \
4654         catalog/systemd.pl.catalog \
4655         catalog/systemd.pt_BR.catalog \
4656         catalog/systemd.ru.catalog \
4657         catalog/systemd.catalog
4658
4659 SOCKETS_TARGET_WANTS += \
4660         systemd-journald.socket \
4661         systemd-journald-dev-log.socket \
4662         systemd-journald-audit.socket
4663
4664 SYSINIT_TARGET_WANTS += \
4665         systemd-journald.service \
4666         systemd-journal-flush.service \
4667         systemd-journal-catalog-update.service
4668
4669 EXTRA_DIST += \
4670         units/systemd-journald.service.in \
4671         units/systemd-journal-flush.service.in \
4672         units/systemd-journal-catalog-update.service.in \
4673         src/journal/journald-gperf.gperf
4674
4675 CLEANFILES += \
4676         src/journal/journald-gperf.c
4677
4678 # ------------------------------------------------------------------------------
4679 if HAVE_MICROHTTPD
4680 gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
4681
4682 rootlibexec_PROGRAMS += \
4683         systemd-journal-gatewayd
4684
4685 systemd_journal_gatewayd_SOURCES = \
4686         src/journal-remote/journal-gatewayd.c \
4687         src/journal-remote/microhttpd-util.h \
4688         src/journal-remote/microhttpd-util.c
4689
4690 systemd_journal_gatewayd_LDADD = \
4691         libsystemd-logs.la \
4692         libsystemd-journal-internal.la \
4693         libsystemd-internal.la \
4694         libsystemd-shared.la \
4695         $(MICROHTTPD_LIBS)
4696
4697 if HAVE_GNUTLS
4698 systemd_journal_gatewayd_LDADD += \
4699         $(GNUTLS_LIBS)
4700 endif
4701
4702 systemd_journal_gatewayd_CFLAGS = \
4703         $(AM_CFLAGS) \
4704         $(MICROHTTPD_CFLAGS)
4705
4706 systemd_journal_gatewayd_CPPFLAGS = \
4707         $(AM_CPPFLAGS) \
4708         -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
4709
4710 dist_systemunit_DATA += \
4711         units/systemd-journal-gatewayd.socket
4712
4713 nodist_systemunit_DATA += \
4714         units/systemd-journal-gatewayd.service
4715
4716 dist_gatewayddocumentroot_DATA = \
4717         src/journal-remote/browse.html
4718
4719 endif
4720
4721 EXTRA_DIST += \
4722         units/systemd-journal-gatewayd.service.in
4723
4724 # ------------------------------------------------------------------------------
4725
4726 systemd_socket_proxyd_SOURCES = \
4727         src/socket-proxy/socket-proxyd.c
4728
4729 systemd_socket_proxyd_LDADD = \
4730         libsystemd-logs.la \
4731         libsystemd-internal.la \
4732         libsystemd-journal-internal.la \
4733         libsystemd-shared.la \
4734         libsystemd-resolve.la
4735
4736 # ------------------------------------------------------------------------------
4737 if ENABLE_COREDUMP
4738 systemd_coredump_SOURCES = \
4739         src/journal/coredump.c \
4740         src/journal/coredump-vacuum.c \
4741         src/journal/coredump-vacuum.h
4742
4743 systemd_coredump_LDADD = \
4744         libsystemd-journal-internal.la \
4745         libsystemd-label.la \
4746         libsystemd-internal.la \
4747         libsystemd-shared.la
4748
4749 if HAVE_ELFUTILS
4750 systemd_coredump_SOURCES += \
4751         src/journal/stacktrace.c \
4752         src/journal/stacktrace.h
4753
4754 systemd_coredump_LDADD += \
4755         $(ELFUTILS_LIBS)
4756 endif
4757
4758 rootlibexec_PROGRAMS += \
4759         systemd-coredump
4760
4761 dist_pkgsysconf_DATA += \
4762         src/journal/coredump.conf
4763
4764 if HAVE_ACL
4765 systemd_coredump_LDADD += \
4766         libsystemd-acl.la
4767 endif
4768
4769 coredumpctl_SOURCES = \
4770         src/journal/coredumpctl.c
4771
4772 coredumpctl_LDADD = \
4773         libsystemd-journal-internal.la \
4774         libsystemd-internal.la \
4775         libsystemd-shared.la
4776
4777 bin_PROGRAMS += \
4778         coredumpctl
4779
4780 manual_tests += \
4781         test-coredump-vacuum
4782
4783 test_coredump_vacuum_SOURCES = \
4784         src/journal/test-coredump-vacuum.c  \
4785         src/journal/coredump-vacuum.c \
4786         src/journal/coredump-vacuum.h
4787
4788 test_coredump_vacuum_LDADD = \
4789         libsystemd-internal.la \
4790         libsystemd-shared.la
4791
4792 dist_bashcompletion_DATA += \
4793         shell-completion/bash/coredumpctl
4794
4795 dist_zshcompletion_DATA += \
4796         shell-completion/zsh/_coredumpctl
4797
4798 sysctl_DATA = \
4799         sysctl.d/50-coredump.conf
4800
4801 CLEANFILES += \
4802         sysctl.d/50-coredump.conf
4803 endif
4804
4805 EXTRA_DIST += \
4806         sysctl.d/50-coredump.conf.in
4807
4808 # ------------------------------------------------------------------------------
4809 if ENABLE_BINFMT
4810 systemd_binfmt_SOURCES = \
4811         src/binfmt/binfmt.c
4812
4813 systemd_binfmt_LDADD = \
4814         libsystemd-shared.la
4815
4816 rootlibexec_PROGRAMS += \
4817         systemd-binfmt
4818
4819 dist_systemunit_DATA += \
4820         units/proc-sys-fs-binfmt_misc.automount \
4821         units/proc-sys-fs-binfmt_misc.mount
4822
4823 nodist_systemunit_DATA += \
4824         units/systemd-binfmt.service
4825
4826 INSTALL_DIRS += \
4827         $(prefix)/lib/binfmt.d \
4828         $(sysconfdir)/binfmt.d
4829
4830 SYSINIT_TARGET_WANTS += \
4831         systemd-binfmt.service \
4832         proc-sys-fs-binfmt_misc.automount
4833
4834 endif
4835
4836 EXTRA_DIST += \
4837         units/systemd-binfmt.service.in
4838
4839 # ------------------------------------------------------------------------------
4840 if ENABLE_VCONSOLE
4841 systemd_vconsole_setup_SOURCES = \
4842         src/vconsole/vconsole-setup.c
4843
4844 systemd_vconsole_setup_LDADD = \
4845         libsystemd-shared.la
4846
4847 rootlibexec_PROGRAMS += \
4848         systemd-vconsole-setup
4849
4850 nodist_systemunit_DATA += \
4851         units/systemd-vconsole-setup.service
4852
4853 nodist_udevrules_DATA += \
4854         src/vconsole/90-vconsole.rules
4855
4856 SYSINIT_TARGET_WANTS += \
4857         systemd-vconsole-setup.service
4858
4859 CLEANFILES += \
4860         src/vconsole/90-vconsole.rules
4861 endif
4862
4863 EXTRA_DIST += \
4864         src/vconsole/90-vconsole.rules.in \
4865         units/systemd-vconsole-setup.service.in
4866
4867 # ------------------------------------------------------------------------------
4868 if ENABLE_BOOTCHART
4869 systemd_bootchart_SOURCES = \
4870         src/bootchart/bootchart.c \
4871         src/bootchart/bootchart.h \
4872         src/bootchart/store.c \
4873         src/bootchart/store.h \
4874         src/bootchart/svg.c \
4875         src/bootchart/svg.h
4876
4877 systemd_bootchart_LDADD = \
4878         libsystemd-journal-internal.la \
4879         libsystemd-shared.la
4880
4881 rootlibexec_PROGRAMS += \
4882         systemd-bootchart
4883
4884 dist_pkgsysconf_DATA += \
4885         src/bootchart/bootchart.conf
4886
4887 nodist_systemunit_DATA += \
4888         units/systemd-bootchart.service
4889
4890 EXTRA_DIST += \
4891         units/systemd-bootchart.service.in
4892
4893 CLEANFILES += \
4894         units/systemd-bootchart.service
4895 endif
4896
4897 # ------------------------------------------------------------------------------
4898 if ENABLE_QUOTACHECK
4899 rootlibexec_PROGRAMS += \
4900         systemd-quotacheck
4901
4902 nodist_systemunit_DATA += \
4903         units/systemd-quotacheck.service
4904
4905 systemd_quotacheck_SOURCES = \
4906         src/quotacheck/quotacheck.c
4907
4908 systemd_quotacheck_LDADD = \
4909         libsystemd-shared.la
4910 endif
4911
4912 EXTRA_DIST += \
4913         units/systemd-quotacheck.service.in
4914
4915 nodist_systemunit_DATA += \
4916         units/quotaon.service
4917
4918 # ------------------------------------------------------------------------------
4919 if ENABLE_RANDOMSEED
4920 rootlibexec_PROGRAMS += \
4921         systemd-random-seed
4922
4923 nodist_systemunit_DATA += \
4924         units/systemd-random-seed.service
4925
4926 systemd_random_seed_SOURCES = \
4927         src/random-seed/random-seed.c
4928
4929 systemd_random_seed_LDADD = \
4930         libsystemd-label.la \
4931         libsystemd-shared.la
4932
4933 SYSINIT_TARGET_WANTS += \
4934         systemd-random-seed.service
4935
4936 endif
4937
4938 EXTRA_DIST += \
4939         units/systemd-random-seed.service.in
4940
4941 # ------------------------------------------------------------------------------
4942 if ENABLE_BACKLIGHT
4943 rootlibexec_PROGRAMS += \
4944         systemd-backlight
4945
4946 nodist_systemunit_DATA += \
4947         units/systemd-backlight@.service
4948
4949 systemd_backlight_SOURCES = \
4950         src/backlight/backlight.c
4951
4952 systemd_backlight_LDADD = \
4953         libsystemd-label.la \
4954         libudev-internal.la \
4955         libsystemd-shared.la
4956 endif
4957
4958 EXTRA_DIST += \
4959         units/systemd-backlight@.service.in
4960
4961 # ------------------------------------------------------------------------------
4962 if ENABLE_RFKILL
4963 rootlibexec_PROGRAMS += \
4964         systemd-rfkill
4965
4966 nodist_systemunit_DATA += \
4967         units/systemd-rfkill@.service
4968
4969 systemd_rfkill_SOURCES = \
4970         src/rfkill/rfkill.c
4971
4972 systemd_rfkill_LDADD = \
4973         libsystemd-label.la \
4974         libudev-internal.la \
4975         libsystemd-shared.la
4976 endif
4977
4978 EXTRA_DIST += \
4979         units/systemd-rfkill@.service.in
4980
4981 # ------------------------------------------------------------------------------
4982 if HAVE_LIBCRYPTSETUP
4983 rootlibexec_PROGRAMS += \
4984         systemd-cryptsetup
4985
4986 systemgenerator_PROGRAMS += \
4987         systemd-cryptsetup-generator
4988
4989 dist_systemunit_DATA += \
4990         units/cryptsetup.target \
4991         units/cryptsetup-pre.target
4992
4993 systemd_cryptsetup_SOURCES = \
4994         src/cryptsetup/cryptsetup.c
4995
4996 systemd_cryptsetup_CFLAGS = \
4997         $(AM_CFLAGS) \
4998         $(LIBCRYPTSETUP_CFLAGS)
4999
5000 systemd_cryptsetup_LDADD = \
5001         libsystemd-label.la \
5002         libudev-internal.la \
5003         libsystemd-shared.la \
5004         $(LIBCRYPTSETUP_LIBS)
5005
5006 systemd_cryptsetup_generator_SOURCES = \
5007         src/cryptsetup/cryptsetup-generator.c
5008
5009 systemd_cryptsetup_generator_LDADD = \
5010         libsystemd-label.la \
5011         libsystemd-shared.la
5012
5013 SYSINIT_TARGET_WANTS += \
5014         cryptsetup.target
5015
5016 endif
5017
5018 # ------------------------------------------------------------------------------
5019 if ENABLE_HOSTNAMED
5020 systemd_hostnamed_SOURCES = \
5021         src/hostname/hostnamed.c
5022
5023 systemd_hostnamed_LDADD = \
5024         libsystemd-label.la \
5025         libsystemd-internal.la \
5026         libsystemd-shared.la
5027
5028 rootlibexec_PROGRAMS += \
5029         systemd-hostnamed
5030
5031 nodist_systemunit_DATA += \
5032         units/systemd-hostnamed.service
5033
5034 dist_systemunit_DATA_busnames += \
5035         units/org.freedesktop.hostname1.busname
5036
5037 dist_dbuspolicy_DATA += \
5038         src/hostname/org.freedesktop.hostname1.conf
5039
5040 dist_dbussystemservice_DATA += \
5041         src/hostname/org.freedesktop.hostname1.service
5042
5043 polkitpolicy_files += \
5044         src/hostname/org.freedesktop.hostname1.policy
5045
5046 SYSTEM_UNIT_ALIASES += \
5047         systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
5048
5049 BUSNAMES_TARGET_WANTS += \
5050         org.freedesktop.hostname1.busname
5051
5052 hostnamectl_SOURCES = \
5053         src/hostname/hostnamectl.c
5054
5055 hostnamectl_LDADD = \
5056         libsystemd-internal.la \
5057         libsystemd-shared.la
5058
5059 bin_PROGRAMS += \
5060         hostnamectl
5061
5062 dist_bashcompletion_DATA += \
5063         shell-completion/bash/hostnamectl
5064
5065 dist_zshcompletion_DATA += \
5066         shell-completion/zsh/_hostnamectl
5067
5068 endif
5069
5070 polkitpolicy_in_files += \
5071         src/hostname/org.freedesktop.hostname1.policy.in
5072
5073 EXTRA_DIST += \
5074         units/systemd-hostnamed.service.in
5075
5076 # ------------------------------------------------------------------------------
5077 dist_systemunit_DATA_busnames += \
5078         units/org.freedesktop.systemd1.busname
5079
5080 BUSNAMES_TARGET_WANTS += \
5081         org.freedesktop.systemd1.busname
5082
5083 # ------------------------------------------------------------------------------
5084 if ENABLE_LOCALED
5085 systemd_localed_SOURCES = \
5086         src/locale/localed.c
5087
5088 systemd_localed_LDADD = \
5089         libsystemd-label.la \
5090         libsystemd-internal.la \
5091         libsystemd-shared.la \
5092         $(XKBCOMMON_LIBS)
5093
5094 systemd_localed_CFLAGS = \
5095         $(AM_CFLAGS) \
5096         $(XKBCOMMON_CFLAGS)
5097
5098 nodist_systemunit_DATA += \
5099         units/systemd-localed.service
5100
5101 dist_systemunit_DATA_busnames += \
5102         units/org.freedesktop.locale1.busname
5103
5104 rootlibexec_PROGRAMS += \
5105         systemd-localed
5106
5107 dist_dbuspolicy_DATA += \
5108         src/locale/org.freedesktop.locale1.conf
5109
5110 dist_dbussystemservice_DATA += \
5111         src/locale/org.freedesktop.locale1.service
5112
5113 polkitpolicy_files += \
5114         src/locale/org.freedesktop.locale1.policy
5115
5116 SYSTEM_UNIT_ALIASES += \
5117         systemd-localed.service dbus-org.freedesktop.locale1.service
5118
5119 BUSNAMES_TARGET_WANTS += \
5120         org.freedesktop.locale1.busname
5121
5122 dist_pkgdata_DATA += \
5123         src/locale/kbd-model-map \
5124         src/locale/language-fallback-map
5125
5126 localectl_SOURCES = \
5127         src/locale/localectl.c
5128
5129 localectl_LDADD = \
5130         libsystemd-internal.la \
5131         libsystemd-shared.la
5132
5133 bin_PROGRAMS += \
5134         localectl
5135
5136 dist_bashcompletion_DATA += \
5137         shell-completion/bash/localectl
5138
5139 dist_zshcompletion_DATA += \
5140         shell-completion/zsh/_localectl
5141
5142 endif
5143
5144 .PHONY: update-kbd-model-map
5145
5146 polkitpolicy_in_files += \
5147         src/locale/org.freedesktop.locale1.policy.in
5148
5149 EXTRA_DIST += \
5150         units/systemd-localed.service.in
5151
5152 # ------------------------------------------------------------------------------
5153 if ENABLE_TIMEDATED
5154 systemd_timedated_SOURCES = \
5155         src/timedate/timedated.c
5156
5157 systemd_timedated_LDADD = \
5158         libsystemd-label.la \
5159         libsystemd-internal.la \
5160         libsystemd-shared.la
5161
5162 rootlibexec_PROGRAMS += \
5163         systemd-timedated
5164
5165 dist_dbussystemservice_DATA += \
5166         src/timedate/org.freedesktop.timedate1.service
5167
5168 dist_dbuspolicy_DATA += \
5169         src/timedate/org.freedesktop.timedate1.conf
5170
5171 nodist_systemunit_DATA += \
5172         units/systemd-timedated.service
5173
5174 dist_systemunit_DATA_busnames += \
5175         units/org.freedesktop.timedate1.busname
5176
5177 polkitpolicy_files += \
5178         src/timedate/org.freedesktop.timedate1.policy
5179
5180 SYSTEM_UNIT_ALIASES += \
5181         systemd-timedated.service dbus-org.freedesktop.timedate1.service
5182
5183 BUSNAMES_TARGET_WANTS += \
5184         org.freedesktop.timedate1.busname
5185
5186 timedatectl_SOURCES = \
5187         src/timedate/timedatectl.c
5188
5189 timedatectl_LDADD = \
5190         libsystemd-internal.la \
5191         libsystemd-shared.la
5192
5193 bin_PROGRAMS += \
5194         timedatectl
5195
5196 dist_bashcompletion_DATA += \
5197         shell-completion/bash/timedatectl
5198
5199 dist_zshcompletion_DATA += \
5200         shell-completion/zsh/_timedatectl
5201 endif
5202
5203 polkitpolicy_in_files += \
5204         src/timedate/org.freedesktop.timedate1.policy.in
5205
5206 EXTRA_DIST += \
5207         units/systemd-timedated.service.in
5208
5209 # ------------------------------------------------------------------------------
5210 if ENABLE_TIMESYNCD
5211 systemd_timesyncd_SOURCES = \
5212         src/timesync/timesyncd.c \
5213         src/timesync/timesyncd-manager.c \
5214         src/timesync/timesyncd-manager.h \
5215         src/timesync/timesyncd-conf.c \
5216         src/timesync/timesyncd-conf.h \
5217         src/timesync/timesyncd-server.c \
5218         src/timesync/timesyncd-server.h
5219
5220 nodist_systemd_timesyncd_SOURCES = \
5221         src/timesync/timesyncd-gperf.c
5222
5223 EXTRA_DIST += \
5224         src/timesync/timesyncd-gperf.gperf
5225
5226 CLEANFILES += \
5227         src/timesync/timesyncd-gperf.c
5228
5229 systemd_timesyncd_LDADD = \
5230         libsystemd-resolve.la \
5231         libsystemd-network.la \
5232         libsystemd-label.la \
5233         libsystemd-internal.la \
5234         libsystemd-shared.la
5235
5236 rootlibexec_PROGRAMS += \
5237         systemd-timesyncd
5238
5239 nodist_systemunit_DATA += \
5240         units/systemd-timesyncd.service
5241
5242 GENERAL_ALIASES += \
5243         $(systemunitdir)/systemd-timesyncd.service $(pkgsysconfdir)/system/sysinit.target.wants/systemd-timesyncd.service
5244
5245 EXTRA_DIST += \
5246         units/systemd-timesyncd.service.in
5247
5248 nodist_pkgsysconf_DATA += \
5249         src/timesync/timesyncd.conf
5250
5251 EXTRA_DIST += \
5252         src/timesync/timesyncd.conf.in
5253
5254 CLEANFILES += \
5255         src/timesync/timesyncd.conf
5256 endif
5257
5258 # ------------------------------------------------------------------------------
5259 if HAVE_MYHOSTNAME
5260 libnss_myhostname_la_SOURCES = \
5261         src/nss-myhostname/nss-myhostname.sym \
5262         src/nss-myhostname/nss-myhostname.c
5263
5264 libnss_myhostname_la_LDFLAGS = \
5265         $(AM_LDFLAGS) \
5266         -module \
5267         -export-dynamic \
5268         -avoid-version \
5269         -shared \
5270         -shrext .so.2 \
5271         -Wl,--version-script=$(top_srcdir)/src/nss-myhostname/nss-myhostname.sym
5272
5273 libnss_myhostname_la_LIBADD = \
5274         libsystemd-shared.la \
5275         libsystemd-internal.la
5276
5277 lib_LTLIBRARIES += \
5278         libnss_myhostname.la
5279 endif
5280
5281 # ------------------------------------------------------------------------------
5282 if ENABLE_MACHINED
5283 systemd_machined_SOURCES = \
5284         src/machine/machined.c \
5285         src/machine/machined.h
5286
5287 systemd_machined_LDADD = \
5288         libsystemd-machine-core.la
5289
5290 rootlibexec_PROGRAMS += \
5291         systemd-machined
5292
5293 libsystemd_machine_core_la_SOURCES = \
5294         src/machine/machine.c \
5295         src/machine/machine.h \
5296         src/machine/machined-dbus.c \
5297         src/machine/machine-dbus.c \
5298         src/machine/machine-dbus.h \
5299         src/machine/image-dbus.c \
5300         src/machine/image-dbus.h
5301
5302 libsystemd_machine_core_la_LIBADD = \
5303         libsystemd-label.la \
5304         libsystemd-internal.la \
5305         libudev-internal.la \
5306         libsystemd-shared.la
5307
5308 noinst_LTLIBRARIES += \
5309         libsystemd-machine-core.la
5310
5311 machinectl_SOURCES = \
5312         src/machine/machinectl.c
5313
5314 machinectl_LDADD = \
5315         libsystemd-internal.la \
5316         libsystemd-logs.la \
5317         libsystemd-journal-internal.la \
5318         libsystemd-shared.la
5319
5320 rootbin_PROGRAMS += \
5321         machinectl
5322
5323 dist_bashcompletion_DATA += \
5324         shell-completion/bash/machinectl
5325
5326 test_machine_tables_SOURCES = \
5327         src/machine/test-machine-tables.c
5328
5329 test_machine_tables_LDADD = \
5330         libsystemd-machine-core.la
5331
5332 tests += \
5333         test-machine-tables
5334
5335 nodist_systemunit_DATA += \
5336         units/systemd-machined.service
5337
5338 dist_systemunit_DATA += \
5339         units/machine.slice
5340
5341 dist_systemunit_DATA_busnames += \
5342         units/org.freedesktop.machine1.busname
5343
5344 dist_dbussystemservice_DATA += \
5345         src/machine/org.freedesktop.machine1.service
5346
5347 dist_dbuspolicy_DATA += \
5348         src/machine/org.freedesktop.machine1.conf
5349
5350 polkitpolicy_files += \
5351         src/machine/org.freedesktop.machine1.policy
5352
5353 polkitpolicy_in_files += \
5354         src/machine/org.freedesktop.machine1.policy.in
5355
5356 dist_zshcompletion_DATA += \
5357         shell-completion/zsh/_machinectl \
5358         shell-completion/zsh/_sd_machines
5359
5360 SYSTEM_UNIT_ALIASES += \
5361         systemd-machined.service dbus-org.freedesktop.machine1.service
5362
5363 BUSNAMES_TARGET_WANTS += \
5364         org.freedesktop.machine1.busname
5365
5366 EXTRA_DIST += \
5367         units/systemd-machined.service.in
5368
5369 libnss_mymachines_la_SOURCES = \
5370         src/nss-mymachines/nss-mymachines.sym \
5371         src/nss-mymachines/nss-mymachines.c
5372
5373 libnss_mymachines_la_LDFLAGS = \
5374         $(AM_LDFLAGS) \
5375         -module \
5376         -export-dynamic \
5377         -avoid-version \
5378         -shared \
5379         -shrext .so.2 \
5380         -Wl,--version-script=$(top_srcdir)/src/nss-mymachines/nss-mymachines.sym
5381
5382 libnss_mymachines_la_LIBADD = \
5383         libsystemd-shared.la \
5384         libsystemd-internal.la
5385
5386 lib_LTLIBRARIES += \
5387         libnss_mymachines.la
5388
5389 endif
5390
5391 # ------------------------------------------------------------------------------
5392 if ENABLE_IMPORTD
5393
5394 if HAVE_LIBCURL
5395 if HAVE_XZ
5396 if HAVE_ZLIB
5397 if HAVE_BZIP2
5398 if HAVE_GCRYPT
5399
5400 rootlibexec_PROGRAMS += \
5401         systemd-importd \
5402         systemd-pull
5403
5404 systemd_importd_SOURCES = \
5405         src/import/importd.c
5406
5407 systemd_importd_CFLAGS = \
5408         $(AM_CFLAGS) \
5409         -D SYSTEMD_PULL_PATH=\"$(rootlibexecdir)/systemd-pull\"
5410
5411 systemd_importd_LDADD = \
5412         libsystemd-internal.la \
5413         libsystemd-label.la \
5414         libsystemd-shared.la
5415
5416 systemd_pull_SOURCES = \
5417         src/import/pull.c \
5418         src/import/import-raw.c \
5419         src/import/import-raw.h \
5420         src/import/import-tar.c \
5421         src/import/import-tar.h \
5422         src/import/import-dkr.c \
5423         src/import/import-dkr.h \
5424         src/import/import-job.c \
5425         src/import/import-job.h \
5426         src/import/import-common.c \
5427         src/import/import-common.h \
5428         src/import/curl-util.c \
5429         src/import/curl-util.h \
5430         src/import/aufs-util.c \
5431         src/import/aufs-util.h \
5432         src/import/qcow2-util.c \
5433         src/import/qcow2-util.h
5434
5435 systemd_pull_CFLAGS = \
5436         $(AM_CFLAGS) \
5437         $(LIBCURL_CFLAGS) \
5438         $(XZ_CFLAGS) \
5439         $(ZLIB_CFLAGS) \
5440         $(GCRYPT_CFLAGS) \
5441         -D VENDOR_KEYRING_PATH=\"$(rootlibexecdir)/import-pubring.gpg\" \
5442         -D USER_KEYRING_PATH=\"$(pkgsysconfdir)/import-pubring.gpg\"
5443
5444 systemd_pull_LDADD = \
5445         libsystemd-internal.la \
5446         libsystemd-label.la \
5447         libsystemd-shared.la \
5448         $(LIBCURL_LIBS) \
5449         $(XZ_LIBS) \
5450         $(ZLIB_LIBS) \
5451         -lbz2 \
5452         $(GCRYPT_LIBS)
5453
5454 dist_rootlibexec_DATA = \
5455         src/import/import-pubring.gpg
5456
5457 nodist_systemunit_DATA += \
5458         units/systemd-importd.service
5459
5460 EXTRA_DIST += \
5461         units/systemd-importd.service.in
5462
5463 dist_systemunit_DATA_busnames += \
5464         units/org.freedesktop.import1.busname
5465
5466 BUSNAMES_TARGET_WANTS += \
5467         org.freedesktop.import1.busname
5468
5469 SYSTEM_UNIT_ALIASES += \
5470         systemd-importd.service dbus-org.freedesktop.import1.service
5471
5472 dist_dbussystemservice_DATA += \
5473         src/import/org.freedesktop.import1.service
5474
5475 dist_dbuspolicy_DATA += \
5476         src/import/org.freedesktop.import1.conf
5477
5478 polkitpolicy_files += \
5479         src/import/org.freedesktop.import1.policy
5480
5481 polkitpolicy_in_files += \
5482         src/import/org.freedesktop.import1.policy.in
5483
5484 manual_tests += \
5485         test-qcow2
5486
5487 test_qcow2_SOURCES = \
5488         src/import/test-qcow2.c \
5489         src/import/qcow2-util.c \
5490         src/import/qcow2-util.h
5491
5492 test_qcow2_CFLAGS = \
5493         $(AM_CFLAGS) \
5494         $(ZLIB_CFLAGS)
5495
5496 test_qcow2_LDADD = \
5497         libsystemd-internal.la \
5498         libsystemd-label.la \
5499         libsystemd-shared.la \
5500         $(ZLIB_LIBS)
5501
5502 endif
5503 endif
5504 endif
5505 endif
5506 endif
5507
5508 endif
5509
5510 # ------------------------------------------------------------------------------
5511 if ENABLE_RESOLVED
5512 systemd_resolved_SOURCES = \
5513         src/resolve/resolved.c \
5514         src/resolve/resolved-manager.c \
5515         src/resolve/resolved-manager.h \
5516         src/resolve/resolved-conf.c \
5517         src/resolve/resolved-conf.h \
5518         src/resolve/resolved-bus.c \
5519         src/resolve/resolved-bus.h \
5520         src/resolve/resolved-link.h \
5521         src/resolve/resolved-link.c \
5522         src/resolve/resolved-def.h \
5523         src/resolve/resolved-dns-domain.h \
5524         src/resolve/resolved-dns-domain.c \
5525         src/resolve/resolved-dns-rr.h \
5526         src/resolve/resolved-dns-rr.c \
5527         src/resolve/resolved-dns-question.h \
5528         src/resolve/resolved-dns-question.c \
5529         src/resolve/resolved-dns-answer.h \
5530         src/resolve/resolved-dns-answer.c \
5531         src/resolve/resolved-dns-packet.h \
5532         src/resolve/resolved-dns-packet.c \
5533         src/resolve/resolved-dns-query.h \
5534         src/resolve/resolved-dns-query.c \
5535         src/resolve/resolved-dns-transaction.h \
5536         src/resolve/resolved-dns-transaction.c \
5537         src/resolve/resolved-dns-scope.h \
5538         src/resolve/resolved-dns-scope.c \
5539         src/resolve/resolved-dns-server.h \
5540         src/resolve/resolved-dns-server.c \
5541         src/resolve/resolved-dns-cache.h \
5542         src/resolve/resolved-dns-cache.c \
5543         src/resolve/resolved-dns-zone.h \
5544         src/resolve/resolved-dns-zone.c \
5545         src/resolve/resolved-dns-stream.h \
5546         src/resolve/resolved-dns-stream.c \
5547         src/resolve/dns-type.c \
5548         src/resolve/dns-type.h \
5549         src/resolve/dns_type-from-name.h \
5550         src/resolve/dns_type-to-name.h
5551
5552 nodist_systemd_resolved_SOURCES = \
5553         src/resolve/resolved-gperf.c
5554
5555 EXTRA_DIST += \
5556         src/resolve/resolved-gperf.gperf \
5557         src/resolve/dns_type-from-name.gperf
5558
5559 CLEANFILES += \
5560         src/resolve/resolved-gperf.c
5561
5562 systemd_resolved_LDADD = \
5563         libsystemd-network.la \
5564         libsystemd-label.la \
5565         libsystemd-internal.la \
5566         libsystemd-shared.la \
5567         $(LIBIDN_LIBS)
5568
5569 rootlibexec_PROGRAMS += \
5570         systemd-resolved
5571
5572 nodist_systemunit_DATA += \
5573         units/systemd-resolved.service
5574
5575 dist_systemunit_DATA_busnames += \
5576         units/org.freedesktop.resolve1.busname
5577
5578 dist_dbuspolicy_DATA += \
5579         src/resolve/org.freedesktop.resolve1.conf
5580
5581 dist_dbussystemservice_DATA += \
5582         src/resolve/org.freedesktop.resolve1.service
5583
5584 EXTRA_DIST += \
5585         units/systemd-resolved.service.in
5586
5587 SYSTEM_UNIT_ALIASES += \
5588         systemd-resolved.service dbus-org.freedesktop.resolve1.service
5589
5590 BUSNAMES_TARGET_WANTS += \
5591         org.freedesktop.resolve1.busname
5592
5593 GENERAL_ALIASES += \
5594         $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service
5595
5596 nodist_pkgsysconf_DATA += \
5597         src/resolve/resolved.conf
5598
5599 EXTRA_DIST += \
5600         src/resolve/resolved.conf.in
5601
5602 CLEANFILES += \
5603         src/resolve/resolved.conf
5604
5605 tests += \
5606         test-dns-domain
5607
5608 test_dns_domain_SOURCES = \
5609         src/resolve/resolved-dns-domain.h \
5610         src/resolve/resolved-dns-domain.c \
5611         src/resolve/test-dns-domain.c
5612
5613 test_dns_domain_LDADD = \
5614         libsystemd-network.la \
5615         libsystemd-label.la \
5616         libsystemd-internal.la \
5617         libsystemd-shared.la \
5618         $(LIBIDN_LIBS)
5619
5620 libnss_resolve_la_SOURCES = \
5621         src/nss-resolve/nss-resolve.sym \
5622         src/nss-resolve/nss-resolve.c
5623
5624 libnss_resolve_la_LDFLAGS = \
5625         $(AM_LDFLAGS) \
5626         -module \
5627         -export-dynamic \
5628         -avoid-version \
5629         -shared \
5630         -shrext .so.2 \
5631         -Wl,--version-script=$(top_srcdir)/src/nss-resolve/nss-resolve.sym
5632
5633 libnss_resolve_la_LIBADD = \
5634         libsystemd-internal.la \
5635         libsystemd-shared.la
5636
5637 lib_LTLIBRARIES += \
5638         libnss_resolve.la
5639
5640 systemd_resolve_host_SOURCES = \
5641         src/resolve-host/resolve-host.c \
5642         src/resolve/resolved-dns-packet.c \
5643         src/resolve/resolved-dns-packet.h \
5644         src/resolve/resolved-dns-rr.c \
5645         src/resolve/resolved-dns-rr.h \
5646         src/resolve/resolved-dns-answer.c \
5647         src/resolve/resolved-dns-answer.h \
5648         src/resolve/resolved-dns-question.c \
5649         src/resolve/resolved-dns-question.h \
5650         src/resolve/resolved-dns-domain.c \
5651         src/resolve/resolved-dns-domain.h \
5652         src/resolve/dns-type.c \
5653         src/resolve/dns-type.h \
5654         src/resolve/dns_type-from-name.h \
5655         src/resolve/dns_type-to-name.h
5656
5657 systemd_resolve_host_LDADD = \
5658         libsystemd-internal.la \
5659         libsystemd-shared.la \
5660         $(LIBIDN_LIBS)
5661
5662 rootlibexec_PROGRAMS += \
5663         systemd-resolve-host
5664
5665 endif
5666
5667 # ------------------------------------------------------------------------------
5668 if ENABLE_NETWORKD
5669 rootlibexec_PROGRAMS += \
5670         systemd-networkd
5671
5672 systemd_networkd_SOURCES = \
5673         src/network/networkd.c
5674
5675 systemd_networkd_LDADD = \
5676         libsystemd-networkd-core.la
5677
5678 if HAVE_LIBIPTC
5679 systemd_networkd_LDADD += \
5680         libsystemd-fw.la
5681 endif
5682
5683 noinst_LTLIBRARIES += \
5684         libsystemd-networkd-core.la
5685
5686 libsystemd_networkd_core_la_CFLAGS = \
5687         $(AM_CFLAGS)
5688
5689 libsystemd_networkd_core_la_SOURCES = \
5690         src/libsystemd-network/network-internal.h \
5691         src/network/networkd.h \
5692         src/network/networkd-link.h \
5693         src/network/networkd-netdev.h \
5694         src/network/networkd-netdev-tunnel.h \
5695         src/network/networkd-netdev-veth.h \
5696         src/network/networkd-netdev-vxlan.h \
5697         src/network/networkd-netdev-vlan.h \
5698         src/network/networkd-netdev-macvlan.h \
5699         src/network/networkd-netdev-ipvlan.h \
5700         src/network/networkd-netdev-dummy.h \
5701         src/network/networkd-netdev-tuntap.h \
5702         src/network/networkd-netdev-bond.h \
5703         src/network/networkd-netdev-bridge.h \
5704         src/network/networkd-netdev.c \
5705         src/network/networkd-netdev-tunnel.c \
5706         src/network/networkd-netdev-veth.c \
5707         src/network/networkd-netdev-vxlan.c \
5708         src/network/networkd-netdev-vlan.c \
5709         src/network/networkd-netdev-macvlan.c \
5710         src/network/networkd-netdev-ipvlan.c \
5711         src/network/networkd-netdev-dummy.c \
5712         src/network/networkd-netdev-tuntap.c \
5713         src/network/networkd-netdev-bond.c \
5714         src/network/networkd-netdev-bridge.c \
5715         src/network/networkd-link.c \
5716         src/network/networkd-link-bus.c \
5717         src/network/networkd-ipv4ll.c \
5718         src/network/networkd-dhcp4.c \
5719         src/network/networkd-dhcp6.c \
5720         src/network/networkd-network.c \
5721         src/network/networkd-network-bus.c \
5722         src/network/networkd-address.c \
5723         src/network/networkd-route.c \
5724         src/network/networkd-manager.c \
5725         src/network/networkd-manager-bus.c \
5726         src/network/networkd-fdb.c \
5727         src/network/networkd-address-pool.c
5728
5729 nodist_libsystemd_networkd_core_la_SOURCES = \
5730         src/network/networkd-network-gperf.c \
5731         src/network/networkd-netdev-gperf.c
5732
5733 libsystemd_networkd_core_la_LIBADD = \
5734         libudev-internal.la \
5735         libsystemd-internal.la \
5736         libsystemd-network.la \
5737         libsystemd-label.la \
5738         libsystemd-shared.la
5739
5740 rootlibexec_PROGRAMS += \
5741         systemd-networkd-wait-online
5742
5743 systemd_networkd_wait_online_CFLAGS = \
5744         $(AM_CFLAGS)
5745
5746 systemd_networkd_wait_online_SOURCES = \
5747         src/libsystemd-network/network-internal.h \
5748         src/network/networkd-wait-online.h \
5749         src/network/networkd-wait-online-link.h \
5750         src/network/networkd-wait-online.c \
5751         src/network/networkd-wait-online-manager.c \
5752         src/network/networkd-wait-online-link.c
5753
5754 systemd_networkd_wait_online_LDADD = \
5755         libsystemd-network.la \
5756         libudev-internal.la \
5757         libsystemd-internal.la \
5758         libsystemd-shared.la
5759
5760 rootbin_PROGRAMS += \
5761         networkctl
5762
5763 networkctl_SOURCES = \
5764         src/network/networkctl.c
5765
5766 networkctl_LDADD = \
5767         libsystemd-internal.la \
5768         libudev-internal.la \
5769         libsystemd-shared.la \
5770         libsystemd-network.la
5771
5772 test_network_SOURCES = \
5773         src/network/test-network.c
5774
5775 test_network_LDADD = \
5776         libsystemd-networkd-core.la
5777
5778 if HAVE_LIBIPTC
5779 test_network_LDADD += \
5780         libsystemd-fw.la
5781 endif
5782
5783 test_network_tables_SOURCES = \
5784         src/network/test-network-tables.c \
5785         src/shared/test-tables.h
5786
5787 test_network_tables_LDADD = \
5788         libsystemd-networkd-core.la \
5789         libudev-core.la
5790
5791 if HAVE_LIBIPTC
5792 test_network_tables_LDADD += \
5793         libsystemd-fw.la
5794 endif
5795
5796 tests += \
5797         test-network \
5798         test-network-tables
5799
5800 dist_systemunit_DATA += \
5801         units/systemd-networkd.socket
5802
5803 nodist_systemunit_DATA += \
5804         units/systemd-networkd.service \
5805         units/systemd-networkd-wait-online.service
5806
5807 dist_systemunit_DATA_busnames += \
5808         units/org.freedesktop.network1.busname
5809
5810 dist_dbussystemservice_DATA += \
5811         src/network/org.freedesktop.network1.service
5812
5813 dist_dbuspolicy_DATA += \
5814         src/network/org.freedesktop.network1.conf
5815
5816 GENERAL_ALIASES += \
5817         $(systemunitdir)/systemd-networkd.socket $(pkgsysconfdir)/system/sockets.target.wants/systemd-networkd.socket \
5818         $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \
5819         $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service
5820
5821 SYSTEM_UNIT_ALIASES += \
5822         systemd-networkd.service dbus-org.freedesktop.network1.service
5823
5824 BUSNAMES_TARGET_WANTS += \
5825         org.freedesktop.network1.busname
5826
5827 EXTRA_DIST += \
5828         src/network/networkd-network-gperf.gperf \
5829         src/network/networkd-netdev-gperf.gperf \
5830         units/systemd-networkd.service.in \
5831         units/systemd-networkd-wait-online.service.in
5832
5833 CLEANFILES += \
5834         src/network/networkd-network-gperf.c \
5835         src/network/networkd-netdev-gperf.c
5836 endif
5837
5838 # ------------------------------------------------------------------------------
5839 if ENABLE_LOGIND
5840 systemd_logind_SOURCES = \
5841         src/login/logind.c \
5842         src/login/logind.h
5843
5844 nodist_systemd_logind_SOURCES = \
5845         src/login/logind-gperf.c
5846
5847 systemd_logind_LDADD = \
5848         libsystemd-logind-core.la
5849
5850 libsystemd_logind_core_la_SOURCES = \
5851         src/login/logind-core.c \
5852         src/login/logind-device.c \
5853         src/login/logind-device.h \
5854         src/login/logind-button.c \
5855         src/login/logind-button.h \
5856         src/login/logind-action.c \
5857         src/login/logind-action.h \
5858         src/login/logind-seat.c \
5859         src/login/logind-seat.h \
5860         src/login/logind-session.c \
5861         src/login/logind-session.h \
5862         src/login/logind-session-device.c \
5863         src/login/logind-session-device.h \
5864         src/login/logind-user.c \
5865         src/login/logind-user.h \
5866         src/login/logind-inhibit.c \
5867         src/login/logind-inhibit.h \
5868         src/login/logind-dbus.c \
5869         src/login/logind-session-dbus.c \
5870         src/login/logind-seat-dbus.c \
5871         src/login/logind-user-dbus.c \
5872         src/login/logind-acl.h
5873
5874 libsystemd_logind_core_la_LIBADD = \
5875         libsystemd-label.la \
5876         libsystemd-internal.la \
5877         libudev-internal.la \
5878         libsystemd-shared.la
5879
5880 if HAVE_ACL
5881 libsystemd_logind_core_la_SOURCES += \
5882         src/login/logind-acl.c
5883
5884 libsystemd_logind_core_la_LIBADD += \
5885         libsystemd-acl.la
5886 endif
5887
5888 noinst_LTLIBRARIES += \
5889         libsystemd-logind-core.la
5890
5891 systemd_user_sessions_SOURCES = \
5892         src/login/user-sessions.c
5893
5894 systemd_user_sessions_LDADD = \
5895         libsystemd-shared.la
5896
5897 rootlibexec_PROGRAMS += \
5898         systemd-logind \
5899         systemd-user-sessions
5900
5901 loginctl_SOURCES = \
5902         src/login/loginctl.c \
5903         src/login/sysfs-show.h \
5904         src/login/sysfs-show.c
5905
5906 loginctl_LDADD = \
5907         libsystemd-internal.la \
5908         libsystemd-logs.la \
5909         libsystemd-journal-internal.la \
5910         libudev-internal.la \
5911         libsystemd-shared.la
5912
5913 rootbin_PROGRAMS += \
5914         loginctl
5915
5916 dist_bashcompletion_DATA += \
5917         shell-completion/bash/loginctl
5918
5919 dist_zshcompletion_DATA += \
5920         shell-completion/zsh/_loginctl \
5921         shell-completion/zsh/_systemd-inhibit
5922
5923 systemd_inhibit_SOURCES = \
5924         src/login/inhibit.c
5925
5926 systemd_inhibit_LDADD = \
5927         libsystemd-internal.la \
5928         libsystemd-shared.la
5929
5930 rootbin_PROGRAMS += \
5931         systemd-inhibit
5932
5933 test_login_SOURCES = \
5934         src/libsystemd/sd-login/test-login.c
5935
5936 test_login_LDADD = \
5937         libsystemd-internal.la \
5938         libsystemd-shared.la
5939
5940 test_login_shared_SOURCES = \
5941         src/login/test-login-shared.c
5942
5943 test_login_shared_LDADD = \
5944         libsystemd-internal.la \
5945         libsystemd-shared.la
5946
5947 test_inhibit_SOURCES = \
5948         src/login/test-inhibit.c
5949
5950 test_inhibit_LDADD = \
5951         libsystemd-internal.la \
5952         libsystemd-shared.la
5953
5954 test_login_tables_SOURCES = \
5955         src/login/test-login-tables.c
5956
5957 test_login_tables_LDADD = \
5958         libsystemd-logind-core.la
5959
5960 manual_tests += \
5961         test-login \
5962         test-inhibit
5963
5964 tests += \
5965         test-login-tables \
5966         test-login-shared
5967
5968 if HAVE_PAM
5969 pam_systemd_la_SOURCES = \
5970         src/login/pam_systemd.sym \
5971         src/login/pam_systemd.c
5972
5973 pam_systemd_la_CFLAGS = \
5974         $(AM_CFLAGS) \
5975         $(PAM_CFLAGS) \
5976         -fvisibility=hidden
5977
5978 pam_systemd_la_LDFLAGS = \
5979         $(AM_LDFLAGS) \
5980         -module \
5981         -export-dynamic \
5982         -avoid-version \
5983         -shared \
5984         -Wl,--version-script=$(top_srcdir)/src/login/pam_systemd.sym
5985
5986 pam_systemd_la_LIBADD = \
5987         libsystemd-internal.la \
5988         libsystemd-shared.la \
5989         $(PAM_LIBS)
5990
5991 pamlib_LTLIBRARIES = \
5992         pam_systemd.la
5993
5994 dist_pamconf_DATA = \
5995         src/login/systemd-user
5996 endif
5997
5998 nodist_systemunit_DATA += \
5999         units/systemd-logind.service \
6000         units/systemd-user-sessions.service
6001
6002 dist_systemunit_DATA += \
6003         units/user.slice
6004
6005 dist_systemunit_DATA_busnames += \
6006         units/org.freedesktop.login1.busname
6007
6008 dist_dbussystemservice_DATA += \
6009         src/login/org.freedesktop.login1.service
6010
6011 dist_dbuspolicy_DATA += \
6012         src/login/org.freedesktop.login1.conf
6013
6014 dist_pkgsysconf_DATA += \
6015         src/login/logind.conf
6016
6017 polkitpolicy_files += \
6018         src/login/org.freedesktop.login1.policy
6019
6020 INSTALL_DIRS += \
6021         $(systemdstatedir)
6022
6023 MULTI_USER_TARGET_WANTS += \
6024         systemd-logind.service \
6025         systemd-user-sessions.service
6026
6027 SYSTEM_UNIT_ALIASES += \
6028         systemd-logind.service dbus-org.freedesktop.login1.service
6029
6030 BUSNAMES_TARGET_WANTS += \
6031         org.freedesktop.login1.busname
6032
6033 dist_udevrules_DATA += \
6034         src/login/70-uaccess.rules \
6035         src/login/70-power-switch.rules
6036
6037 nodist_udevrules_DATA += \
6038         src/login/71-seat.rules \
6039         src/login/73-seat-late.rules
6040
6041 CLEANFILES += \
6042         src/login/logind-gperf.c \
6043         src/login/71-seat.rules \
6044         src/login/73-seat-late.rules
6045 endif
6046
6047 polkitpolicy_in_files += \
6048         src/login/org.freedesktop.login1.policy.in
6049
6050 EXTRA_DIST += \
6051         src/login/logind-gperf.gperf \
6052         src/login/71-seat.rules.in \
6053         src/login/73-seat-late.rules.in \
6054         units/systemd-logind.service.in \
6055         units/systemd-user-sessions.service.in
6056
6057 # ------------------------------------------------------------------------------
6058 if HAVE_PYTHON_DEVEL
6059 pkgpyexec_LTLIBRARIES = \
6060         _journal.la \
6061         id128.la \
6062         _daemon.la \
6063         _reader.la \
6064         login.la
6065
6066 _journal_la_SOURCES = \
6067         src/python-systemd/_journal.c
6068
6069 _journal_la_CFLAGS = \
6070         $(AM_CFLAGS) \
6071         -fvisibility=default \
6072         $(PYTHON_DEVEL_CFLAGS)
6073
6074 _journal_la_LDFLAGS = \
6075         $(AM_LDFLAGS) \
6076         -shared \
6077         -module \
6078         -avoid-version
6079
6080 _journal_la_LIBADD = \
6081         $(PYTHON_DEVEL_LIBS) \
6082         libsystemd.la
6083
6084 id128_la_SOURCES = \
6085         src/python-systemd/id128.c \
6086         src/python-systemd/pyutil.c \
6087         src/python-systemd/pyutil.h
6088
6089 nodist_id128_la_SOURCES = \
6090         src/python-systemd/id128-constants.h
6091
6092 id128_la_CFLAGS = \
6093         $(AM_CFLAGS) \
6094         -fvisibility=default \
6095         $(PYTHON_DEVEL_CFLAGS) \
6096         -I$(top_builddir)/src/python-systemd
6097
6098 id128_la_LDFLAGS = \
6099         $(AM_LDFLAGS) \
6100         -shared \
6101         -module \
6102         -avoid-version
6103
6104 id128_la_LIBADD = \
6105         $(PYTHON_DEVEL_LIBS) \
6106         libsystemd-shared.la \
6107         libsystemd.la
6108
6109 _daemon_la_SOURCES = \
6110         src/python-systemd/_daemon.c \
6111         src/python-systemd/pyutil.c \
6112         src/python-systemd/pyutil.h
6113
6114 _daemon_la_CFLAGS = \
6115         $(AM_CFLAGS) \
6116         -fvisibility=default \
6117         $(PYTHON_DEVEL_CFLAGS) \
6118         -I$(top_builddir)/src/python-systemd
6119
6120 _daemon_la_LDFLAGS = \
6121         $(AM_LDFLAGS) \
6122         -shared \
6123         -module \
6124         -avoid-version
6125
6126 _daemon_la_LIBADD = \
6127         $(PYTHON_DEVEL_LIBS) \
6128         libsystemd-shared.la \
6129         libsystemd.la
6130
6131 _reader_la_SOURCES = \
6132         src/python-systemd/_reader.c \
6133         src/python-systemd/pyutil.c \
6134         src/python-systemd/pyutil.h
6135
6136 _reader_la_CFLAGS = \
6137         $(AM_CFLAGS) \
6138         -fvisibility=default \
6139         $(PYTHON_DEVEL_CFLAGS)
6140
6141 _reader_la_LDFLAGS = \
6142         $(AM_LDFLAGS) \
6143         -shared \
6144         -module \
6145         -avoid-version
6146
6147 _reader_la_LIBADD = \
6148         $(PYTHON_DEVEL_LIBS) \
6149         libsystemd-shared.la \
6150         libsystemd.la
6151
6152 login_la_SOURCES = \
6153         src/python-systemd/login.c \
6154         src/python-systemd/pyutil.c \
6155         src/python-systemd/pyutil.h
6156
6157 login_la_CFLAGS = \
6158         $(AM_CFLAGS) \
6159         -fvisibility=default \
6160         $(PYTHON_DEVEL_CFLAGS)
6161
6162 login_la_LDFLAGS = \
6163         $(AM_LDFLAGS) \
6164         -shared \
6165         -module \
6166         -avoid-version
6167
6168 login_la_LIBADD = \
6169         $(PYTHON_DEVEL_LIBS) \
6170         libsystemd-shared.la \
6171         libsystemd.la
6172
6173 dist_pkgpyexec_PYTHON = \
6174         src/python-systemd/journal.py \
6175         src/python-systemd/daemon.py \
6176         src/python-systemd/__init__.py
6177
6178 src/python-systemd/id128-constants.h: src/systemd/sd-messages.h
6179         $(AM_V_at)$(MKDIR_P) $(dir $@)
6180         $(AM_V_GEN)$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
6181
6182 BUILT_SOURCES += \
6183         src/python-systemd/id128-constants.h
6184
6185 SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
6186 sphinx-%:
6187         $(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
6188         $(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/
6189         $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/html/python-systemd/
6190
6191 python-shell:
6192         $(AM_V_at)echo "Starting python with $(DESTDIR)$(pyexecdir)"
6193         $(AM_V_at)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(PYTHON)
6194
6195 destdir-sphinx: all
6196         dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
6197                 $(MAKE) DESTDIR="$$dir" install && \
6198                 $(MAKE) DESTDIR="$$dir" sphinx-html && \
6199                 rm -rf "$$dir"
6200
6201 endif
6202
6203 CLEAN_LOCAL_HOOKS += clean-sphinx
6204
6205 .PHONY: python-shell destdir-sphinx clean-sphinx clean-python
6206
6207 clean-sphinx:
6208         -rm -rf docs/html/python-systemd/
6209
6210 # Remove Python stuff, e.g. to force rebuilding for a different Python version.
6211 clean-python:
6212         -rm -rf src/python-systemd/.libs src/python-systemd/*.l[ao]
6213         -rm -f _daemon.la id128.la _journal.la login.la _reader.la
6214
6215 # ------------------------------------------------------------------------------
6216 if ENABLE_COMPAT_LIBS
6217 EXTRA_DIST += \
6218         src/compat-libs/linkwarning.h
6219
6220 libsystemd-%.c: src/compat-libs/libsystemd-%.sym
6221         $(AM_V_at)$(MKDIR_P) $(dir $@)
6222         $(AM_V_GEN)sed -r -n 's/^ +(sd_.*);/obsolete_lib(\1,$(notdir $(basename $<)));/p' <$< >$@
6223
6224 BUILT_SOURCES += \
6225         libsystemd-journal.c \
6226         libsystemd-login.c \
6227         libsystemd-id128.c \
6228         libsystemd-daemon.c
6229
6230 libsystemd_journal_la_SOURCES = \
6231         libsystemd-journal.c \
6232         src/compat-libs/libsystemd-journal.sym
6233
6234 libsystemd_journal_la_CPPFLAGS = \
6235         $(AM_CFLAGS) \
6236         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
6237
6238 libsystemd_journal_la_LDFLAGS = \
6239         $(AM_LDFLAGS) \
6240         -version-info $(LIBSYSTEMD_JOURNAL_CURRENT):$(LIBSYSTEMD_JOURNAL_REVISION):$(LIBSYSTEMD_JOURNAL_AGE) \
6241         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-journal.sym
6242
6243 libsystemd_journal_la_LIBADD = \
6244         libsystemd-journal-internal.la \
6245         libsystemd-internal.la \
6246         libsystemd-shared.la
6247
6248 libsystemd_login_la_SOURCES = \
6249         libsystemd-login.c \
6250         src/compat-libs/libsystemd-login.sym
6251
6252 libsystemd_login_la_CPPFLAGS = \
6253         $(AM_CFLAGS) \
6254         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
6255
6256 libsystemd_login_la_LDFLAGS = \
6257         $(AM_LDFLAGS) \
6258         -version-info $(LIBSYSTEMD_LOGIN_CURRENT):$(LIBSYSTEMD_LOGIN_REVISION):$(LIBSYSTEMD_LOGIN_AGE) \
6259         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-login.sym
6260
6261 libsystemd_login_la_LIBADD = \
6262         libsystemd-internal.la \
6263         libsystemd-shared.la
6264
6265 libsystemd_id128_la_SOURCES = \
6266         libsystemd-id128.c \
6267         src/compat-libs/libsystemd-id128.sym
6268
6269 libsystemd_id128_la_CPPFLAGS = \
6270         $(AM_CFLAGS) \
6271         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
6272
6273 libsystemd_id128_la_LDFLAGS = \
6274         $(AM_LDFLAGS) \
6275         -version-info $(LIBSYSTEMD_ID128_CURRENT):$(LIBSYSTEMD_ID128_REVISION):$(LIBSYSTEMD_ID128_AGE) \
6276         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-id128.sym
6277
6278 libsystemd_id128_la_LIBADD = \
6279         libsystemd-internal.la \
6280         libsystemd-shared.la
6281
6282 libsystemd_daemon_la_SOURCES = \
6283         libsystemd-daemon.c \
6284         src/compat-libs/libsystemd-daemon.sym
6285
6286 libsystemd_daemon_la_CPPFLAGS = \
6287         $(AM_CFLAGS) \
6288         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
6289
6290 libsystemd_daemon_la_LDFLAGS = \
6291         $(AM_LDFLAGS) \
6292         -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
6293         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-daemon.sym
6294
6295 libsystemd_daemon_la_LIBADD = \
6296         libsystemd-internal.la \
6297         libsystemd-shared.la
6298
6299 lib_LTLIBRARIES += \
6300         libsystemd-journal.la \
6301         libsystemd-login.la \
6302         libsystemd-id128.la \
6303         libsystemd-daemon.la
6304
6305 pkgconfiglib_DATA += \
6306         src/compat-libs/libsystemd-journal.pc \
6307         src/compat-libs/libsystemd-login.pc \
6308         src/compat-libs/libsystemd-id128.pc \
6309         src/compat-libs/libsystemd-daemon.pc
6310
6311 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
6312 compat-lib-install-hook:
6313         libname=libsystemd-login.so && $(move-to-rootlibdir)
6314         libname=libsystemd-journal.so && $(move-to-rootlibdir)
6315         libname=libsystemd-id128.so && $(move-to-rootlibdir)
6316         libname=libsystemd-daemon.so && $(move-to-rootlibdir)
6317
6318 compat-lib-uninstall-hook:
6319         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-login.so*
6320         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so*
6321         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-id128.so*
6322         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so*
6323
6324 INSTALL_EXEC_HOOKS += compat-lib-install-hook
6325 UNINSTALL_EXEC_HOOKS += compat-lib-uninstall-hook
6326 endif
6327
6328 EXTRA_DIST += \
6329         src/compat-libs/libsystemd-journal.pc.in \
6330         src/compat-libs/libsystemd-login.pc.in \
6331         src/compat-libs/libsystemd-id128.pc.in \
6332         src/compat-libs/libsystemd-daemon.pc.in
6333
6334 # ------------------------------------------------------------------------------
6335 substitutions = \
6336        '|rootlibexecdir=$(rootlibexecdir)|' \
6337        '|rootbindir=$(rootbindir)|' \
6338        '|bindir=$(bindir)|' \
6339        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
6340        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
6341        '|pkgsysconfdir=$(pkgsysconfdir)|' \
6342        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
6343        '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
6344        '|pkgdatadir=$(pkgdatadir)|' \
6345        '|systemunitdir=$(systemunitdir)|' \
6346        '|userunitdir=$(userunitdir)|' \
6347        '|systempresetdir=$(systempresetdir)|' \
6348        '|userpresetdir=$(userpresetdir)|' \
6349        '|udevhwdbdir=$(udevhwdbdir)|' \
6350        '|udevrulesdir=$(udevrulesdir)|' \
6351        '|catalogdir=$(catalogdir)|' \
6352        '|tmpfilesdir=$(tmpfilesdir)|' \
6353        '|sysusersdir=$(sysusersdir)|' \
6354        '|sysctldir=$(sysctldir)|' \
6355        '|systemgeneratordir=$(systemgeneratordir)|' \
6356        '|usergeneratordir=$(usergeneratordir)|' \
6357        '|CERTIFICATEROOT=$(CERTIFICATEROOT)|' \
6358        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
6359        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
6360        '|PACKAGE_URL=$(PACKAGE_URL)|' \
6361        '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
6362        '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
6363        '|prefix=$(prefix)|' \
6364        '|exec_prefix=$(exec_prefix)|' \
6365        '|libdir=$(libdir)|' \
6366        '|includedir=$(includedir)|' \
6367        '|VERSION=$(VERSION)|' \
6368        '|rootprefix=$(rootprefix)|' \
6369        '|udevlibexecdir=$(udevlibexecdir)|' \
6370        '|SUSHELL=$(SUSHELL)|' \
6371        '|SULOGIN=$(SULOGIN)|' \
6372        '|DEBUGTTY=$(DEBUGTTY)|' \
6373        '|KILL=$(KILL)|' \
6374        '|KMOD=$(KMOD)|' \
6375        '|MKDIR_P=$(MKDIR_P)|' \
6376        '|QUOTAON=$(QUOTAON)|' \
6377        '|QUOTACHECK=$(QUOTACHECK)|' \
6378        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
6379        '|VARLOGDIR=$(varlogdir)|' \
6380        '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
6381        '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
6382        '|PYTHON=$(PYTHON)|' \
6383        '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
6384        '|NTP_SERVERS=$(NTP_SERVERS)|' \
6385        '|DNS_SERVERS=$(DNS_SERVERS)|' \
6386        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
6387        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
6388        '|TTY_GID=$(TTY_GID)|' \
6389        '|systemsleepdir=$(systemsleepdir)|' \
6390        '|systemshutdowndir=$(systemshutdowndir)|' \
6391        '|binfmtdir=$(binfmtdir)|' \
6392        '|modulesloaddir=$(modulesloaddir)|'
6393
6394 SED_PROCESS = \
6395         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
6396         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
6397                 < $< > $@
6398
6399 units/%: units/%.in
6400         $(SED_PROCESS)
6401
6402 man/%: man/%.in
6403         $(SED_PROCESS)
6404
6405 sysctl.d/%: sysctl.d/%.in
6406         $(SED_PROCESS)
6407
6408 %.pc: %.pc.in
6409         $(SED_PROCESS)
6410
6411 %.conf: %.conf.in
6412         $(SED_PROCESS)
6413
6414 src/core/macros.%: src/core/macros.%.in
6415         $(SED_PROCESS)
6416
6417 src/%.policy.in: src/%.policy.in.in
6418         $(SED_PROCESS)
6419
6420 shell-completion/%: shell-completion/%.in
6421         $(SED_PROCESS)
6422
6423 %.rules: %.rules.in
6424         $(SED_PROCESS)
6425
6426 %.conf: %.conf.in
6427         $(SED_PROCESS)
6428
6429 %.sh: %.sh.in
6430         $(SED_PROCESS)
6431         $(AM_V_GEN)chmod +x $@
6432
6433 src/%.c: src/%.gperf
6434         $(AM_V_at)$(MKDIR_P) $(dir $@)
6435         $(AM_V_GPERF)$(GPERF) < $< > $@
6436
6437 src/%: src/%.m4
6438         $(AM_V_at)$(MKDIR_P) $(dir $@)
6439         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
6440
6441 sysusers.d/%: sysusers.d/%.m4
6442         $(AM_V_at)$(MKDIR_P) $(dir $@)
6443         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
6444
6445 tmpfiles.d/%: tmpfiles.d/%.m4
6446         $(AM_V_at)$(MKDIR_P) $(dir $@)
6447         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
6448
6449
6450 units/%: units/%.m4
6451         $(AM_V_at)$(MKDIR_P) $(dir $@)
6452         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
6453
6454 units/user/%: units/user/%.m4
6455         $(AM_V_at)$(MKDIR_P) $(dir $@)
6456         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
6457
6458 if ENABLE_POLKIT
6459 nodist_polkitpolicy_DATA = \
6460         $(polkitpolicy_files) \
6461         $(polkitpolicy_in_in_files:.policy.in.in=.policy)
6462 endif
6463
6464 EXTRA_DIST += \
6465         $(polkitpolicy_in_files) \
6466         $(polkitpolicy_in_in_files)
6467
6468 CLEANFILES += \
6469         $(nodist_systemunit_DATA) \
6470         $(nodist_userunit_DATA) \
6471         $(pkgconfiglib_DATA) \
6472         $(nodist_polkitpolicy_DATA)
6473
6474 # ------------------------------------------------------------------------------
6475 if ENABLE_MANPAGES
6476 man/custom-entities.ent: configure.ac
6477         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
6478         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
6479          printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
6480          > $@ # '
6481
6482 DISTCLEANFILES += \
6483         man/custom-entities.ent
6484
6485 XSLTPROC_FLAGS = \
6486         --nonet \
6487         --xinclude \
6488         --stringparam man.output.quietly 1 \
6489         --stringparam funcsynopsis.style ansi \
6490         --stringparam man.authors.section.enabled 0 \
6491         --stringparam man.copyright.section.enabled 0 \
6492         --stringparam systemd.version $(VERSION) \
6493         --path '$(builddir)/man:$(srcdir)/man'
6494
6495 XSLTPROC_PROCESS_MAN = \
6496         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
6497
6498 XSLTPROC_PROCESS_HTML = \
6499         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
6500
6501 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
6502         $(XSLTPROC_PROCESS_MAN)
6503
6504 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
6505         $(XSLTPROC_PROCESS_MAN)
6506
6507 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
6508         $(XSLTPROC_PROCESS_MAN)
6509
6510 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
6511         $(XSLTPROC_PROCESS_MAN)
6512
6513 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
6514         $(XSLTPROC_PROCESS_MAN)
6515
6516 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
6517         $(XSLTPROC_PROCESS_HTML)
6518
6519 define html-alias
6520         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
6521 endef
6522
6523 endif
6524
6525 EXTRA_DIST += \
6526         man/custom-html.xsl \
6527         man/custom-man.xsl
6528
6529 # ------------------------------------------------------------------------------
6530 if HAVE_SYSV_COMPAT
6531 sysvinit_DATA = \
6532         docs/sysvinit/README
6533
6534 varlog_DATA = \
6535         docs/var-log/README
6536
6537 docs/sysvinit/README: docs/sysvinit/README.in
6538         $(SED_PROCESS)
6539
6540 docs/var-log/README: docs/var-log/README.in
6541         $(SED_PROCESS)
6542
6543 CLEANFILES += \
6544         docs/sysvinit/README \
6545         docs/var-log/README
6546 endif
6547
6548 EXTRA_DIST += \
6549         docs/sysvinit/README.in \
6550         docs/var-log/README.in
6551
6552 SOCKETS_TARGET_WANTS += \
6553         systemd-initctl.socket \
6554         systemd-shutdownd.socket
6555
6556 if HAVE_UTMP
6557 if HAVE_SYSV_COMPAT
6558 RUNLEVEL1_TARGET_WANTS += \
6559         systemd-update-utmp-runlevel.service
6560 RUNLEVEL2_TARGET_WANTS += \
6561         systemd-update-utmp-runlevel.service
6562 RUNLEVEL3_TARGET_WANTS += \
6563         systemd-update-utmp-runlevel.service
6564 RUNLEVEL4_TARGET_WANTS += \
6565         systemd-update-utmp-runlevel.service
6566 RUNLEVEL5_TARGET_WANTS += \
6567         systemd-update-utmp-runlevel.service
6568 endif
6569
6570 SYSINIT_TARGET_WANTS += \
6571         systemd-update-utmp.service
6572 endif
6573
6574 SYSINIT_TARGET_WANTS += \
6575         systemd-update-done.service
6576
6577 LOCAL_FS_TARGET_WANTS += \
6578         systemd-remount-fs.service \
6579         tmp.mount
6580
6581 MULTI_USER_TARGET_WANTS += \
6582         getty.target \
6583         systemd-ask-password-wall.path
6584
6585 SYSINIT_TARGET_WANTS += \
6586         dev-hugepages.mount \
6587         dev-mqueue.mount \
6588         sys-kernel-config.mount \
6589         sys-kernel-debug.mount \
6590         sys-fs-fuse-connections.mount \
6591         systemd-sysctl.service \
6592         systemd-ask-password-console.path
6593
6594 if HAVE_SYSV_COMPAT
6595 SYSTEM_UNIT_ALIASES += \
6596         poweroff.target runlevel0.target \
6597         rescue.target runlevel1.target \
6598         multi-user.target runlevel2.target \
6599         multi-user.target runlevel3.target \
6600         multi-user.target runlevel4.target \
6601         graphical.target runlevel5.target \
6602         reboot.target runlevel6.target
6603 endif
6604
6605 SYSTEM_UNIT_ALIASES += \
6606         graphical.target default.target \
6607         reboot.target ctrl-alt-del.target \
6608         getty@.service autovt@.service
6609
6610 USER_UNIT_ALIASES += \
6611         $(systemunitdir)/shutdown.target shutdown.target \
6612         $(systemunitdir)/sockets.target sockets.target \
6613         $(systemunitdir)/timers.target timers.target \
6614         $(systemunitdir)/paths.target paths.target \
6615         $(systemunitdir)/bluetooth.target bluetooth.target \
6616         $(systemunitdir)/printer.target printer.target \
6617         $(systemunitdir)/sound.target sound.target \
6618         $(systemunitdir)/smartcard.target smartcard.target
6619
6620 if ENABLE_KDBUS
6621 USER_UNIT_ALIASES += \
6622         $(systemunitdir)/busnames.target busnames.target
6623 endif
6624
6625 GENERAL_ALIASES += \
6626         $(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
6627         $(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \
6628         $(pkgsysconfdir)/user $(sysconfdir)/xdg/systemd/user \
6629         $(dbussystemservicedir)/org.freedesktop.systemd1.service $(dbussessionservicedir)/org.freedesktop.systemd1.service
6630
6631 if HAVE_SYSV_COMPAT
6632 INSTALL_DIRS += \
6633         $(systemunitdir)/runlevel1.target.wants \
6634         $(systemunitdir)/runlevel2.target.wants \
6635         $(systemunitdir)/runlevel3.target.wants \
6636         $(systemunitdir)/runlevel4.target.wants \
6637         $(systemunitdir)/runlevel5.target.wants
6638 endif
6639
6640 INSTALL_DIRS += \
6641         $(prefix)/lib/modules-load.d \
6642         $(sysconfdir)/modules-load.d \
6643         $(prefix)/lib/systemd/network \
6644         $(sysconfdir)/systemd/network \
6645         $(prefix)/lib/sysctl.d \
6646         $(sysconfdir)/sysctl.d \
6647         $(prefix)/lib/kernel/install.d \
6648         $(sysconfdir)/kernel/install.d \
6649         $(systemshutdowndir) \
6650         $(systemsleepdir) \
6651         $(systemgeneratordir) \
6652         $(usergeneratordir) \
6653         \
6654         $(userunitdir) \
6655         $(pkgsysconfdir)/system \
6656         $(pkgsysconfdir)/system/multi-user.target.wants \
6657         $(pkgsysconfdir)/system/getty.target.wants \
6658         $(pkgsysconfdir)/user \
6659         $(dbussessionservicedir) \
6660         $(sysconfdir)/xdg/systemd
6661
6662 install-exec-hook: $(INSTALL_EXEC_HOOKS)
6663
6664 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
6665
6666 install-data-hook: $(INSTALL_DATA_HOOKS)
6667
6668 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
6669
6670 clean-local: $(CLEAN_LOCAL_HOOKS)
6671         rm -rf $(abs_srcdir)/install-tree
6672         rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
6673               $(abs_srcdir)/hwdb/iab.txt
6674
6675 DISTCHECK_CONFIGURE_FLAGS = \
6676         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
6677         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
6678         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
6679         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
6680         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
6681         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
6682         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
6683         --with-rootprefix=$$dc_install_base \
6684         --disable-split-usr \
6685         --enable-kdbus \
6686         --enable-compat-libs
6687
6688 if HAVE_SYSV_COMPAT
6689 DISTCHECK_CONFIGURE_FLAGS += \
6690         --with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
6691         --with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
6692 else
6693 DISTCHECK_CONFIGURE_FLAGS += \
6694         --with-sysvinit-path= \
6695         --with-sysvrcnd-path=
6696 endif
6697
6698 if HAVE_PYTHON
6699 DISTCHECK_CONFIGURE_FLAGS += \
6700         --with-python
6701 endif
6702
6703 if ENABLE_GTK_DOC
6704 DISTCHECK_CONFIGURE_FLAGS += \
6705         --enable-gtk-doc
6706 endif
6707
6708 #
6709 # Require python when making dist
6710 #
6711 .PHONY: dist-check-python dist-check-compat-libs dist-check-help
6712 dist-check-python:
6713 if !HAVE_PYTHON
6714         @echo "*** python and python-lxml module must be installed and enabled in order to make dist"
6715         @false
6716 endif
6717
6718 dist-check-compat-libs:
6719 if !ENABLE_COMPAT_LIBS
6720         @echo "*** compat-libs must be enabled in order to make dist"
6721         @false
6722 endif
6723
6724 dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS)
6725         for i in $(abspath $^); do                                             \
6726             if $$i  --help | grep -v 'default:' | grep -E -q '.{80}.' ; then   \
6727                 echo "$(basename $$i) --help output is too wide:";             \
6728                 $$i  --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
6729                 exit 1;                                                        \
6730             fi; done
6731
6732 dist: dist-check-python dist-check-compat-libs
6733
6734 # check "broken" platforms limited toolchains for link breakage before we release
6735 .PHONY: linkcheck
6736 linkcheck:
6737         $(MAKE) CFLAGS='-fno-lto' LDFLAGS='-Wl,-fuse-ld=gold -Wl,--as-needed -Wl,--no-gc-sections' distcheck
6738
6739 .PHONY: hwdb-update
6740 hwdb-update:
6741         ( cd $(top_srcdir)/hwdb && \
6742         wget -N http://www.linux-usb.org/usb.ids \
6743                 http://pci-ids.ucw.cz/v2.2/pci.ids \
6744                 http://standards.ieee.org/develop/regauth/oui/oui.txt \
6745                 http://standards.ieee.org/develop/regauth/iab/iab.txt && \
6746         ./ids-update.pl )
6747
6748 .PHONY: kdbus-update
6749 kdbus-update:
6750         ( cd $(top_srcdir)/src/libsystemd/sd-bus/ && \
6751         wget -N https://d-bus.googlecode.com/git/kdbus.h )
6752
6753 .PHONY: git-tag
6754 git-tag:
6755         git tag -s "v$(VERSION)" -m "systemd $(VERSION)"
6756
6757 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
6758 .PHONY: upload
6759 upload: all check dist
6760         scp systemd-$(VERSION).tar.xz $(www_target)
6761
6762 .PHONY: doc-sync
6763 doc-sync: all destdir-sphinx
6764         gtkdoc-rebase --html-dir=docs/libudev/html --online
6765         rsync -rlv --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
6766         gtkdoc-rebase --html-dir=docs/gudev/html --online
6767         rsync -rlv --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
6768         rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
6769         rsync -rlv --delete --omit-dir-times docs/html/python-systemd/ $(www_target)/python-systemd/
6770
6771 .PHONY: gardel
6772 gardel: upload
6773         scp man/*.html gardel:public/systemd-man/
6774
6775 .PHONY: lennart-fedora
6776 lennart-fedora:
6777         cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
6778
6779 .PHONY: install-tree
6780 install-tree: all
6781         rm -rf $(abs_srcdir)/install-tree
6782         $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
6783         tree $(abs_srcdir)/install-tree
6784
6785 # Let's run all tests of the test suite, but under valgrind. Let's
6786 # exclude the one perl script we have in there
6787 .PHONY: valgrind-tests
6788 valgrind-tests: $(TESTS)
6789         $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
6790                 if file $$f | grep -q shell; then \
6791                 echo -e "$${x}Skipping non-binary $$f"; else \
6792                 echo -e "$${x}Running $$f"; \
6793                 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
6794                 x="\n\n"; \
6795         done
6796
6797 exported-%: %
6798         $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
6799
6800 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
6801         $(AM_V_GEN)cat $^ > $@
6802
6803 .PHONY: check-api-docs
6804 check-api-docs: exported man
6805         $(AM_V_GEN)for symbol in `cat exported` ; do \
6806                 if test -f $(builddir)/man/$$symbol.html ; then \
6807                         echo "  Symbol $$symbol() is documented." ; \
6808                 else \
6809                         echo "‣ Symbol $$symbol() lacks documentation." ; \
6810                 fi ; \
6811         done
6812
6813 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
6814 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
6815
6816 undefined defined: $(ALL_OBJECTS)
6817         $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
6818                 $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
6819         done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
6820
6821 CLEANFILES += \
6822         defined \
6823         undefined
6824
6825 .PHONY: check-api-unused
6826 check-api-unused: defined undefined exported
6827         ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
6828
6829 .PHONY: check-includes
6830 check-includes: $(top_srcdir)/tools/check-includes.pl
6831         $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
6832                 | xargs $(top_srcdir)/tools/check-includes.pl
6833
6834 EXTRA_DIST += \
6835         $(top_srcdir)/tools/check-includes.pl
6836
6837 # Stupid test that everything purported to be exported really is
6838 define generate-sym-test
6839         $(AM_V_at)$(MKDIR_P) $(dir $@)
6840         $(AM_V_at)printf '#include <stdio.h>\n' > $@
6841         $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
6842         $(AM_V_at)printf 'void* functions[] = {\n' >> $@
6843         $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
6844         $(AM_V_at)printf '};\nint main(void) {\n' >> $@
6845         $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
6846         $(AM_V_at)printf 'return 0; }\n' >> $@
6847 endef
6848
6849 test-libsystemd-sym.c: \
6850                 $(top_builddir)/src/libsystemd/libsystemd.sym \
6851                 src/systemd/sd-journal.h \
6852                 src/systemd/sd-daemon.h \
6853                 src/systemd/sd-login.h \
6854                 src/systemd/sd-bus.h \
6855                 src/systemd/sd-utf8.h \
6856                 src/systemd/sd-resolve.h \
6857                 src/systemd/sd-path.h
6858         $(generate-sym-test)
6859
6860 test-libudev-sym.c: \
6861                 src/libudev/libudev.sym \
6862                 src/udev/udev.h
6863         $(generate-sym-test)
6864
6865 test_libsystemd_sym_SOURCES = \
6866         test-libsystemd-sym.c
6867 test_libsystemd_sym_LDADD = \
6868         libsystemd.la
6869
6870 test_libudev_sym_SOURCES = \
6871         test-libudev-sym.c
6872 test_libudev_sym_CFLAGS = \
6873         $(AM_CFLAGS) \
6874         -Wno-deprecated-declarations
6875 test_libudev_sym_LDADD = \
6876         libudev.la
6877
6878 BUILT_SOURCES += \
6879         $(test_libsystemd_sym_SOURCES) \
6880         $(test_libudev_sym_SOURCES)
6881
6882 tests += \
6883         test-libsystemd-sym \
6884         test-libudev-sym
6885
6886 .PHONY: cppcheck
6887 cppcheck:
6888         cppcheck --enable=all -q $(top_srcdir)
6889
6890 # Used to extract compile flags for YCM.
6891 print-%:
6892         @echo $($*)
6893
6894 git-contrib:
6895         @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u
6896
6897 EXTRA_DIST += \
6898         tools/gdb-sd_dump_hashmaps.py
6899
6900 list-keys:
6901         gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
6902
6903 add-key:
6904         gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -