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