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