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