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