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