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