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