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