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