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