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