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