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