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