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