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