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