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