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