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