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