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