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