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