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