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