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