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