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