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