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