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