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