chiark / gitweb /
bus: add minimal locking around the memfd cache
[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 libsystemd_bus_la_CFLAGS = \
1753         $(AM_CFLAGS) \
1754         -pthread
1755
1756 noinst_LTLIBRARIES += \
1757         libsystemd-bus.la
1758
1759 tests += \
1760         test-bus-marshal \
1761         test-bus-signature \
1762         test-bus-chat \
1763         test-bus-server \
1764         test-bus-match \
1765         test-bus-kernel \
1766         test-bus-memfd \
1767         test-bus-zero-copy
1768
1769 noinst_PROGRAMS += \
1770         busctl
1771
1772 test_bus_marshal_SOURCES = \
1773         src/libsystemd-bus/test-bus-marshal.c
1774
1775 test_bus_marshal_LDADD = \
1776         libsystemd-shared.la \
1777         libsystemd-bus.la \
1778         $(GLIB_LIBS) \
1779         $(DBUS_LIBS)
1780
1781 test_bus_marshal_CFLAGS = \
1782         $(AM_CFLAGS) \
1783         $(GLIB_CFLAGS) \
1784         $(DBUS_CFLAGS)
1785
1786 test_bus_signature_SOURCES = \
1787         src/libsystemd-bus/test-bus-signature.c
1788
1789 test_bus_signature_LDADD = \
1790         libsystemd-shared.la \
1791         libsystemd-bus.la
1792
1793 test_bus_chat_SOURCES = \
1794         src/libsystemd-bus/test-bus-chat.c
1795
1796 test_bus_chat_CFLAGS = \
1797         $(AM_CFLAGS) \
1798         -pthread
1799
1800 test_bus_chat_LDADD = \
1801         libsystemd-shared.la \
1802         libsystemd-bus.la \
1803         libsystemd-id128-internal.la
1804
1805 test_bus_server_SOURCES = \
1806         src/libsystemd-bus/test-bus-server.c
1807
1808 test_bus_server_CFLAGS = \
1809         $(AM_CFLAGS) \
1810         -pthread
1811
1812 test_bus_server_LDADD = \
1813         libsystemd-shared.la \
1814         libsystemd-bus.la \
1815         libsystemd-id128-internal.la
1816
1817 test_bus_match_SOURCES = \
1818         src/libsystemd-bus/test-bus-match.c
1819
1820 test_bus_match_CFLAGS = \
1821         $(AM_CFLAGS)
1822
1823 test_bus_match_LDADD = \
1824         libsystemd-shared.la \
1825         libsystemd-bus.la \
1826         libsystemd-id128-internal.la
1827
1828 test_bus_kernel_SOURCES = \
1829         src/libsystemd-bus/test-bus-kernel.c
1830
1831 test_bus_kernel_CFLAGS = \
1832         $(AM_CFLAGS)
1833
1834 test_bus_kernel_LDADD = \
1835         libsystemd-shared.la \
1836         libsystemd-bus.la \
1837         libsystemd-id128-internal.la
1838
1839 test_bus_memfd_SOURCES = \
1840         src/libsystemd-bus/test-bus-memfd.c
1841
1842 test_bus_memfd_CFLAGS = \
1843         $(AM_CFLAGS)
1844
1845 test_bus_memfd_LDADD = \
1846         libsystemd-shared.la \
1847         libsystemd-bus.la
1848
1849 test_bus_zero_copy_SOURCES = \
1850         src/libsystemd-bus/test-bus-zero-copy.c
1851
1852 test_bus_zero_copy_CFLAGS = \
1853         $(AM_CFLAGS)
1854
1855 test_bus_zero_copy_LDADD = \
1856         libsystemd-shared.la \
1857         libsystemd-bus.la
1858
1859 busctl_SOURCES = \
1860         src/libsystemd-bus/busctl.c
1861
1862 busctl_LDADD = \
1863         libsystemd-shared.la \
1864         libsystemd-bus.la
1865
1866 # ------------------------------------------------------------------------------
1867 if ENABLE_GTK_DOC
1868 SUBDIRS += \
1869         docs/libudev
1870
1871 noinst_DATA += \
1872         docs/html/libudev \
1873         docs/html/gudev
1874 endif
1875
1876 include_HEADERS += \
1877         src/libudev/libudev.h
1878
1879 lib_LTLIBRARIES += \
1880         libudev.la
1881
1882 libudev_la_SOURCES =\
1883         src/libudev/libudev-private.h \
1884         src/libudev/libudev.c \
1885         src/libudev/libudev-list.c \
1886         src/libudev/libudev-util.c \
1887         src/libudev/libudev-device.c \
1888         src/libudev/libudev-enumerate.c \
1889         src/libudev/libudev-monitor.c \
1890         src/libudev/libudev-queue.c \
1891         src/libudev/libudev-hwdb-def.h \
1892         src/libudev/libudev-hwdb.c
1893
1894 libudev_la_CFLAGS = \
1895         $(AM_CFLAGS) \
1896         -fvisibility=hidden
1897
1898 libudev_la_LDFLAGS = \
1899         $(AM_LDFLAGS) \
1900         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
1901         -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
1902
1903 libudev_la_LIBADD = \
1904         libsystemd-shared.la \
1905         libsystemd-daemon-internal.la \
1906         libsystemd-id128-internal.la
1907
1908 pkgconfiglib_DATA += \
1909         src/libudev/libudev.pc
1910
1911 EXTRA_DIST += \
1912         src/libudev/libudev.pc.in \
1913         src/libudev/libudev.sym
1914
1915 CLEANFILES += \
1916         src/libudev/libudev.pc \
1917         docs/html/libudev \
1918         docs/html/gudev
1919
1920 docs/html/libudev:
1921         $(AM_V_at)$(MKDIR_P) $(dir $@)
1922         $(AM_V_LN)$(LN_S) -f ../libudev/html $@
1923
1924 docs/html/gudev:
1925         $(AM_V_at)$(MKDIR_P) $(dir $@)
1926         $(AM_V_LN)$(LN_S) -f ../gudev/html $@
1927
1928 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
1929 libudev-install-hook:
1930         libname=libudev.so && $(move-to-rootlibdir)
1931
1932 libudev-uninstall-hook:
1933         rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
1934
1935 INSTALL_EXEC_HOOKS += libudev-install-hook
1936 UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
1937
1938 # ------------------------------------------------------------------------------
1939 noinst_LTLIBRARIES += \
1940         libudev-private.la
1941
1942 libudev_private_la_SOURCES =\
1943         $(libudev_la_SOURCES) \
1944         src/libudev/libudev-device-private.c \
1945         src/libudev/libudev-queue-private.c
1946
1947 libudev_private_la_CFLAGS = \
1948         $(AM_CFLAGS) \
1949         -fvisibility=default
1950
1951 libudev_private_la_LIBADD = \
1952         libsystemd-shared.la
1953
1954 # ------------------------------------------------------------------------------
1955 INSTALL_DIRS += \
1956         $(sysconfdir)/udev/rules.d \
1957         $(sysconfdir)/udev/hwdb.d
1958
1959 dist_udevrules_DATA += \
1960         rules/99-systemd.rules \
1961         rules/42-usb-hid-pm.rules \
1962         rules/50-udev-default.rules \
1963         rules/60-persistent-storage-tape.rules \
1964         rules/60-persistent-serial.rules \
1965         rules/60-persistent-input.rules \
1966         rules/60-persistent-alsa.rules \
1967         rules/60-persistent-storage.rules \
1968         rules/64-btrfs.rules \
1969         rules/75-net-description.rules \
1970         rules/75-tty-description.rules \
1971         rules/78-sound-card.rules \
1972         rules/80-net-name-slot.rules \
1973         rules/95-udev-late.rules
1974
1975 dist_udevhwdb_DATA = \
1976         hwdb/20-pci-vendor-model.hwdb \
1977         hwdb/20-pci-classes.hwdb \
1978         hwdb/20-usb-vendor-model.hwdb \
1979         hwdb/20-usb-classes.hwdb \
1980         hwdb/20-bluetooth-vendor-product.hwdb \
1981         hwdb/20-acpi-vendor.hwdb \
1982         hwdb/20-OUI.hwdb
1983
1984 udevconfdir = $(sysconfdir)/udev
1985 dist_udevconf_DATA = \
1986         src/udev/udev.conf
1987
1988 sharepkgconfigdir = $(datadir)/pkgconfig
1989 sharepkgconfig_DATA = \
1990         src/udev/udev.pc
1991
1992 EXTRA_DIST += \
1993         rules/99-systemd.rules.in \
1994         src/udev/udev.pc.in
1995
1996 CLEANFILES += \
1997         rules/99-systemd.rules \
1998         src/udev/udev.pc
1999
2000 EXTRA_DIST += \
2001         units/systemd-udevd.service.in \
2002         units/systemd-udev-trigger.service.in \
2003         units/systemd-udev-settle.service.in
2004
2005 CLEANFILES += \
2006         units/systemd-udevd.service \
2007         units/systemd-udev-trigger.service \
2008         units/systemd-udev-settle.service
2009
2010 SOCKETS_TARGET_WANTS += \
2011         systemd-udevd-control.socket \
2012         systemd-udevd-kernel.socket
2013 SYSINIT_TARGET_WANTS += \
2014         systemd-udevd.service \
2015         systemd-udev-trigger.service
2016
2017 rootbin_PROGRAMS += \
2018         udevadm
2019
2020 rootlibexec_PROGRAMS += \
2021         systemd-udevd
2022
2023 noinst_LTLIBRARIES += \
2024         libudev-core.la
2025
2026 libudev_core_la_SOURCES = \
2027         src/udev/udev.h \
2028         src/udev/udev-event.c \
2029         src/udev/udev-watch.c \
2030         src/udev/udev-node.c \
2031         src/udev/udev-rules.c \
2032         src/udev/udev-ctrl.c \
2033         src/udev/udev-builtin.c \
2034         src/udev/udev-builtin-btrfs.c \
2035         src/udev/udev-builtin-hwdb.c \
2036         src/udev/udev-builtin-input_id.c \
2037         src/udev/udev-builtin-net_id.c \
2038         src/udev/udev-builtin-path_id.c \
2039         src/udev/udev-builtin-usb_id.c
2040
2041 libudev_core_la_CFLAGS = \
2042         $(AM_CFLAGS) \
2043         $(BLKID_CFLAGS) \
2044         $(KMOD_CFLAGS)
2045
2046 libudev_core_la_LIBADD = \
2047         libudev-private.la \
2048         libsystemd-label.la \
2049         libsystemd-daemon-internal.la \
2050         libsystemd-shared.la \
2051         $(BLKID_LIBS) \
2052         $(KMOD_LIBS)
2053
2054 libudev_core_la_CPPFLAGS = \
2055         $(AM_CPPFLAGS) \
2056         -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
2057
2058 if ENABLE_FIRMWARE
2059 libudev_core_la_SOURCES += \
2060         src/udev/udev-builtin-firmware.c
2061
2062 dist_udevrules_DATA += \
2063         rules/50-firmware.rules
2064 endif
2065
2066 if HAVE_KMOD
2067 libudev_core_la_SOURCES += \
2068         src/udev/udev-builtin-kmod.c
2069
2070 dist_udevrules_DATA += \
2071         rules/80-drivers.rules
2072 endif
2073
2074 if HAVE_BLKID
2075 libudev_core_la_SOURCES += \
2076         src/udev/udev-builtin-blkid.c
2077 endif
2078
2079 if HAVE_ACL
2080 libudev_core_la_SOURCES += \
2081         src/udev/udev-builtin-uaccess.c \
2082         src/login/logind-acl.c \
2083         src/login/sd-login.c
2084
2085 libudev_core_la_LIBADD += \
2086         libsystemd-acl.la
2087 endif
2088
2089 systemd_udevd_SOURCES = \
2090         src/udev/udevd.c
2091
2092 systemd_udevd_LDADD = \
2093         libudev-core.la
2094
2095 udevadm_SOURCES = \
2096         src/udev/udevadm.c \
2097         src/udev/udevadm-info.c \
2098         src/udev/udevadm-control.c \
2099         src/udev/udevadm-monitor.c \
2100         src/udev/udevadm-hwdb.c \
2101         src/udev/udevadm-settle.c \
2102         src/udev/udevadm-trigger.c \
2103         src/udev/udevadm-test.c \
2104         src/udev/udevadm-test-builtin.c
2105
2106 udevadm_LDADD = \
2107         libudev-core.la \
2108         libsystemd-shared.la
2109
2110 # Update hwdb on installation. Do not bother if installing
2111 # in DESTDIR, since this is likely for packaging purposes.
2112 hwdb-update-hook:
2113         -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update
2114
2115 INSTALL_DATA_HOOKS += \
2116         hwdb-update-hook
2117
2118 hwdb-remove-hook:
2119         -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
2120
2121 # ------------------------------------------------------------------------------
2122 TESTS += \
2123         test/udev-test.pl \
2124         test/rules-test.sh
2125
2126 manual_tests += \
2127         test-libudev \
2128         test-udev
2129
2130 test_libudev_SOURCES = \
2131         src/test/test-libudev.c
2132
2133 test_libudev_LDADD = \
2134         libsystemd-label.la \
2135         libsystemd-shared.la \
2136         libudev.la
2137
2138 test_udev_SOURCES = \
2139         src/test/test-udev.c
2140
2141 test_udev_LDADD = \
2142         libudev-core.la \
2143         libsystemd-shared.la \
2144         $(BLKID_LIBS) \
2145         $(KMOD_LIBS) \
2146         $(SELINUX_LIBS)
2147
2148 if HAVE_ACL
2149 test_udev_LDADD += \
2150         libsystemd-acl.la
2151 endif
2152
2153 check_DATA += \
2154         test/sys
2155
2156 # packed sysfs test tree
2157 test/sys:
2158         $(AM_V_at)$(MKDIR_P) $(dir $@)
2159         $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
2160
2161 test-sys-distclean:
2162         -rm -rf test/sys
2163 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
2164
2165 EXTRA_DIST += \
2166         test/sys.tar.xz \
2167         test/udev-test.pl \
2168         test/rules-test.sh \
2169         test/rule-syntax-check.py
2170
2171 # ------------------------------------------------------------------------------
2172 ata_id_SOURCES = \
2173         src/udev/ata_id/ata_id.c
2174
2175 ata_id_LDADD = \
2176         libudev-private.la \
2177         libsystemd-shared.la
2178
2179 udevlibexec_PROGRAMS += \
2180         ata_id
2181
2182 # ------------------------------------------------------------------------------
2183 cdrom_id_SOURCES = \
2184         src/udev/cdrom_id/cdrom_id.c
2185
2186 cdrom_id_LDADD = \
2187         libudev.la \
2188         libsystemd-shared.la
2189
2190 udevlibexec_PROGRAMS += \
2191         cdrom_id
2192
2193 dist_udevrules_DATA += \
2194         rules/60-cdrom_id.rules
2195
2196 # ------------------------------------------------------------------------------
2197 collect_SOURCES = \
2198         src/udev/collect/collect.c
2199
2200 collect_LDADD = \
2201         libudev-private.la
2202
2203 udevlibexec_PROGRAMS += \
2204         collect
2205
2206 # ------------------------------------------------------------------------------
2207 scsi_id_SOURCES =\
2208         src/udev/scsi_id/scsi_id.c \
2209         src/udev/scsi_id/scsi_serial.c \
2210         src/udev/scsi_id/scsi.h \
2211         src/udev/scsi_id/scsi_id.h
2212
2213 scsi_id_LDADD = \
2214         libudev-private.la \
2215         libsystemd-shared.la
2216
2217 udevlibexec_PROGRAMS += \
2218         scsi_id
2219
2220 EXTRA_DIST += \
2221         src/udev/scsi_id/README
2222
2223 # ------------------------------------------------------------------------------
2224 v4l_id_SOURCES = \
2225         src/udev/v4l_id/v4l_id.c
2226
2227 v4l_id_LDADD = \
2228         libudev.la
2229
2230 udevlibexec_PROGRAMS += \
2231         v4l_id
2232
2233 dist_udevrules_DATA += \
2234         rules/60-persistent-v4l.rules
2235
2236 # ------------------------------------------------------------------------------
2237 accelerometer_SOURCES = \
2238         src/udev/accelerometer/accelerometer.c
2239
2240 accelerometer_LDADD = \
2241         libudev.la -lm \
2242         libsystemd-shared.la
2243
2244 udevlibexec_PROGRAMS += \
2245         accelerometer
2246
2247 dist_udevrules_DATA += \
2248         rules/61-accelerometer.rules
2249
2250 # ------------------------------------------------------------------------------
2251 if ENABLE_GUDEV
2252 if ENABLE_GTK_DOC
2253 SUBDIRS += \
2254         docs/gudev
2255 endif
2256
2257 libgudev_includedir = \
2258         $(includedir)/gudev-1.0/gudev
2259
2260 libgudev_include_HEADERS = \
2261         src/gudev/gudev.h \
2262         src/gudev/gudevenums.h \
2263         src/gudev/gudevenumtypes.h \
2264         src/gudev/gudevtypes.h \
2265         src/gudev/gudevclient.h \
2266         src/gudev/gudevdevice.h \
2267         src/gudev/gudevenumerator.h
2268
2269 lib_LTLIBRARIES += libgudev-1.0.la
2270
2271 pkgconfiglib_DATA += \
2272         src/gudev/gudev-1.0.pc
2273
2274 CLEANFILES += \
2275         src/gudev/gudev-1.0.pc
2276
2277 libgudev_1_0_la_SOURCES = \
2278         src/gudev/gudevenums.h \
2279         src/gudev/gudevenumtypes.h \
2280         src/gudev/gudevenumtypes.h\
2281         src/gudev/gudevtypes.h \
2282         src/gudev/gudevclient.h \
2283         src/gudev/gudevclient.c \
2284         src/gudev/gudevdevice.h \
2285         src/gudev/gudevdevice.c \
2286         src/gudev/gudevenumerator.h \
2287         src/gudev/gudevenumerator.c \
2288         src/gudev/gudevprivate.h
2289
2290 nodist_libgudev_1_0_la_SOURCES = \
2291         src/gudev/gudevmarshal.h \
2292         src/gudev/gudevmarshal.c \
2293         src/gudev/gudevenumtypes.h \
2294         src/gudev/gudevenumtypes.c
2295
2296 BUILT_SOURCES += \
2297         $(nodist_libgudev_1_0_la_SOURCES)
2298
2299 libgudev_1_0_la_CPPFLAGS = \
2300         $(AM_CPPFLAGS) \
2301         -I$(top_builddir)/src\
2302         -I$(top_srcdir)/src\
2303         -I$(top_builddir)/src/gudev \
2304         -I$(top_srcdir)/src/gudev \
2305         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
2306         -D_GUDEV_COMPILATION \
2307         -DG_LOG_DOMAIN=\"GUdev\"
2308
2309 libgudev_1_0_la_CFLAGS = \
2310         $(AM_CFLAGS) \
2311         -fvisibility=default \
2312         $(GLIB_CFLAGS)
2313
2314 libgudev_1_0_la_LIBADD = \
2315         libudev.la \
2316         $(GLIB_LIBS)
2317
2318 libgudev_1_0_la_LDFLAGS = \
2319         $(AM_LDFLAGS) \
2320         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
2321         -export-dynamic -no-undefined \
2322         -export-symbols-regex '^g_udev_.*'
2323
2324 src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
2325         $(AM_V_at)$(MKDIR_P) $(dir $@)
2326         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
2327
2328 src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
2329         $(AM_V_at)$(MKDIR_P) $(dir $@)
2330         $(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
2331         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
2332
2333 src/gudev/gudevenumtypes.%: src/gudev/gudevenumtypes.%.template src/gudev/gudevenums.h
2334         $(AM_V_at)$(MKDIR_P) $(dir $@)
2335         $(AM_V_GEN)glib-mkenums --template $^ > $@
2336
2337 if HAVE_INTROSPECTION
2338 -include $(INTROSPECTION_MAKEFILE)
2339
2340 src/gudev/GUdev-1.0.gir: libgudev-1.0.la
2341
2342 src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
2343
2344 src_gudev_GUdev_1_0_gir_CFLAGS = \
2345         $(INCLUDES) \
2346         -D_GUDEV_COMPILATION \
2347         -D_GUDEV_WORK_AROUND_DEV_T_BUG \
2348         -I$(top_srcdir)/src \
2349         -I$(top_builddir)/src \
2350         -I$(top_srcdir)/src/gdev \
2351         -I$(top_builddir)/src/gdev
2352
2353 src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
2354
2355 src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
2356         --pkg-export=gudev-1.0 \
2357         --warn-all
2358
2359 src_gudev_GUdev_1_0_gir_FILES = \
2360         src/gudev/gudev.h \
2361         src/gudev/gudevtypes.h \
2362         src/gudev/gudevenums.h \
2363         src/gudev/gudevenumtypes.h \
2364         src/gudev/gudevclient.h \
2365         src/gudev/gudevdevice.h \
2366         src/gudev/gudevenumerator.h \
2367         src/gudev/gudevclient.c \
2368         src/gudev/gudevdevice.c \
2369         src/gudev/gudevenumerator.c
2370
2371 INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
2372 INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
2373
2374 girdir = $(datadir)/gir-1.0
2375 gir_DATA = \
2376         src/gudev/GUdev-1.0.gir
2377
2378 typelibsdir = $(libdir)/girepository-1.0
2379 typelibs_DATA = \
2380         src/gudev/GUdev-1.0.typelib
2381
2382 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
2383 endif # HAVE_INTROSPECTION
2384
2385 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2386 libgudev-install-hook:
2387         libname=libgudev-1.0.so && $(move-to-rootlibdir)
2388
2389 libgudev-uninstall-hook:
2390         rm -f $(DESTDIR)$(rootlibdir)/libgudev-1.0.so*
2391
2392 INSTALL_EXEC_HOOKS += libgudev-install-hook
2393 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-hook
2394 endif
2395
2396 EXTRA_DIST += \
2397         src/gudev/gudev-1.0.pc.in \
2398         src/gudev/gudevmarshal.list \
2399         src/gudev/gudevenumtypes.h.template \
2400         src/gudev/gudevenumtypes.c.template \
2401         src/gudev/gjs-example.js \
2402         src/gudev/seed-example-enum.js \
2403         src/gudev/seed-example.js
2404
2405 # ------------------------------------------------------------------------------
2406 if ENABLE_KEYMAP
2407 keymap_SOURCES = \
2408         src/udev/keymap/keymap.c
2409
2410 keymap_CPPFLAGS = \
2411         $(AM_CPPFLAGS) -I src/udev/keymap
2412
2413 keymap_LDADD = \
2414         libsystemd-shared.la
2415
2416 nodist_keymap_SOURCES = \
2417         src/udev/keymap/keys-from-name.h \
2418         src/udev/keymap/keys-to-name.h
2419
2420 BUILT_SOURCES += \
2421         $(nodist_keymap_SOURCES)
2422
2423 udevlibexec_PROGRAMS += \
2424         keymap
2425
2426 dist_doc_DATA += \
2427         src/udev/keymap/README.keymap.txt
2428
2429 dist_udevrules_DATA += \
2430         src/udev/keymap/95-keymap.rules \
2431         src/udev/keymap/95-keyboard-force-release.rules
2432
2433 dist_udevhome_SCRIPTS = \
2434         src/udev/keymap/findkeyboards \
2435         src/udev/keymap/keyboard-force-release.sh
2436
2437 TESTS += \
2438         src/udev/keymap/check-keymaps.sh
2439
2440 CLEANFILES += \
2441         src/udev/keymap/keys.txt \
2442         src/udev/keymap/keys-from-name.gperf \
2443         src/udev/keymap/keyboard-force-release.sh
2444
2445 udevkeymapdir = $(udevlibexecdir)/keymaps
2446 dist_udevkeymap_DATA = \
2447         keymaps/acer \
2448         keymaps/acer-aspire_5720 \
2449         keymaps/acer-aspire_8930 \
2450         keymaps/acer-aspire_5920g \
2451         keymaps/acer-aspire_6920 \
2452         keymaps/acer-travelmate_c300 \
2453         keymaps/asus \
2454         keymaps/compaq-e_evo \
2455         keymaps/dell \
2456         keymaps/dell-latitude-xt2 \
2457         keymaps/everex-xt5000 \
2458         keymaps/fujitsu-amilo_li_2732 \
2459         keymaps/fujitsu-amilo_pa_2548 \
2460         keymaps/fujitsu-amilo_pro_edition_v3505 \
2461         keymaps/fujitsu-amilo_pro_v3205 \
2462         keymaps/fujitsu-amilo_si_1520 \
2463         keymaps/fujitsu-esprimo_mobile_v5 \
2464         keymaps/fujitsu-esprimo_mobile_v6 \
2465         keymaps/genius-slimstar-320 \
2466         keymaps/hewlett-packard \
2467         keymaps/hewlett-packard-2510p_2530p \
2468         keymaps/hewlett-packard-compaq_elitebook \
2469         keymaps/hewlett-packard-pavilion \
2470         keymaps/hewlett-packard-presario-2100 \
2471         keymaps/hewlett-packard-tablet \
2472         keymaps/hewlett-packard-tx2 \
2473         keymaps/hewlett-packard_elitebook-8440p \
2474         keymaps/hewlett-packard_elitebook-8460p \
2475         keymaps/hewlett-packard-hdx9494nr \
2476         keymaps/ibm-thinkpad-usb-keyboard-trackpoint \
2477         keymaps/inventec-symphony_6.0_7.0 \
2478         keymaps/lenovo-3000 \
2479         keymaps/lenovo-ideapad \
2480         keymaps/lenovo-thinkpad-usb-keyboard-trackpoint \
2481         keymaps/lenovo-thinkpad_x6_tablet \
2482         keymaps/lenovo-thinkpad_x200_tablet \
2483         keymaps/lg-x110 \
2484         keymaps/logitech-wave \
2485         keymaps/logitech-wave-cordless \
2486         keymaps/logitech-wave-pro-cordless \
2487         keymaps/maxdata-pro_7000 \
2488         keymaps/medion-fid2060 \
2489         keymaps/medionnb-a555 \
2490         keymaps/micro-star \
2491         keymaps/module-asus-w3j \
2492         keymaps/module-ibm \
2493         keymaps/module-lenovo \
2494         keymaps/module-sony \
2495         keymaps/module-sony-old \
2496         keymaps/module-sony-vgn \
2497         keymaps/module-sony-vpc \
2498         keymaps/olpc-xo \
2499         keymaps/onkyo \
2500         keymaps/oqo-model2 \
2501         keymaps/samsung-other \
2502         keymaps/samsung-series-9 \
2503         keymaps/samsung-sq1us \
2504         keymaps/samsung-sx20s \
2505         keymaps/toshiba-satellite_a100 \
2506         keymaps/toshiba-satellite_a110 \
2507         keymaps/toshiba-satellite_m30x \
2508         keymaps/zepto-znote
2509
2510 udevkeymapforcereldir = $(udevlibexecdir)/keymaps/force-release
2511 dist_udevkeymapforcerel_DATA = \
2512         keymaps-force-release/dell-touchpad \
2513         keymaps-force-release/dell-xps \
2514         keymaps-force-release/hp-other \
2515         keymaps-force-release/samsung-other \
2516         keymaps-force-release/samsung-series-9 \
2517         keymaps-force-release/common-volume-keys
2518
2519 src/udev/keymap/keys.txt: Makefile
2520         $(AM_V_at)$(MKDIR_P) $(dir $@)
2521         $(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/' > $@
2522
2523 src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt Makefile
2524         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
2525
2526 src/udev/keymap/keys-from-name.h: src/udev/keymap/keys-from-name.gperf Makefile
2527         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@
2528
2529 src/udev/keymap/keys-to-name.h: src/udev/keymap/keys.txt Makefile
2530         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
2531 endif
2532
2533 EXTRA_DIST += \
2534         src/udev/keymap/check-keymaps.sh \
2535         src/udev/keymap/keyboard-force-release.sh.in
2536
2537 # ------------------------------------------------------------------------------
2538 mtd_probe_SOURCES =  \
2539         src/udev/mtd_probe/mtd_probe.c \
2540         src/udev/mtd_probe/mtd_probe.h \
2541         src/udev/mtd_probe/probe_smartmedia.c
2542
2543 mtd_probe_CPPFLAGS = \
2544         $(AM_CPPFLAGS)
2545
2546 dist_udevrules_DATA += \
2547         rules/75-probe_mtd.rules
2548
2549 udevlibexec_PROGRAMS += \
2550         mtd_probe
2551
2552 # ------------------------------------------------------------------------------
2553 libsystemd_id128_la_SOURCES = \
2554         src/libsystemd-id128/sd-id128.c
2555
2556 libsystemd_id128_la_CFLAGS = \
2557         $(AM_CFLAGS) \
2558         -fvisibility=hidden
2559
2560 libsystemd_id128_la_LDFLAGS = \
2561         $(AM_LDFLAGS) \
2562         -version-info $(LIBSYSTEMD_ID128_CURRENT):$(LIBSYSTEMD_ID128_REVISION):$(LIBSYSTEMD_ID128_AGE) \
2563         -Wl,--version-script=$(top_srcdir)/src/libsystemd-id128/libsystemd-id128.sym
2564
2565 libsystemd_id128_la_LIBADD = \
2566         libsystemd-shared.la \
2567         libsystemd-daemon-internal.la
2568
2569 libsystemd_id128_internal_la_SOURCES = \
2570         $(libsystemd_id128_la_SOURCES)
2571
2572 test_id128_SOURCES = \
2573         src/test/test-id128.c
2574
2575 test_id128_LDADD = \
2576         libsystemd-shared.la \
2577         libsystemd-id128-internal.la
2578
2579 tests += \
2580         test-id128
2581
2582 pkginclude_HEADERS += \
2583         src/systemd/sd-id128.h
2584
2585 lib_LTLIBRARIES += \
2586         libsystemd-id128.la
2587
2588 noinst_LTLIBRARIES += \
2589         libsystemd-id128-internal.la
2590
2591 pkgconfiglib_DATA += \
2592         src/libsystemd-id128/libsystemd-id128.pc
2593
2594 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2595 libsystemd-id128-install-hook:
2596         libname=libsystemd-id128.so && $(move-to-rootlibdir)
2597
2598 libsystemd-id128-uninstall-hook:
2599         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-id128.so*
2600
2601 INSTALL_EXEC_HOOKS += libsystemd-id128-install-hook
2602 UNINSTALL_EXEC_HOOKS += libsystemd-id128-uninstall-hook
2603
2604 EXTRA_DIST += \
2605         src/libsystemd-id128/libsystemd-id128.pc.in \
2606         src/libsystemd-id128/libsystemd-id128.sym
2607
2608 # ------------------------------------------------------------------------------
2609
2610 rootlibexec_PROGRAMS += \
2611         systemd-activate
2612
2613 systemd_activate_SOURCES = \
2614         src/activate/activate.c
2615
2616 systemd_activate_LDADD = \
2617         libsystemd-shared.la \
2618         libsystemd-daemon.la
2619
2620 # ------------------------------------------------------------------------------
2621 systemd_journald_SOURCES = \
2622         src/journal/journald.c \
2623         src/journal/journald-server.h
2624
2625 systemd_journald_LDADD = \
2626         libsystemd-journal-internal.la \
2627         libsystemd-shared.la \
2628         libsystemd-id128-internal.la
2629
2630 systemd_cat_SOURCES = \
2631         src/journal/cat.c
2632
2633 systemd_cat_LDADD = \
2634         libsystemd-shared.la \
2635         libsystemd-journal-internal.la
2636
2637 journalctl_SOURCES = \
2638         src/journal/journalctl.c
2639
2640 journalctl_CFLAGS = \
2641         $(AM_CFLAGS)
2642
2643 journalctl_LDADD = \
2644         libsystemd-shared.la \
2645         libsystemd-journal-internal.la \
2646         libsystemd-id128-internal.la \
2647         libsystemd-logs.la
2648
2649 if HAVE_ACL
2650 journalctl_LDADD += \
2651         libsystemd-acl.la
2652 endif
2653
2654 if HAVE_QRENCODE
2655 journalctl_SOURCES += \
2656         src/journal/journal-qrcode.c \
2657         src/journal/journal-qrcode.h
2658
2659 journalctl_CFLAGS += \
2660         $(QRENCODE_CFLAGS)
2661
2662 journalctl_LDADD += \
2663         $(QRENCODE_LIBS)
2664 endif
2665
2666 test_journal_SOURCES = \
2667         src/journal/test-journal.c
2668
2669 test_journal_LDADD = \
2670         libsystemd-shared.la \
2671         libsystemd-journal-internal.la \
2672         libsystemd-id128-internal.la
2673
2674 test_journal_send_SOURCES = \
2675         src/journal/test-journal-send.c
2676
2677 test_journal_send_LDADD = \
2678         libsystemd-shared.la \
2679         libsystemd-journal-internal.la \
2680         libsystemd-id128-internal.la
2681
2682 test_journal_syslog_SOURCES = \
2683         src/journal/test-journal-syslog.c
2684
2685 test_journal_syslog_LDADD = \
2686         libsystemd-journal-internal.la \
2687         libsystemd-shared.la \
2688         libsystemd-id128-internal.la
2689
2690 test_journal_match_SOURCES = \
2691         src/journal/test-journal-match.c
2692
2693 test_journal_match_LDADD = \
2694         libsystemd-shared.la \
2695         libsystemd-journal-internal.la \
2696         libsystemd-id128-internal.la
2697
2698 test_journal_enum_SOURCES = \
2699         src/journal/test-journal-enum.c
2700
2701 test_journal_enum_LDADD = \
2702         libsystemd-shared.la \
2703         libsystemd-journal-internal.la \
2704         libsystemd-id128-internal.la
2705
2706 test_journal_stream_SOURCES = \
2707         src/journal/test-journal-stream.c
2708
2709 test_journal_stream_LDADD = \
2710         libsystemd-shared.la \
2711         libsystemd-journal-internal.la \
2712         libsystemd-id128-internal.la
2713
2714 test_journal_verify_SOURCES = \
2715         src/journal/test-journal-verify.c
2716
2717 test_journal_verify_LDADD = \
2718         libsystemd-shared.la \
2719         libsystemd-journal-internal.la \
2720         libsystemd-id128-internal.la
2721
2722 test_mmap_cache_SOURCES = \
2723         src/journal/test-mmap-cache.c
2724
2725 test_mmap_cache_LDADD = \
2726         libsystemd-shared.la \
2727         libsystemd-journal-internal.la
2728
2729 test_catalog_SOURCES = \
2730         src/journal/test-catalog.c
2731
2732 test_catalog_LDADD = \
2733         libsystemd-shared.la \
2734         libsystemd-label.la \
2735         libsystemd-journal-internal.la \
2736         libsystemd-id128-internal.la
2737
2738 libsystemd_journal_la_SOURCES = \
2739         src/journal/sd-journal.c \
2740         src/systemd/sd-journal.h \
2741         src/journal/journal-file.c \
2742         src/journal/journal-file.h \
2743         src/journal/journal-vacuum.c \
2744         src/journal/journal-vacuum.h \
2745         src/journal/journal-verify.c \
2746         src/journal/journal-verify.h \
2747         src/journal/lookup3.c \
2748         src/journal/lookup3.h \
2749         src/journal/journal-send.c \
2750         src/journal/journal-def.h \
2751         src/journal/compress.h \
2752         src/journal/catalog.c \
2753         src/journal/catalog.h \
2754         src/journal/mmap-cache.c \
2755         src/journal/mmap-cache.h
2756
2757 libsystemd_journal_la_CFLAGS = \
2758         $(AM_CFLAGS) \
2759         -fvisibility=hidden
2760
2761 libsystemd_journal_la_LDFLAGS = \
2762         $(AM_LDFLAGS) \
2763         -version-info $(LIBSYSTEMD_JOURNAL_CURRENT):$(LIBSYSTEMD_JOURNAL_REVISION):$(LIBSYSTEMD_JOURNAL_AGE) \
2764         -Wl,--version-script=$(top_srcdir)/src/journal/libsystemd-journal.sym
2765
2766 libsystemd_journal_la_LIBADD = \
2767         libsystemd-shared.la \
2768         libsystemd-label.la \
2769         libsystemd-daemon-internal.la \
2770         libsystemd-id128-internal.la
2771
2772 libsystemd_journal_internal_la_SOURCES = \
2773         $(libsystemd_journal_la_SOURCES) \
2774         src/journal/journald-kmsg.c \
2775         src/journal/journald-kmsg.h \
2776         src/journal/journald-syslog.c \
2777         src/journal/journald-syslog.h \
2778         src/journal/journald-stream.c \
2779         src/journal/journald-stream.h \
2780         src/journal/journald-server.c \
2781         src/journal/journald-server.h \
2782         src/journal/journald-console.c \
2783         src/journal/journald-console.h \
2784         src/journal/journald-native.c \
2785         src/journal/journald-native.h \
2786         src/journal/journald-rate-limit.c \
2787         src/journal/journald-rate-limit.h \
2788         src/journal/journal-internal.h
2789
2790 libsystemd_journal_internal_la_CFLAGS = \
2791         $(AM_CFLAGS)
2792
2793 libsystemd_journal_internal_la_LIBADD = \
2794         libsystemd-label.la \
2795         libsystemd-audit.la \
2796         libsystemd-daemon.la \
2797         libudev.la \
2798         libsystemd-shared.la \
2799         libsystemd-label.la
2800
2801 nodist_libsystemd_journal_internal_la_SOURCES = \
2802         src/journal/journald-gperf.c
2803
2804 if ENABLE_LOGIND
2805 libsystemd_journal_internal_la_LIBADD += \
2806         libsystemd-login-internal.la
2807 endif
2808
2809 if HAVE_ACL
2810 libsystemd_journal_internal_la_LIBADD += \
2811         libsystemd-acl.la
2812 endif
2813
2814 if HAVE_XZ
2815 libsystemd_journal_la_SOURCES += \
2816         src/journal/compress.c
2817
2818 libsystemd_journal_la_CFLAGS += \
2819         $(XZ_CFLAGS)
2820
2821 libsystemd_journal_la_LIBADD += \
2822         $(XZ_LIBS)
2823
2824 libsystemd_journal_internal_la_CFLAGS += \
2825         $(XZ_CFLAGS)
2826
2827 libsystemd_journal_internal_la_LIBADD += \
2828         $(XZ_LIBS)
2829
2830 endif
2831
2832 if HAVE_GCRYPT
2833 libsystemd_journal_la_SOURCES += \
2834         src/journal/journal-authenticate.c \
2835         src/journal/journal-authenticate.h \
2836         src/journal/fsprg.c \
2837         src/journal/fsprg.h
2838
2839 libsystemd_journal_la_CFLAGS += \
2840         $(GCRYPT_CFLAGS) \
2841         -Wno-pointer-arith
2842
2843 libsystemd_journal_la_LIBADD += \
2844         $(GCRYPT_LIBS)
2845
2846 libsystemd_journal_internal_la_CFLAGS += \
2847         $(GCRYPT_CFLAGS) \
2848         -Wno-pointer-arith
2849
2850 libsystemd_journal_internal_la_LIBADD += \
2851         $(GCRYPT_LIBS)
2852 endif
2853
2854 # move lib from $(libdir) to $(rootlibdir) and update devel link, if
2855 # needed. Also, grant read access to new journal files to members of
2856 # "adm" and "wheel".
2857 libsystemd-journal-install-hook:
2858         libname=libsystemd-journal.so && $(move-to-rootlibdir)
2859         -$(MKDIR_P) $(DESTDIR)/var/log/journal
2860         -chown 0:0 $(DESTDIR)/var/log/journal
2861         -chmod 755 $(DESTDIR)/var/log/journal
2862         -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
2863         -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
2864
2865 libsystemd-journal-uninstall-hook:
2866         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so*
2867
2868 INSTALL_EXEC_HOOKS += libsystemd-journal-install-hook
2869 UNINSTALL_EXEC_HOOKS += libsystemd-journal-uninstall-hook
2870
2871 # ------------------------------------------------------------------------------
2872
2873 # Update catalog on installation. Do not bother if installing
2874 # in DESTDIR, since this is likely for packaging purposes.
2875 catalog-update-hook:
2876         -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
2877
2878 INSTALL_DATA_HOOKS += \
2879         catalog-update-hook
2880
2881 catalog-remove-hook:
2882         -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
2883
2884 UNINSTALL_DATA_HOOKS += \
2885         catalog-remove-hook
2886
2887 manual_tests += \
2888         test-journal-enum
2889
2890 tests += \
2891         test-journal \
2892         test-journal-send \
2893         test-journal-syslog \
2894         test-journal-match \
2895         test-journal-stream \
2896         test-journal-verify \
2897         test-mmap-cache \
2898         test-catalog
2899
2900 pkginclude_HEADERS += \
2901         src/systemd/sd-journal.h \
2902         src/systemd/sd-messages.h
2903
2904 lib_LTLIBRARIES += \
2905         libsystemd-journal.la
2906
2907 noinst_LTLIBRARIES += \
2908         libsystemd-journal-internal.la
2909
2910 rootlibexec_PROGRAMS += \
2911         systemd-journald
2912
2913 rootbin_PROGRAMS += \
2914         journalctl
2915
2916 bin_PROGRAMS += \
2917         systemd-cat
2918
2919 dist_systemunit_DATA += \
2920         units/systemd-journald.socket
2921
2922 nodist_systemunit_DATA += \
2923         units/systemd-journald.service \
2924         units/systemd-journal-flush.service
2925
2926 dist_pkgsysconf_DATA += \
2927         src/journal/journald.conf
2928
2929 pkgconfiglib_DATA += \
2930         src/journal/libsystemd-journal.pc
2931
2932 dist_catalog_DATA = \
2933         catalog/systemd.catalog
2934
2935 SOCKETS_TARGET_WANTS += \
2936         systemd-journald.socket
2937 SYSINIT_TARGET_WANTS += \
2938         systemd-journald.service \
2939         systemd-journal-flush.service
2940
2941 EXTRA_DIST += \
2942         src/journal/libsystemd-journal.pc.in \
2943         src/journal/libsystemd-journal.sym \
2944         units/systemd-journald.service.in \
2945         units/systemd-journal-flush.service.in \
2946         src/journal/journald-gperf.gperf
2947
2948 CLEANFILES += \
2949         src/journal/journald-gperf.c
2950
2951 # ------------------------------------------------------------------------------
2952 if HAVE_MICROHTTPD
2953 gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
2954
2955 rootlibexec_PROGRAMS += \
2956         systemd-journal-gatewayd
2957
2958 systemd_journal_gatewayd_SOURCES = \
2959         src/journal/journal-gatewayd.c \
2960         src/journal/microhttpd-util.h \
2961         src/journal/microhttpd-util.c
2962
2963 systemd_journal_gatewayd_LDADD = \
2964         libsystemd-shared.la \
2965         libsystemd-logs.la \
2966         libsystemd-journal-internal.la \
2967         libsystemd-id128-internal.la \
2968         libsystemd-daemon.la \
2969         libsystemd-bus.la \
2970         $(MICROHTTPD_LIBS)
2971
2972 systemd_journal_gatewayd_CFLAGS = \
2973         -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\" \
2974         $(AM_CFLAGS) \
2975         $(MICROHTTPD_CFLAGS)
2976
2977 dist_systemunit_DATA += \
2978         units/systemd-journal-gatewayd.socket
2979
2980 nodist_systemunit_DATA += \
2981         units/systemd-journal-gatewayd.service
2982
2983 dist_gatewayddocumentroot_DATA = \
2984         src/journal/browse.html
2985
2986 endif
2987
2988 EXTRA_DIST += \
2989         units/systemd-journal-gatewayd.service.in
2990
2991 # ------------------------------------------------------------------------------
2992 if ENABLE_COREDUMP
2993 systemd_coredump_SOURCES = \
2994         src/journal/coredump.c
2995
2996 systemd_coredump_LDADD = \
2997         libsystemd-journal-internal.la \
2998         libsystemd-label.la \
2999         libsystemd-shared.la
3000
3001 if ENABLE_LOGIND
3002 systemd_coredump_LDADD += \
3003         libsystemd-login-internal.la
3004 endif
3005
3006 rootlibexec_PROGRAMS += \
3007         systemd-coredump
3008
3009 systemd_coredumpctl_SOURCES = \
3010         src/journal/coredumpctl.c
3011
3012 systemd_coredumpctl_LDADD = \
3013         libsystemd-shared.la \
3014         libsystemd-journal.la
3015
3016 bin_PROGRAMS += \
3017         systemd-coredumpctl
3018
3019 dist_bashcompletion_DATA += \
3020         shell-completion/bash/systemd-coredumpctl
3021
3022 sysctl_DATA = \
3023         sysctl.d/50-coredump.conf
3024
3025 CLEANFILES += \
3026         sysctl.d/50-coredump.conf
3027 endif
3028
3029 EXTRA_DIST += \
3030         sysctl.d/50-coredump.conf.in
3031
3032 # ------------------------------------------------------------------------------
3033 if ENABLE_BINFMT
3034 systemd_binfmt_SOURCES = \
3035         src/binfmt/binfmt.c
3036
3037 systemd_binfmt_LDADD = \
3038         libsystemd-shared.la
3039
3040 rootlibexec_PROGRAMS += \
3041         systemd-binfmt
3042
3043 dist_systemunit_DATA += \
3044         units/proc-sys-fs-binfmt_misc.automount \
3045         units/proc-sys-fs-binfmt_misc.mount
3046
3047 nodist_systemunit_DATA += \
3048         units/systemd-binfmt.service
3049
3050 INSTALL_DIRS += \
3051         $(prefix)/lib/binfmt.d \
3052         $(sysconfdir)/binfmt.d
3053
3054 SYSINIT_TARGET_WANTS += \
3055         systemd-binfmt.service \
3056         proc-sys-fs-binfmt_misc.automount
3057
3058 endif
3059
3060 EXTRA_DIST += \
3061         units/systemd-binfmt.service.in
3062
3063 # ------------------------------------------------------------------------------
3064 if ENABLE_VCONSOLE
3065 systemd_vconsole_setup_SOURCES = \
3066         src/vconsole/vconsole-setup.c
3067
3068 systemd_vconsole_setup_LDADD = \
3069         libsystemd-shared.la
3070
3071 rootlibexec_PROGRAMS += \
3072         systemd-vconsole-setup
3073
3074 nodist_systemunit_DATA += \
3075         units/systemd-vconsole-setup.service
3076
3077 SYSINIT_TARGET_WANTS += \
3078         systemd-vconsole-setup.service
3079 endif
3080
3081 EXTRA_DIST += \
3082         units/systemd-vconsole-setup.service.in
3083
3084 # ------------------------------------------------------------------------------
3085 if ENABLE_READAHEAD
3086 systemd_readahead_SOURCES = \
3087         src/readahead/readahead.c \
3088         src/readahead/readahead-collect.c \
3089         src/readahead/readahead-replay.c \
3090         src/readahead/readahead-analyze.c \
3091         src/readahead/readahead-common.c \
3092         src/readahead/readahead-common.h
3093
3094 systemd_readahead_LDADD = \
3095         libsystemd-shared.la \
3096         libsystemd-daemon.la \
3097         libudev.la
3098
3099 dist_doc_DATA += \
3100         src/readahead/sd-readahead.c \
3101         src/systemd/sd-readahead.h
3102
3103 rootlibexec_PROGRAMS += \
3104         systemd-readahead
3105
3106 dist_systemunit_DATA += \
3107         units/systemd-readahead-drop.service \
3108         units/systemd-readahead-done.timer
3109
3110 nodist_systemunit_DATA += \
3111         units/systemd-readahead-collect.service \
3112         units/systemd-readahead-replay.service \
3113         units/systemd-readahead-done.service
3114
3115 endif
3116
3117 EXTRA_DIST += \
3118         units/systemd-readahead-collect.service.in \
3119         units/systemd-readahead-replay.service.in \
3120         units/systemd-readahead-done.service.in
3121
3122 # ------------------------------------------------------------------------------
3123 if ENABLE_BOOTCHART
3124 systemd_bootchart_SOURCES = \
3125         src/bootchart/bootchart.c \
3126         src/bootchart/bootchart.h \
3127         src/bootchart/store.c \
3128         src/bootchart/store.h \
3129         src/bootchart/svg.c \
3130         src/bootchart/svg.h
3131
3132 systemd_bootchart_LDADD = \
3133         libsystemd-shared.la \
3134         libsystemd-journal.la
3135
3136 rootlibexec_PROGRAMS += \
3137         systemd-bootchart
3138
3139 dist_pkgsysconf_DATA += \
3140         src/bootchart/bootchart.conf
3141 endif
3142
3143 # ------------------------------------------------------------------------------
3144 if ENABLE_QUOTACHECK
3145 rootlibexec_PROGRAMS += \
3146         systemd-quotacheck
3147
3148 nodist_systemunit_DATA += \
3149         units/systemd-quotacheck.service
3150
3151 systemd_quotacheck_SOURCES = \
3152         src/quotacheck/quotacheck.c
3153
3154 systemd_quotacheck_LDADD = \
3155         libsystemd-shared.la
3156 endif
3157
3158 EXTRA_DIST += \
3159         units/systemd-quotacheck.service.in
3160
3161 nodist_systemunit_DATA += \
3162         units/quotaon.service
3163
3164 # ------------------------------------------------------------------------------
3165 if ENABLE_RANDOMSEED
3166 rootlibexec_PROGRAMS += \
3167         systemd-random-seed
3168
3169 nodist_systemunit_DATA += \
3170         units/systemd-random-seed.service
3171
3172 systemd_random_seed_SOURCES = \
3173         src/random-seed/random-seed.c
3174
3175 systemd_random_seed_LDADD = \
3176         libsystemd-label.la \
3177         libsystemd-shared.la
3178
3179 SYSINIT_TARGET_WANTS += \
3180         systemd-random-seed.service
3181
3182 endif
3183
3184 EXTRA_DIST += \
3185         units/systemd-random-seed.service.in
3186
3187 # ------------------------------------------------------------------------------
3188 if HAVE_LIBCRYPTSETUP
3189 rootlibexec_PROGRAMS += \
3190         systemd-cryptsetup
3191
3192 systemgenerator_PROGRAMS += \
3193         systemd-cryptsetup-generator
3194
3195 dist_systemunit_DATA += \
3196         units/cryptsetup.target
3197
3198 systemd_cryptsetup_SOURCES = \
3199         src/cryptsetup/cryptsetup.c
3200
3201 systemd_cryptsetup_CFLAGS = \
3202         $(AM_CFLAGS) \
3203         $(LIBCRYPTSETUP_CFLAGS)
3204
3205 systemd_cryptsetup_LDADD = \
3206         libsystemd-label.la \
3207         libsystemd-shared.la \
3208         libudev.la \
3209         $(LIBCRYPTSETUP_LIBS)
3210
3211 systemd_cryptsetup_generator_SOURCES = \
3212         src/cryptsetup/cryptsetup-generator.c
3213
3214 systemd_cryptsetup_generator_LDADD = \
3215         libsystemd-label.la \
3216         libsystemd-shared.la
3217
3218 SYSINIT_TARGET_WANTS += \
3219         cryptsetup.target
3220
3221 endif
3222
3223 # ------------------------------------------------------------------------------
3224 if ENABLE_HOSTNAMED
3225 systemd_hostnamed_SOURCES = \
3226         src/hostname/hostnamed.c
3227
3228 systemd_hostnamed_CFLAGS = \
3229         $(AM_CFLAGS) \
3230         $(DBUS_CFLAGS)
3231
3232 systemd_hostnamed_LDADD = \
3233         libsystemd-label.la \
3234         libsystemd-shared.la \
3235         libsystemd-daemon.la \
3236         libsystemd-dbus.la
3237
3238 rootlibexec_PROGRAMS += \
3239         systemd-hostnamed
3240
3241 nodist_systemunit_DATA += \
3242         units/systemd-hostnamed.service
3243
3244 dist_dbuspolicy_DATA += \
3245         src/hostname/org.freedesktop.hostname1.conf
3246
3247 dist_dbussystemservice_DATA += \
3248         src/hostname/org.freedesktop.hostname1.service
3249
3250 polkitpolicy_files += \
3251         src/hostname/org.freedesktop.hostname1.policy
3252
3253 dbusinterface_DATA += \
3254         org.freedesktop.hostname1.xml
3255
3256 org.freedesktop.hostname1.xml: systemd-hostnamed
3257         $(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.hostname1 $< $@.tmp && \
3258                 $(STRINGS) $@.tmp | $(AWK) -f $(srcdir)/introspect.awk | \
3259                 $(DBUS_PREPROCESS) -o $@ - && rm $@.tmp
3260
3261 SYSTEM_UNIT_ALIASES += \
3262         systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
3263
3264 hostnamectl_SOURCES = \
3265         src/hostname/hostnamectl.c
3266
3267 hostnamectl_CFLAGS = \
3268         $(AM_CFLAGS) \
3269         $(DBUS_CFLAGS)
3270
3271 hostnamectl_LDADD = \
3272         libsystemd-shared.la \
3273         libsystemd-dbus.la \
3274         libsystemd-id128-internal.la
3275
3276 bin_PROGRAMS += \
3277         hostnamectl
3278
3279 dist_bashcompletion_DATA += \
3280         shell-completion/bash/hostnamectl
3281
3282 endif
3283
3284 polkitpolicy_in_files += \
3285         src/hostname/org.freedesktop.hostname1.policy.in
3286
3287 EXTRA_DIST += \
3288         units/systemd-hostnamed.service.in
3289
3290 # ------------------------------------------------------------------------------
3291 if ENABLE_LOCALED
3292 systemd_localed_SOURCES = \
3293         src/locale/localed.c
3294
3295 systemd_localed_CFLAGS = \
3296         $(AM_CFLAGS) \
3297         $(DBUS_CFLAGS)
3298
3299 systemd_localed_LDADD = \
3300         libsystemd-label.la \
3301         libsystemd-shared.la \
3302         libsystemd-daemon.la \
3303         libsystemd-dbus.la
3304
3305 nodist_systemunit_DATA += \
3306         units/systemd-localed.service
3307
3308 rootlibexec_PROGRAMS += \
3309         systemd-localed
3310
3311 dist_dbuspolicy_DATA += \
3312         src/locale/org.freedesktop.locale1.conf
3313
3314 dist_dbussystemservice_DATA += \
3315         src/locale/org.freedesktop.locale1.service
3316
3317 polkitpolicy_files += \
3318         src/locale/org.freedesktop.locale1.policy
3319
3320 dbusinterface_DATA += \
3321         org.freedesktop.locale1.xml
3322
3323 org.freedesktop.locale1.xml: systemd-localed
3324         $(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.locale1 $< $@.tmp && \
3325                 $(STRINGS) $@.tmp | $(AWK) -f $(srcdir)/introspect.awk | \
3326                 $(DBUS_PREPROCESS) -o $@ - && rm $@.tmp
3327
3328 SYSTEM_UNIT_ALIASES += \
3329         systemd-localed.service dbus-org.freedesktop.locale1.service
3330
3331 dist_pkgdata_DATA += \
3332         src/locale/kbd-model-map
3333
3334 dist_noinst_SCRIPT = \
3335         src/locale/generate-kbd-model-map
3336
3337 update-kbd-model-map: src/locale/generate-kbd-model-map
3338         $PYTHON $< > src/locale/kbd-model-map
3339
3340 localectl_SOURCES = \
3341         src/locale/localectl.c
3342
3343 localectl_CFLAGS = \
3344         $(AM_CFLAGS) \
3345         $(DBUS_CFLAGS)
3346
3347 localectl_LDADD = \
3348         libsystemd-shared.la \
3349         libsystemd-dbus.la \
3350         libsystemd-id128-internal.la
3351
3352 bin_PROGRAMS += \
3353         localectl
3354
3355 dist_bashcompletion_DATA += \
3356         shell-completion/bash/localectl
3357
3358 endif
3359
3360 polkitpolicy_in_files += \
3361         src/locale/org.freedesktop.locale1.policy.in
3362
3363 EXTRA_DIST += \
3364         units/systemd-localed.service.in
3365
3366 # ------------------------------------------------------------------------------
3367 if ENABLE_TIMEDATED
3368 systemd_timedated_SOURCES = \
3369         src/timedate/timedated.c
3370
3371 systemd_timedated_CFLAGS = \
3372         $(AM_CFLAGS) \
3373         $(DBUS_CFLAGS)
3374
3375 systemd_timedated_LDADD = \
3376         libsystemd-label.la \
3377         libsystemd-shared.la \
3378         libsystemd-daemon.la \
3379         libsystemd-dbus.la
3380
3381 rootlibexec_PROGRAMS += \
3382         systemd-timedated
3383
3384 dist_dbussystemservice_DATA += \
3385         src/timedate/org.freedesktop.timedate1.service
3386
3387 dist_dbuspolicy_DATA += \
3388         src/timedate/org.freedesktop.timedate1.conf
3389
3390 nodist_systemunit_DATA += \
3391         units/systemd-timedated.service
3392
3393 polkitpolicy_files += \
3394         src/timedate/org.freedesktop.timedate1.policy
3395
3396 org.freedesktop.timedate1.xml: systemd-timedated
3397         $(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.timedate1 $< $@.tmp && \
3398                 $(STRINGS) $@.tmp | $(AWK) -f $(srcdir)/introspect.awk | \
3399                 $(DBUS_PREPROCESS) -o $@ - && rm $@.tmp
3400
3401 dbusinterface_DATA += \
3402         org.freedesktop.timedate1.xml
3403
3404 INSTALL_DIRS += \
3405         $(prefix)/lib/systemd/ntp-units.d \
3406         $(sysconfdir)/systemd/ntp-units.d
3407
3408 SYSTEM_UNIT_ALIASES += \
3409         systemd-timedated.service dbus-org.freedesktop.timedate1.service
3410
3411 timedatectl_SOURCES = \
3412         src/timedate/timedatectl.c
3413
3414 timedatectl_CFLAGS = \
3415         $(AM_CFLAGS) \
3416         $(DBUS_CFLAGS)
3417
3418 timedatectl_LDADD = \
3419         libsystemd-shared.la \
3420         libsystemd-dbus.la
3421
3422 bin_PROGRAMS += \
3423         timedatectl
3424
3425 dist_bashcompletion_DATA += \
3426         shell-completion/bash/timedatectl
3427 endif
3428
3429 polkitpolicy_in_files += \
3430         src/timedate/org.freedesktop.timedate1.policy.in
3431
3432 EXTRA_DIST += \
3433         units/systemd-timedated.service.in
3434
3435 # ------------------------------------------------------------------------------
3436 if ENABLE_EFI
3437 bootctl_SOURCES = \
3438         src/boot/boot.h \
3439         src/boot/boot-loader.h \
3440         src/boot/bootctl.c \
3441         src/boot/boot-loader.c \
3442         src/boot/boot-efi.c
3443
3444 bootctl_LDADD = \
3445         libsystemd-shared.la \
3446         libsystemd-id128.la \
3447         libsystemd-daemon.la
3448
3449 bin_PROGRAMS += \
3450         bootctl
3451 endif
3452
3453 # ------------------------------------------------------------------------------
3454 if HAVE_MYHOSTNAME
3455 libnss_myhostname_la_SOURCES = \
3456         src/nss-myhostname/nss-myhostname.c \
3457         src/nss-myhostname/ifconf.h \
3458         src/nss-myhostname/netlink.c
3459
3460 libnss_myhostname_la_CFLAGS = \
3461         $(AM_CFLAGS)
3462
3463 libnss_myhostname_la_LDFLAGS = \
3464         $(AM_LDFLAGS) \
3465         -module \
3466         -export-dynamic \
3467         -avoid-version \
3468         -shared \
3469         -shrext .so.2
3470
3471 lib_LTLIBRARIES += \
3472         libnss_myhostname.la
3473 endif
3474
3475 # ------------------------------------------------------------------------------
3476 if ENABLE_LOGIND
3477 systemd_logind_SOURCES = \
3478         src/login/logind.c \
3479         src/login/logind.h \
3480         src/login/logind-dbus.c \
3481         src/login/logind-device.c \
3482         src/login/logind-device.h \
3483         src/login/logind-button.c \
3484         src/login/logind-button.h \
3485         src/login/logind-action.c \
3486         src/login/logind-action.h \
3487         src/login/logind-seat.c \
3488         src/login/logind-seat.h \
3489         src/login/logind-session.c \
3490         src/login/logind-session.h \
3491         src/login/logind-user.c \
3492         src/login/logind-user.h \
3493         src/login/logind-inhibit.c \
3494         src/login/logind-inhibit.h \
3495         src/login/logind-session-dbus.c \
3496         src/login/logind-seat-dbus.c \
3497         src/login/logind-user-dbus.c \
3498         src/login/logind-acl.h
3499
3500 nodist_systemd_logind_SOURCES = \
3501         src/login/logind-gperf.c
3502
3503 systemd_logind_CFLAGS = \
3504         $(AM_CFLAGS) \
3505         $(DBUS_CFLAGS)
3506
3507 systemd_logind_LDADD = \
3508         libsystemd-label.la \
3509         libsystemd-audit.la \
3510         libsystemd-shared.la \
3511         libsystemd-daemon.la \
3512         libsystemd-dbus.la \
3513         libudev.la
3514
3515 if HAVE_ACL
3516 systemd_logind_SOURCES += \
3517         src/login/logind-acl.c
3518
3519 systemd_logind_LDADD += \
3520         libsystemd-acl.la
3521 endif
3522
3523 systemd_user_sessions_SOURCES = \
3524         src/login/user-sessions.c
3525
3526 systemd_user_sessions_LDADD = \
3527         libsystemd-shared.la
3528
3529 rootlibexec_PROGRAMS += \
3530         systemd-logind \
3531         systemd-user-sessions
3532
3533 loginctl_SOURCES = \
3534         src/login/loginctl.c \
3535         src/login/sysfs-show.c
3536
3537 loginctl_CFLAGS = \
3538         $(AM_CFLAGS) \
3539         $(DBUS_CFLAGS)
3540
3541 loginctl_LDADD = \
3542         libsystemd-shared.la \
3543         libsystemd-dbus.la \
3544         libudev.la
3545
3546 rootbin_PROGRAMS += \
3547         loginctl
3548
3549 dist_bashcompletion_DATA += \
3550         shell-completion/bash/loginctl
3551
3552 systemd_inhibit_SOURCES = \
3553         src/login/inhibit.c
3554
3555 systemd_inhibit_CFLAGS = \
3556         $(AM_CFLAGS) \
3557         $(DBUS_CFLAGS)
3558
3559 systemd_inhibit_LDADD = \
3560         libsystemd-shared.la \
3561         libsystemd-dbus.la
3562
3563 rootbin_PROGRAMS += \
3564         systemd-inhibit
3565
3566 test_login_SOURCES = \
3567         src/login/test-login.c
3568
3569 test_login_LDADD = \
3570         libsystemd-login-internal.la \
3571         libsystemd-shared.la
3572
3573 test_inhibit_SOURCES = \
3574         src/login/test-inhibit.c
3575
3576 test_inhibit_LDADD = \
3577         libsystemd-shared.la \
3578         libsystemd-dbus.la
3579
3580 test_inhibit_CFLAGS = \
3581         $(AM_CFLAGS) \
3582         $(DBUS_CFLAGS)
3583
3584 manual_tests += \
3585         test-login \
3586         test-inhibit
3587
3588 libsystemd_login_la_SOURCES = \
3589         src/login/sd-login.c
3590
3591 libsystemd_login_la_CFLAGS = \
3592         $(AM_CFLAGS) \
3593         -fvisibility=hidden
3594
3595 libsystemd_login_la_LDFLAGS = \
3596         $(AM_LDFLAGS) \
3597         -version-info $(LIBSYSTEMD_LOGIN_CURRENT):$(LIBSYSTEMD_LOGIN_REVISION):$(LIBSYSTEMD_LOGIN_AGE) \
3598         -Wl,--version-script=$(top_srcdir)/src/login/libsystemd-login.sym
3599
3600 libsystemd_login_la_LIBADD = \
3601         libsystemd-shared.la \
3602         libsystemd-daemon-internal.la
3603
3604 libsystemd_login_internal_la_SOURCES = \
3605         $(libsystemd_login_la_SOURCES)
3606
3607 if HAVE_PAM
3608 pam_systemd_la_SOURCES = \
3609         src/login/pam-module.c
3610
3611 pam_systemd_la_CFLAGS = \
3612         $(AM_CFLAGS) \
3613         $(PAM_CFLAGS) \
3614         $(DBUS_CFLAGS) \
3615         -fvisibility=hidden
3616
3617 pam_systemd_la_LDFLAGS = \
3618         $(AM_LDFLAGS) \
3619         -module \
3620         -export-dynamic \
3621         -avoid-version \
3622         -shared \
3623         -export-symbols-regex '^pam_sm_.*'
3624
3625 pam_systemd_la_LIBADD = \
3626         libsystemd-audit.la \
3627         libsystemd-dbus.la \
3628         libsystemd-shared.la \
3629         libsystemd-daemon-internal.la \
3630         $(PAM_LIBS)
3631
3632 pamlib_LTLIBRARIES = \
3633         pam_systemd.la
3634 endif
3635
3636 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
3637 libsystemd-login-install-hook:
3638         libname=libsystemd-login.so && $(move-to-rootlibdir)
3639
3640 libsystemd-login-uninstall-hook:
3641         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-login.so*
3642
3643 INSTALL_EXEC_HOOKS += libsystemd-login-install-hook
3644 UNINSTALL_EXEC_HOOKS += libsystemd-login-uninstall-hook
3645
3646 nodist_systemunit_DATA += \
3647         units/systemd-logind.service \
3648         units/systemd-user-sessions.service
3649
3650 dist_dbussystemservice_DATA += \
3651         src/login/org.freedesktop.login1.service
3652
3653 dist_dbuspolicy_DATA += \
3654         src/login/org.freedesktop.login1.conf
3655
3656 dist_pkgsysconf_DATA += \
3657         src/login/logind.conf
3658
3659 pkginclude_HEADERS += \
3660         src/systemd/sd-login.h
3661
3662 lib_LTLIBRARIES += \
3663         libsystemd-login.la
3664
3665 noinst_LTLIBRARIES += \
3666         libsystemd-login-internal.la
3667
3668 pkgconfiglib_DATA += \
3669         src/login/libsystemd-login.pc
3670
3671 polkitpolicy_files += \
3672         src/login/org.freedesktop.login1.policy
3673
3674 INSTALL_DIRS += \
3675         $(systemdstatedir)
3676
3677 MULTI_USER_TARGET_WANTS += \
3678         systemd-logind.service \
3679         systemd-user-sessions.service
3680
3681 SYSTEM_UNIT_ALIASES += \
3682         systemd-logind.service dbus-org.freedesktop.login1.service
3683
3684 systemd_multi_seat_x_SOURCES = \
3685         src/login/multi-seat-x.c
3686
3687 systemd_multi_seat_x_LDADD = \
3688         libsystemd-label.la \
3689         libsystemd-shared.la
3690
3691 rootlibexec_PROGRAMS += \
3692         systemd-multi-seat-x
3693
3694 dist_udevrules_DATA += \
3695         src/login/70-uaccess.rules \
3696         src/login/70-power-switch.rules
3697
3698 nodist_udevrules_DATA += \
3699         src/login/71-seat.rules \
3700         src/login/73-seat-late.rules
3701
3702 CLEANFILES += \
3703         src/login/logind-gperf.c \
3704         src/login/71-seat.rules \
3705         src/login/73-seat-late.rules
3706 endif
3707
3708 polkitpolicy_in_files += \
3709         src/login/org.freedesktop.login1.policy.in
3710
3711 EXTRA_DIST += \
3712         src/login/logind-gperf.gperf \
3713         src/login/libsystemd-login.pc.in \
3714         src/login/libsystemd-login.sym \
3715         src/login/71-seat.rules.in \
3716         src/login/73-seat-late.rules.in \
3717         units/systemd-logind.service.in \
3718         units/systemd-user-sessions.service.in
3719
3720 # ------------------------------------------------------------------------------
3721 if HAVE_PYTHON_DEVEL
3722 pkgpyexec_LTLIBRARIES = \
3723         _journal.la \
3724         id128.la \
3725         _daemon.la \
3726         _reader.la \
3727         login.la
3728
3729 _journal_la_SOURCES = \
3730         src/python-systemd/_journal.c
3731
3732 _journal_la_CFLAGS = \
3733         $(AM_CFLAGS) \
3734         -fvisibility=default \
3735         $(PYTHON_CFLAGS)
3736
3737 _journal_la_LDFLAGS = \
3738         $(AM_LDFLAGS) \
3739         -shared \
3740         -module \
3741         -avoid-version
3742
3743 _journal_la_LIBADD = \
3744         $(PYTHON_LIBS) \
3745         libsystemd-journal.la
3746
3747 id128_la_SOURCES = \
3748         src/python-systemd/id128.c \
3749         src/python-systemd/id128-constants.h \
3750         src/python-systemd/pyutil.c \
3751         src/python-systemd/pyutil.h
3752
3753 id128_la_CFLAGS = \
3754         $(AM_CFLAGS) \
3755         -fvisibility=default \
3756         $(PYTHON_CFLAGS) \
3757         -I$(top_builddir)/src/python-systemd
3758
3759 id128_la_LDFLAGS = \
3760         $(AM_LDFLAGS) \
3761         -shared \
3762         -module \
3763         -avoid-version
3764
3765 id128_la_LIBADD = \
3766         $(PYTHON_LIBS) \
3767         libsystemd-id128.la
3768
3769 _daemon_la_SOURCES = \
3770         src/python-systemd/_daemon.c \
3771         src/python-systemd/pyutil.c \
3772         src/python-systemd/pyutil.h
3773
3774 _daemon_la_CFLAGS = \
3775         $(AM_CFLAGS) \
3776         -fvisibility=default \
3777         $(PYTHON_CFLAGS) \
3778         -I$(top_builddir)/src/python-systemd
3779
3780 _daemon_la_LDFLAGS = \
3781         $(AM_LDFLAGS) \
3782         -shared \
3783         -module \
3784         -avoid-version
3785
3786 _daemon_la_LIBADD = \
3787         $(PYTHON_LIBS) \
3788         libsystemd-daemon.la
3789
3790 _reader_la_SOURCES = \
3791         src/python-systemd/_reader.c \
3792         src/python-systemd/pyutil.c \
3793         src/python-systemd/pyutil.h
3794
3795 _reader_la_CFLAGS = \
3796         $(AM_CFLAGS) \
3797         -fvisibility=default \
3798         $(PYTHON_CFLAGS)
3799
3800 _reader_la_LDFLAGS = \
3801         $(AM_LDFLAGS) \
3802         -shared \
3803         -module \
3804         -avoid-version
3805
3806 _reader_la_LIBADD = \
3807         $(PYTHON_LIBS) \
3808         libsystemd-journal.la \
3809         libsystemd-id128.la \
3810         libsystemd-shared.la \
3811         libsystemd-daemon-internal.la
3812
3813 login_la_SOURCES = \
3814         src/python-systemd/login.c \
3815         src/python-systemd/pyutil.c \
3816         src/python-systemd/pyutil.h
3817
3818 login_la_CFLAGS = \
3819         $(AM_CFLAGS) \
3820         -fvisibility=default \
3821         $(PYTHON_CFLAGS)
3822
3823 login_la_LDFLAGS = \
3824         $(AM_LDFLAGS) \
3825         -shared \
3826         -module \
3827         -avoid-version
3828
3829 login_la_LIBADD = \
3830         $(PYTHON_LIBS) \
3831         libsystemd-journal.la \
3832         libsystemd-login.la \
3833         libsystemd-shared.la \
3834         libsystemd-daemon-internal.la
3835
3836 dist_pkgpyexec_PYTHON = \
3837         src/python-systemd/journal.py \
3838         src/python-systemd/daemon.py \
3839         src/python-systemd/__init__.py
3840
3841 src/python-systemd/id128-constants.h: src/systemd/sd-messages.h Makefile
3842         $(AM_V_at)$(MKDIR_P) $(dir $@)
3843         $(AM_V_GEN)$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
3844
3845 BUILT_SOURCES += \
3846         src/python-systemd/id128-constants.h
3847
3848 SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
3849 sphinx-%:
3850         $(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
3851         $(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/
3852         $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/html/python-systemd/
3853
3854 python-shell:
3855         $(AM_V_at)echo "Starting python with $(DESTDIR)$(pyexecdir)"
3856         $(AM_V_at)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(PYTHON)
3857
3858 destdir-sphinx: all
3859         dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
3860                 $(MAKE) DESTDIR="$$dir" install && \
3861                 $(MAKE) DESTDIR="$$dir" sphinx-html && \
3862                 rm -rf "$$dir"
3863
3864 endif
3865
3866 CLEAN_LOCAL_HOOKS += clean-sphinx
3867
3868 clean-sphinx:
3869         -rm -rf docs/html/python-systemd/
3870
3871 # ------------------------------------------------------------------------------
3872 substitutions = \
3873        '|rootlibexecdir=$(rootlibexecdir)|' \
3874        '|rootbindir=$(rootbindir)|' \
3875        '|bindir=$(bindir)|' \
3876        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
3877        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
3878        '|pkgsysconfdir=$(pkgsysconfdir)|' \
3879        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \