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