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