chiark / gitweb /
test: ensure conf_files_list returns absolute paths
[elogind.git] / Makefile.am
1 #  -*- Mode: makefile; indent-tabs-mode: t -*-
2 #
3 #  This file is part of systemd.
4 #
5 #  Copyright 2010-2012 Lennart Poettering
6 #  Copyright 2010-2012 Kay Sievers
7 #  Copyright 2013 Zbigniew Jędrzejewski-Szmek
8 #  Copyright 2013 David Strauss
9 #
10 #  systemd is free software; you can redistribute it and/or modify it
11 #  under the terms of the GNU Lesser General Public License as published by
12 #  the Free Software Foundation; either version 2.1 of the License, or
13 #  (at your option) any later version.
14 #
15 #  systemd is distributed in the hope that it will be useful, but
16 #  WITHOUT ANY WARRANTY; without even the implied warranty of
17 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 #  Lesser General Public License for more details.
19 #
20 #  You should have received a copy of the GNU Lesser General Public License
21 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
22
23 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
24 AM_MAKEFLAGS = --no-print-directory
25 AUTOMAKE_OPTIONS = color-tests parallel-tests
26
27 SUBDIRS = . po
28
29 # remove targets if the command fails
30 .DELETE_ON_ERROR:
31
32 # keep intermediate files
33 .SECONDARY:
34
35 # Keep the test-suite.log
36 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
37
38 LIBUDEV_CURRENT=5
39 LIBUDEV_REVISION=1
40 LIBUDEV_AGE=4
41
42 LIBGUDEV_CURRENT=2
43 LIBGUDEV_REVISION=0
44 LIBGUDEV_AGE=2
45
46 LIBSYSTEMD_CURRENT=3
47 LIBSYSTEMD_REVISION=0
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 networkdir=$(rootprefix)/lib/systemd/network
94 pkgincludedir=$(includedir)/systemd
95 systemgeneratordir=$(rootlibexecdir)/system-generators
96 usergeneratordir=$(prefix)/lib/systemd/user-generators
97 systemshutdowndir=$(rootlibexecdir)/system-shutdown
98 systemsleepdir=$(rootlibexecdir)/system-sleep
99 systemunitdir=$(rootprefix)/lib/systemd/system
100 systempresetdir=$(rootprefix)/lib/systemd/system-preset
101 udevlibexecdir=$(rootprefix)/lib/udev
102 udevhomedir=$(udevlibexecdir)
103 udevrulesdir=$(udevlibexecdir)/rules.d
104 udevhwdbdir=$(udevlibexecdir)/hwdb.d
105 catalogdir=$(prefix)/lib/systemd/catalog
106 kernelinstalldir = $(prefix)/lib/kernel/install.d
107 ntpunitsdir=$(prefix)/lib/systemd/ntp-units.d
108
109 # And these are the special ones for /
110 rootprefix=@rootprefix@
111 rootbindir=$(rootprefix)/bin
112 rootlibexecdir=$(rootprefix)/lib/systemd
113
114 CLEANFILES = $(BUILT_SOURCES)
115 DISTCLEANFILES =
116 EXTRA_DIST =
117 BUILT_SOURCES =
118 INSTALL_EXEC_HOOKS =
119 UNINSTALL_EXEC_HOOKS =
120 INSTALL_DATA_HOOKS =
121 UNINSTALL_DATA_HOOKS =
122 DISTCLEAN_LOCAL_HOOKS =
123 CLEAN_LOCAL_HOOKS =
124 pkginclude_HEADERS =
125 noinst_LTLIBRARIES =
126 lib_LTLIBRARIES =
127 include_HEADERS =
128 noinst_DATA =
129 pkgconfiglib_DATA =
130 polkitpolicy_in_in_files =
131 polkitpolicy_in_files =
132 polkitpolicy_files =
133 dist_udevrules_DATA =
134 nodist_udevrules_DATA =
135 nodist_pkgsysconf_DATA =
136 dist_pkgsysconf_DATA =
137 dist_pkgdata_DATA =
138 dist_dbuspolicy_DATA =
139 dist_dbussystemservice_DATA =
140 check_PROGRAMS =
141 check_DATA =
142 tests=
143 manual_tests =
144 if ENABLE_TESTS
145 noinst_PROGRAMS = $(manual_tests) $(tests)
146 TESTS = $(tests)
147 else
148 noinst_PROGRAMS =
149 TESTS =
150 endif
151 udevlibexec_PROGRAMS =
152
153 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
154         $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
155         $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
156
157 AM_CPPFLAGS = \
158         -include $(top_builddir)/config.h \
159         -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
160         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
161         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
162         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
163         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
164         -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
165         -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
166         -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
167         -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
168         -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
169         -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
170         -DSYSTEMD_SLEEP_BINARY_PATH=\"$(rootlibexecdir)/systemd-sleep\" \
171         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
172         -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(rootbindir)/systemd-tty-ask-password-agent\" \
173         -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
174         -DROOTPREFIX=\"$(rootprefix)\" \
175         -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\" \
176         -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\" \
177         -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
178         -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
179         -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
180         -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
181         -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
182         -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
183         -DX_SERVER=\"$(bindir)/X\" \
184         -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
185         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
186         -DQUOTACHECK=\"$(QUOTACHECK)\" \
187         -DKEXEC=\"$(KEXEC)\" \
188         -I $(top_srcdir)/src \
189         -I $(top_builddir)/src/shared \
190         -I $(top_srcdir)/src/shared \
191         -I $(top_srcdir)/src/network \
192         -I $(top_srcdir)/src/login \
193         -I $(top_srcdir)/src/journal \
194         -I $(top_srcdir)/src/timedate \
195         -I $(top_srcdir)/src/timesync \
196         -I $(top_srcdir)/src/resolve \
197         -I $(top_srcdir)/src/systemd \
198         -I $(top_builddir)/src/core \
199         -I $(top_srcdir)/src/core \
200         -I $(top_srcdir)/src/libudev \
201         -I $(top_srcdir)/src/udev \
202         -I $(top_srcdir)/src/udev/net \
203         -I $(top_builddir)/src/udev \
204         -I $(top_srcdir)/src/libsystemd/sd-bus \
205         -I $(top_srcdir)/src/libsystemd/sd-event \
206         -I $(top_srcdir)/src/libsystemd/sd-rtnl \
207         -I $(top_srcdir)/src/libsystemd-network \
208         $(OUR_CPPFLAGS)
209
210 AM_CFLAGS = $(OUR_CFLAGS)
211 AM_LDFLAGS = $(OUR_LDFLAGS)
212
213 # ------------------------------------------------------------------------------
214 define move-to-rootlibdir
215         if test "$(libdir)" != "$(rootlibdir)"; then \
216                 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
217                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
218                 rm -f $(DESTDIR)$(libdir)/$$libname && \
219                 $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
220                 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
221         fi
222 endef
223
224 INSTALL_DIRS =
225
226 RUNLEVEL1_TARGET_WANTS =
227 RUNLEVEL2_TARGET_WANTS =
228 RUNLEVEL3_TARGET_WANTS =
229 RUNLEVEL4_TARGET_WANTS =
230 RUNLEVEL5_TARGET_WANTS =
231 SHUTDOWN_TARGET_WANTS =
232 LOCAL_FS_TARGET_WANTS =
233 MULTI_USER_TARGET_WANTS =
234 SYSINIT_TARGET_WANTS =
235 SOCKETS_TARGET_WANTS =
236 BUSNAMES_TARGET_WANTS =
237 TIMERS_TARGET_WANTS =
238 USER_SOCKETS_TARGET_WANTS =
239 USER_BUSNAMES_TARGET_WANTS =
240
241 SYSTEM_UNIT_ALIASES =
242 USER_UNIT_ALIASES =
243 GENERAL_ALIASES =
244
245 install-target-wants-hook:
246         what="$(RUNLEVEL1_TARGET_WANTS)" && wants=runlevel1.target && dir=$(systemunitdir) && $(add-wants)
247         what="$(RUNLEVEL2_TARGET_WANTS)" && wants=runlevel2.target && dir=$(systemunitdir) && $(add-wants)
248         what="$(RUNLEVEL3_TARGET_WANTS)" && wants=runlevel3.target && dir=$(systemunitdir) && $(add-wants)
249         what="$(RUNLEVEL4_TARGET_WANTS)" && wants=runlevel4.target && dir=$(systemunitdir) && $(add-wants)
250         what="$(RUNLEVEL5_TARGET_WANTS)" && wants=runlevel5.target && dir=$(systemunitdir) && $(add-wants)
251         what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && dir=$(systemunitdir) && $(add-wants)
252         what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && dir=$(systemunitdir) && $(add-wants)
253         what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
254         what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && dir=$(systemunitdir) && $(add-wants)
255         what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(systemunitdir) && $(add-wants)
256         what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
257         what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && dir=$(systemunitdir) && $(add-wants)
258         what="$(SLICES_TARGET_WANTS)" && wants=slices.target && dir=$(systemunitdir) && $(add-wants)
259         what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
260         what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
261
262 define add-wants
263         [ -z "$$what" ] || ( \
264           dir=$(DESTDIR)$$dir/$$wants.wants && \
265           $(MKDIR_P) -m 0755 $$dir && \
266           cd $$dir && \
267           rm -f $$what && \
268           for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
269 endef
270
271 install-directories-hook:
272         $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
273
274 install-aliases-hook:
275         set -- $(SYSTEM_UNIT_ALIASES) && \
276                 dir=$(systemunitdir) && $(install-aliases)
277         set -- $(USER_UNIT_ALIASES) && \
278                 dir=$(userunitdir) && $(install-relative-aliases)
279         set -- $(GENERAL_ALIASES) && \
280                 dir= && $(install-relative-aliases)
281
282 define install-aliases
283         while [ -n "$$1" ]; do \
284                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
285                 rm -f $(DESTDIR)$$dir/$$2 && \
286                 $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
287                 shift 2 || exit $$?; \
288         done
289 endef
290
291 define install-relative-aliases
292         while [ -n "$$1" ]; do \
293                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
294                 rm -f $(DESTDIR)$$dir/$$2 && \
295                 $(LN_S) --relative $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
296                 shift 2 || exit $$?; \
297         done
298 endef
299
300 install-touch-usr-hook:
301         touch -c $(DESTDIR)/$(prefix)
302
303 INSTALL_EXEC_HOOKS += \
304         install-target-wants-hook \
305         install-directories-hook \
306         install-aliases-hook \
307         install-touch-usr-hook
308
309 # ------------------------------------------------------------------------------
310 AM_V_M4 = $(AM_V_M4_$(V))
311 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
312 AM_V_M4_0 = @echo "  M4      " $@;
313
314 AM_V_XSLT = $(AM_V_XSLT_$(V))
315 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
316 AM_V_XSLT_0 = @echo "  XSLT    " $@;
317
318 AM_V_GPERF = $(AM_V_GPERF_$(V))
319 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
320 AM_V_GPERF_0 = @echo "  GPERF   " $@;
321
322 AM_V_LN = $(AM_V_LN_$(V))
323 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
324 AM_V_LN_0 = @echo "  LN      " $@;
325
326 AM_V_RM = $(AM_V_RM_$(V))
327 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
328 AM_V_RM_0 = @echo "  RM      " $@;
329
330 # ------------------------------------------------------------------------------
331 rootbin_PROGRAMS = \
332         systemctl \
333         systemd-notify \
334         systemd-ask-password \
335         systemd-tty-ask-password-agent \
336         systemd-machine-id-setup
337
338 bin_PROGRAMS = \
339         systemd-cgls \
340         systemd-cgtop \
341         systemd-nspawn \
342         systemd-detect-virt \
343         systemd-delta \
344         systemd-analyze \
345         systemd-run
346
347 dist_bin_SCRIPTS = \
348         src/kernel-install/kernel-install
349
350 dist_kernelinstall_SCRIPTS = \
351         src/kernel-install/50-depmod.install \
352         src/kernel-install/90-loaderentry.install
353
354 rootlibexec_PROGRAMS = \
355         systemd \
356         systemd-cgroups-agent \
357         systemd-initctl \
358         systemd-update-utmp \
359         systemd-shutdownd \
360         systemd-shutdown \
361         systemd-remount-fs \
362         systemd-reply-password \
363         systemd-fsck \
364         systemd-ac-power \
365         systemd-sysctl \
366         systemd-sleep \
367         systemd-bus-proxyd \
368         systemd-socket-proxyd \
369         systemd-update-done
370
371 systemgenerator_PROGRAMS = \
372         systemd-getty-generator \
373         systemd-fstab-generator \
374         systemd-system-update-generator \
375         systemd-debug-generator
376
377 dist_bashcompletion_DATA = \
378         shell-completion/bash/busctl \
379         shell-completion/bash/journalctl \
380         shell-completion/bash/systemctl \
381         shell-completion/bash/systemd-analyze \
382         shell-completion/bash/systemd-cat \
383         shell-completion/bash/systemd-cgls \
384         shell-completion/bash/systemd-cgtop \
385         shell-completion/bash/systemd-delta \
386         shell-completion/bash/systemd-detect-virt \
387         shell-completion/bash/systemd-nspawn \
388         shell-completion/bash/systemd-run \
389         shell-completion/bash/udevadm \
390         shell-completion/bash/kernel-install
391
392 dist_zshcompletion_DATA = \
393         shell-completion/zsh/_systemctl \
394         shell-completion/zsh/_journalctl \
395         shell-completion/zsh/_udevadm \
396         shell-completion/zsh/_kernel-install \
397         shell-completion/zsh/_systemd-nspawn \
398         shell-completion/zsh/_systemd-analyze \
399         shell-completion/zsh/_systemd-run \
400         shell-completion/zsh/_sd_hosts_or_user_at_host \
401         shell-completion/zsh/_systemd-delta \
402         shell-completion/zsh/_systemd
403
404 dist_sysctl_DATA = \
405         sysctl.d/50-default.conf
406
407 dist_systemunit_DATA = \
408         units/graphical.target \
409         units/multi-user.target \
410         units/emergency.service \
411         units/emergency.target \
412         units/sysinit.target \
413         units/basic.target \
414         units/getty.target \
415         units/halt.target \
416         units/kexec.target \
417         units/local-fs.target \
418         units/local-fs-pre.target \
419         units/initrd.target \
420         units/initrd-fs.target \
421         units/initrd-root-fs.target \
422         units/remote-fs.target \
423         units/remote-fs-pre.target \
424         units/network.target \
425         units/network-pre.target \
426         units/network-online.target \
427         units/nss-lookup.target \
428         units/nss-user-lookup.target \
429         units/hibernate.target \
430         units/hybrid-sleep.target \
431         units/poweroff.target \
432         units/reboot.target \
433         units/rescue.target \
434         units/rpcbind.target \
435         units/time-sync.target \
436         units/shutdown.target \
437         units/final.target \
438         units/umount.target \
439         units/sigpwr.target \
440         units/sleep.target \
441         units/sockets.target \
442         units/busnames.target \
443         units/timers.target \
444         units/paths.target \
445         units/suspend.target \
446         units/swap.target \
447         units/slices.target \
448         units/system.slice \
449         units/x-.slice \
450         units/systemd-initctl.socket \
451         units/systemd-shutdownd.socket \
452         units/syslog.socket \
453         units/dev-hugepages.mount \
454         units/dev-mqueue.mount \
455         units/sys-kernel-config.mount \
456         units/sys-kernel-debug.mount \
457         units/sys-fs-fuse-connections.mount \
458         units/tmp.mount \
459         units/printer.target \
460         units/sound.target \
461         units/bluetooth.target \
462         units/smartcard.target \
463         units/systemd-ask-password-wall.path \
464         units/systemd-ask-password-console.path \
465         units/systemd-udevd-control.socket \
466         units/systemd-udevd-kernel.socket \
467         units/system-update.target \
468         units/initrd-switch-root.target \
469         units/ldconfig.service
470
471 nodist_systemunit_DATA = \
472         units/getty@.service \
473         units/serial-getty@.service \
474         units/console-shell.service \
475         units/console-getty.service \
476         units/container-getty@.service \
477         units/systemd-initctl.service \
478         units/systemd-shutdownd.service \
479         units/systemd-remount-fs.service \
480         units/systemd-update-utmp.service \
481         units/systemd-update-utmp-runlevel.service \
482         units/systemd-ask-password-wall.service \
483         units/systemd-ask-password-console.service \
484         units/systemd-sysctl.service \
485         units/emergency.service \
486         units/rescue.service \
487         units/user@.service \
488         units/systemd-hibernate.service \
489         units/systemd-hybrid-sleep.service \
490         units/systemd-suspend.service \
491         units/systemd-halt.service \
492         units/systemd-poweroff.service \
493         units/systemd-reboot.service \
494         units/systemd-kexec.service \
495         units/systemd-fsck@.service \
496         units/systemd-fsck-root.service \
497         units/systemd-udevd.service \
498         units/systemd-udev-trigger.service \
499         units/systemd-udev-settle.service \
500         units/systemd-udev-hwdb-update.service \
501         units/debug-shell.service \
502         units/initrd-parse-etc.service \
503         units/initrd-cleanup.service \
504         units/initrd-udevadm-cleanup-db.service \
505         units/initrd-switch-root.service \
506         units/systemd-nspawn@.service \
507         units/systemd-update-done.service
508
509 dist_userunit_DATA = \
510         units/user/basic.target \
511         units/user/default.target \
512         units/user/exit.target
513
514 nodist_userunit_DATA = \
515         units/user/systemd-exit.service
516
517 dist_systempreset_DATA = \
518         system-preset/90-systemd.preset
519
520 EXTRA_DIST += \
521         units/getty@.service.m4 \
522         units/serial-getty@.service.m4 \
523         units/console-shell.service.m4.in \
524         units/console-getty.service.m4.in \
525         units/container-getty@.service.m4.in \
526         units/rescue.service.m4.in \
527         units/systemd-initctl.service.in \
528         units/systemd-shutdownd.service.in \
529         units/systemd-remount-fs.service.in \
530         units/systemd-update-utmp.service.in \
531         units/systemd-update-utmp-runlevel.service.in \
532         units/systemd-ask-password-wall.service.in \
533         units/systemd-ask-password-console.service.in \
534         units/systemd-sysctl.service.in \
535         units/emergency.service.in \
536         units/systemd-halt.service.in \
537         units/systemd-poweroff.service.in \
538         units/systemd-reboot.service.in \
539         units/systemd-kexec.service.in \
540         units/user/systemd-exit.service.in \
541         units/systemd-fsck@.service.in \
542         units/systemd-fsck-root.service.in \
543         units/user@.service.in \
544         units/debug-shell.service.in \
545         units/systemd-hibernate.service.in \
546         units/systemd-hybrid-sleep.service.in \
547         units/systemd-suspend.service.in \
548         units/quotaon.service.in \
549         units/initrd-parse-etc.service.in \
550         units/initrd-cleanup.service.in \
551         units/initrd-udevadm-cleanup-db.service.in \
552         units/initrd-switch-root.service.in \
553         units/systemd-nspawn@.service.in \
554         units/systemd-update-done.service.in
555
556 CLEANFILES += \
557         units/console-shell.service.m4 \
558         units/console-getty.service.m4 \
559         units/container-getty@.service.m4 \
560         units/rescue.service.m4 \
561         units/user@.service.m4
562
563 if HAVE_SYSV_COMPAT
564 nodist_systemunit_DATA += \
565         units/rc-local.service \
566         units/halt-local.service
567
568 systemgenerator_PROGRAMS += \
569         systemd-sysv-generator \
570         systemd-rc-local-generator
571 endif
572
573 EXTRA_DIST += \
574         units/rc-local.service.in \
575         units/halt-local.service.in
576
577 # automake is broken and can't handle files with a dash in front
578 # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14728#8
579 units-install-hook:
580         mv $(DESTDIR)$(systemunitdir)/x-.slice $(DESTDIR)/$(systemunitdir)/-.slice
581
582 units-uninstall-hook:
583         rm -f $(DESTDIR)/$(systemunitdir)/-.slice
584
585 INSTALL_DATA_HOOKS += units-install-hook
586 UNINSTALL_DATA_HOOKS += units-uninstall-hook
587
588 dist_doc_DATA = \
589         README \
590         NEWS \
591         LICENSE.LGPL2.1 \
592         LICENSE.GPL2 \
593         LICENSE.MIT \
594         DISTRO_PORTING \
595         src/libsystemd/sd-bus/PORTING-DBUS1 \
596         src/libsystemd/sd-bus/DIFFERENCES \
597         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
598
599 @INTLTOOL_POLICY_RULE@
600
601 # ------------------------------------------------------------------------------
602
603 MANPAGES =
604 MANPAGES_ALIAS =
605
606 include Makefile-man.am
607
608 .PHONY: man update-man-list
609 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
610
611 XML_FILES = \
612         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
613 HTML_FILES = \
614         ${XML_FILES:.xml=.html}
615 HTML_ALIAS = \
616         ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
617
618 if ENABLE_MANPAGES
619 man_MANS = \
620         $(MANPAGES) \
621         $(MANPAGES_ALIAS)
622
623 noinst_DATA += \
624         $(HTML_FILES) \
625         $(HTML_ALIAS)
626
627 CLEANFILES += \
628         $(man_MANS) \
629         $(HTML_FILES) \
630         $(HTML_ALIAS)
631
632 docs/html/man:
633         $(AM_V_at)$(MKDIR_P) $(dir $@)
634         $(AM_V_LN)$(LN_S) -f ../../man $@
635
636 noinst_DATA += \
637         docs/html/man
638
639 CLEANFILES += \
640         docs/html/man
641
642 if HAVE_PYTHON
643 man/index.html: man/systemd.index.html
644         $(AM_V_LN)$(LN_S) -f systemd.index.html $@
645
646 noinst_DATA += \
647         man/index.html
648
649 CLEANFILES += \
650         man/index.html
651
652 XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml)
653 NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
654 SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))
655
656 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB)
657         $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
658         $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
659         @echo "Makefile-man.am has been regenerated"
660
661 man/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
662         $(AM_V_at)$(MKDIR_P) $(dir $@)
663         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
664
665 man/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py $(SOURCE_XML_FILES)
666         $(AM_V_at)$(MKDIR_P) $(dir $@)
667         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
668
669 EXTRA_DIST += \
670         man/systemd.index.xml \
671         man/index.html \
672         man/systemd.directives.xml
673
674 CLEANFILES += \
675         man/systemd.index.xml \
676         man/systemd.directives.xml
677
678 endif
679
680 endif
681
682 EXTRA_DIST += \
683         $(XML_FILES) \
684         $(HTML_FILES) \
685         $(HTML_ALIAS) \
686         $(man_MANS) \
687         tools/make-man-index.py \
688         tools/make-directive-index.py \
689         tools/make-man-rules.py \
690         tools/xml_helper.py
691
692 # ------------------------------------------------------------------------------
693 noinst_LTLIBRARIES += \
694         libsystemd-shared.la
695
696 libsystemd_shared_la_SOURCES = \
697         src/shared/linux/auto_dev-ioctl.h \
698         src/shared/linux/fanotify.h \
699         src/shared/ioprio.h \
700         src/shared/missing.h \
701         src/shared/initreq.h \
702         src/shared/securebits.h \
703         src/shared/special.h \
704         src/shared/list.h \
705         src/shared/macro.h \
706         src/shared/def.h \
707         src/shared/sparse-endian.h \
708         src/shared/refcnt.h \
709         src/shared/udev-util.h \
710         src/shared/bus-errors.h \
711         src/shared/device-nodes.c \
712         src/shared/device-nodes.h \
713         src/shared/util.c \
714         src/shared/util.h \
715         src/shared/virt.c \
716         src/shared/virt.h \
717         src/shared/architecture.c \
718         src/shared/architecture.h \
719         src/shared/efivars.c \
720         src/shared/efivars.h \
721         src/shared/path-util.c \
722         src/shared/path-util.h \
723         src/shared/time-util.c \
724         src/shared/time-util.h \
725         src/shared/hashmap.c \
726         src/shared/hashmap.h \
727         src/shared/siphash24.c \
728         src/shared/siphash24.h \
729         src/shared/set.c \
730         src/shared/set.h \
731         src/shared/fdset.c \
732         src/shared/fdset.h \
733         src/shared/prioq.c \
734         src/shared/prioq.h \
735         src/shared/sleep-config.c \
736         src/shared/sleep-config.h \
737         src/shared/strv.c \
738         src/shared/strv.h \
739         src/shared/env-util.c \
740         src/shared/env-util.h \
741         src/shared/strbuf.c \
742         src/shared/strbuf.h \
743         src/shared/strxcpyx.c \
744         src/shared/strxcpyx.h \
745         src/shared/conf-parser.c \
746         src/shared/conf-parser.h \
747         src/shared/log.c \
748         src/shared/log.h \
749         src/shared/ratelimit.h \
750         src/shared/ratelimit.c \
751         src/shared/exit-status.c \
752         src/shared/exit-status.h \
753         src/shared/utf8.c \
754         src/shared/utf8.h \
755         src/shared/gunicode.c \
756         src/shared/gunicode.h \
757         src/shared/pager.c \
758         src/shared/pager.h \
759         src/shared/socket-util.c \
760         src/shared/socket-util.h \
761         src/shared/conf-files.c \
762         src/shared/conf-files.h \
763         src/shared/cgroup-util.c \
764         src/shared/cgroup-util.h \
765         src/shared/cgroup-show.c \
766         src/shared/cgroup-show.h \
767         src/shared/unit-name.c \
768         src/shared/unit-name.h \
769         src/shared/utmp-wtmp.c \
770         src/shared/utmp-wtmp.h \
771         src/shared/watchdog.c \
772         src/shared/watchdog.h \
773         src/shared/spawn-ask-password-agent.c \
774         src/shared/spawn-ask-password-agent.h \
775         src/shared/replace-var.c \
776         src/shared/replace-var.h \
777         src/shared/spawn-polkit-agent.c \
778         src/shared/spawn-polkit-agent.h \
779         src/shared/clock-util.c \
780         src/shared/clock-util.h \
781         src/shared/time-dst.c \
782         src/shared/time-dst.h \
783         src/shared/calendarspec.c \
784         src/shared/calendarspec.h \
785         src/shared/fileio.c \
786         src/shared/fileio.h \
787         src/shared/output-mode.h \
788         src/shared/MurmurHash2.c \
789         src/shared/MurmurHash2.h \
790         src/shared/acpi-fpdt.h \
791         src/shared/acpi-fpdt.c \
792         src/shared/boot-timestamps.h \
793         src/shared/boot-timestamps.c \
794         src/shared/mkdir.c \
795         src/shared/mkdir.h \
796         src/shared/smack-util.c \
797         src/shared/smack-util.h \
798         src/shared/apparmor-util.c \
799         src/shared/apparmor-util.h \
800         src/shared/ima-util.c \
801         src/shared/ima-util.h \
802         src/shared/ptyfwd.c \
803         src/shared/ptyfwd.h \
804         src/shared/errno-list.c \
805         src/shared/errno-list.h \
806         src/shared/af-list.c \
807         src/shared/af-list.h \
808         src/shared/audit.c \
809         src/shared/audit.h \
810         src/shared/xml.c \
811         src/shared/xml.h \
812         src/shared/condition-util.c \
813         src/shared/condition-util.h \
814         src/shared/bus-label.c \
815         src/shared/bus-label.h \
816         src/shared/gpt.h \
817         src/shared/generator.h \
818         src/shared/generator.c \
819         src/shared/clean-ipc.h \
820         src/shared/clean-ipc.c \
821         src/shared/login-shared.c \
822         src/shared/login-shared.h \
823         src/shared/ring.c \
824         src/shared/ring.h \
825         src/shared/async.c \
826         src/shared/async.h \
827         src/shared/eventfd-util.c \
828         src/shared/eventfd-util.h \
829         src/shared/copy.c \
830         src/shared/copy.h
831
832 nodist_libsystemd_shared_la_SOURCES = \
833         src/shared/errno-from-name.h \
834         src/shared/errno-to-name.h \
835         src/shared/af-from-name.h \
836         src/shared/af-to-name.h
837
838 libsystemd_shared_la_CFLAGS = \
839         $(AM_CFLAGS) \
840         $(SECCOMP_CFLAGS)
841
842 # ------------------------------------------------------------------------------
843 noinst_LTLIBRARIES += \
844         libsystemd-units.la
845
846 libsystemd_units_la_SOURCES = \
847         src/shared/install.c \
848         src/shared/install.h \
849         src/shared/install-printf.c \
850         src/shared/install-printf.h \
851         src/shared/path-lookup.c \
852         src/shared/path-lookup.h \
853         src/shared/specifier.c \
854         src/shared/specifier.h
855
856 # ------------------------------------------------------------------------------
857 noinst_LTLIBRARIES += \
858         libsystemd-label.la
859
860 libsystemd_label_la_SOURCES = \
861         src/shared/socket-label.c \
862         src/shared/label.c \
863         src/shared/label.h \
864         src/shared/selinux-util.c \
865         src/shared/selinux-util.h \
866         src/shared/mkdir-label.c \
867         src/shared/ask-password-api.c \
868         src/shared/ask-password-api.h \
869         src/shared/fileio-label.c \
870         src/shared/fileio-label.h \
871         src/shared/dev-setup.c \
872         src/shared/dev-setup.h
873
874 libsystemd_label_la_CFLAGS = \
875         $(AM_CFLAGS) \
876         $(SELINUX_CFLAGS)
877
878 libsystemd_label_la_LIBADD = \
879         $(SELINUX_LIBS)
880
881 # ------------------------------------------------------------------------------
882
883 if HAVE_SECCOMP
884 noinst_LTLIBRARIES += \
885         libsystemd-seccomp.la
886
887 libsystemd_seccomp_la_SOURCES = \
888         src/shared/seccomp-util.h \
889         src/shared/seccomp-util.c
890
891 libsystemd_seccomp_la_CFLAGS = \
892         $(AM_CFLAGS) \
893         $(SECCOMP_CFLAGS)
894
895 libsystemd_seccomp_la_LIBADD = \
896         $(SECCOMP_LIBS)
897 endif
898
899 # ------------------------------------------------------------------------------
900 noinst_LTLIBRARIES += \
901         libsystemd-logs.la
902
903 libsystemd_logs_la_SOURCES = \
904         src/shared/logs-show.c \
905         src/shared/logs-show.h
906
907 # ------------------------------------------------------------------------------
908 noinst_LTLIBRARIES += \
909         libsystemd-capability.la
910
911 libsystemd_capability_la_SOURCES = \
912         src/shared/capability.c \
913         src/shared/capability.h
914
915 libsystemd_capability_la_CFLAGS = \
916         $(AM_CFLAGS) \
917         $(CAP_CFLAGS)
918
919 libsystemd_capability_la_LIBADD = \
920         $(CAP_LIBS)
921
922 # ------------------------------------------------------------------------------
923 if HAVE_ACL
924 noinst_LTLIBRARIES += \
925         libsystemd-acl.la
926
927 libsystemd_acl_la_SOURCES = \
928         src/shared/acl-util.c \
929         src/shared/acl-util.h
930
931 libsystemd_acl_la_CFLAGS = \
932         $(AM_CFLAGS) \
933         $(ACL_CFLAGS)
934
935 libsystemd_acl_la_LIBADD = \
936         $(ACL_LIBS)
937 endif
938
939 # ------------------------------------------------------------------------------
940 noinst_LTLIBRARIES += \
941         libsystemd-core.la
942
943 libsystemd_core_la_SOURCES = \
944         src/core/unit.c \
945         src/core/unit.h \
946         src/core/unit-printf.c \
947         src/core/unit-printf.h \
948         src/core/job.c \
949         src/core/job.h \
950         src/core/manager.c \
951         src/core/manager.h \
952         src/core/transaction.c \
953         src/core/transaction.h \
954         src/core/load-fragment.c \
955         src/core/load-fragment.h \
956         src/core/service.c \
957         src/core/service.h \
958         src/core/socket.c \
959         src/core/socket.h \
960         src/core/busname.c \
961         src/core/busname.h \
962         src/core/target.c \
963         src/core/target.h \
964         src/core/snapshot.c \
965         src/core/snapshot.h \
966         src/core/device.c \
967         src/core/device.h \
968         src/core/mount.c \
969         src/core/mount.h \
970         src/core/automount.c \
971         src/core/automount.h \
972         src/core/swap.c \
973         src/core/swap.h \
974         src/core/timer.c \
975         src/core/timer.h \
976         src/core/path.c \
977         src/core/path.h \
978         src/core/slice.c \
979         src/core/slice.h \
980         src/core/scope.c \
981         src/core/scope.h \
982         src/core/load-dropin.c \
983         src/core/load-dropin.h \
984         src/core/execute.c \
985         src/core/execute.h \
986         src/core/kill.c \
987         src/core/kill.h \
988         src/core/dbus.c \
989         src/core/dbus.h \
990         src/core/dbus-manager.c \
991         src/core/dbus-manager.h \
992         src/core/dbus-unit.c \
993         src/core/dbus-unit.h \
994         src/core/dbus-job.c \
995         src/core/dbus-job.h \
996         src/core/dbus-service.c \
997         src/core/dbus-service.h \
998         src/core/dbus-socket.c \
999         src/core/dbus-socket.h \
1000         src/core/dbus-busname.c \
1001         src/core/dbus-busname.h \
1002         src/core/dbus-target.c \
1003         src/core/dbus-target.h \
1004         src/core/dbus-snapshot.c \
1005         src/core/dbus-snapshot.h \
1006         src/core/dbus-device.c \
1007         src/core/dbus-device.h \
1008         src/core/dbus-mount.c \
1009         src/core/dbus-mount.h \
1010         src/core/dbus-automount.c \
1011         src/core/dbus-automount.h \
1012         src/core/dbus-swap.c \
1013         src/core/dbus-swap.h \
1014         src/core/dbus-timer.c \
1015         src/core/dbus-timer.h \
1016         src/core/dbus-path.c \
1017         src/core/dbus-path.h \
1018         src/core/dbus-slice.c \
1019         src/core/dbus-slice.h \
1020         src/core/dbus-scope.c \
1021         src/core/dbus-scope.h \
1022         src/core/dbus-execute.c \
1023         src/core/dbus-execute.h \
1024         src/core/dbus-kill.c \
1025         src/core/dbus-kill.h \
1026         src/core/dbus-cgroup.c \
1027         src/core/dbus-cgroup.h \
1028         src/core/cgroup.c \
1029         src/core/cgroup.h \
1030         src/core/selinux-access.c \
1031         src/core/selinux-access.h \
1032         src/core/selinux-setup.c \
1033         src/core/selinux-setup.h \
1034         src/core/smack-setup.c \
1035         src/core/smack-setup.h \
1036         src/core/ima-setup.c \
1037         src/core/ima-setup.h \
1038         src/core/locale-setup.h \
1039         src/core/locale-setup.c \
1040         src/core/hostname-setup.c \
1041         src/core/hostname-setup.h \
1042         src/core/machine-id-setup.c \
1043         src/core/machine-id-setup.h \
1044         src/core/mount-setup.c \
1045         src/core/mount-setup.h \
1046         src/core/loopback-setup.h \
1047         src/core/loopback-setup.c \
1048         src/core/condition.c \
1049         src/core/condition.h \
1050         src/core/namespace.c \
1051         src/core/namespace.h \
1052         src/core/build.h \
1053         src/core/sysfs-show.h \
1054         src/core/switch-root.h \
1055         src/core/switch-root.c \
1056         src/core/killall.h \
1057         src/core/killall.c \
1058         src/core/audit-fd.c \
1059         src/core/audit-fd.h \
1060         src/core/show-status.c \
1061         src/core/show-status.h
1062
1063 if HAVE_KMOD
1064 libsystemd_core_la_SOURCES += \
1065         src/core/kmod-setup.c \
1066         src/core/kmod-setup.h
1067 endif
1068
1069 nodist_libsystemd_core_la_SOURCES = \
1070         src/core/load-fragment-gperf.c \
1071         src/core/load-fragment-gperf-nulstr.c
1072
1073 libsystemd_core_la_CFLAGS = \
1074         $(AM_CFLAGS) \
1075         $(PAM_CFLAGS) \
1076         $(AUDIT_CFLAGS) \
1077         $(CAP_CFLAGS) \
1078         $(KMOD_CFLAGS) \
1079         $(APPARMOR_CFLAGS) \
1080         $(SECCOMP_CFLAGS) \
1081         -pthread
1082
1083 libsystemd_core_la_LIBADD = \
1084         libsystemd-capability.la \
1085         libsystemd-units.la \
1086         libsystemd-label.la \
1087         libudev-internal.la \
1088         libsystemd-shared.la \
1089         libsystemd-internal.la \
1090         $(PAM_LIBS) \
1091         $(AUDIT_LIBS) \
1092         $(CAP_LIBS) \
1093         $(KMOD_LIBS) \
1094         $(APPARMOR_LIBS) \
1095         $(SECCOMP_LIBS)
1096
1097 if HAVE_SECCOMP
1098 libsystemd_core_la_LIBADD += \
1099         libsystemd-seccomp.la
1100 endif
1101
1102 src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
1103         $(AM_V_at)$(MKDIR_P) $(dir $@)
1104         $(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 ";" }' < $< > $@
1105
1106 EXTRA_DIST += \
1107         src/core/load-fragment-gperf.gperf.m4
1108
1109 CLEANFILES += \
1110         src/core/load-fragment-gperf.gperf \
1111         src/core/load-fragment-gperf.c \
1112         src/core/load-fragment-gperf-nulstr.c \
1113         src/shared/errno-list.txt \
1114         src/shared/errno-from-name.gperf \
1115         src/shared/af-list.txt \
1116         src/shared/af-from-name.gperf
1117
1118 BUILT_SOURCES += \
1119         src/shared/errno-from-name.h \
1120         src/shared/errno-to-name.h \
1121         src/shared/af-from-name.h \
1122         src/shared/af-to-name.h
1123
1124 src/shared/errno-list.txt:
1125         $(AM_V_at)$(MKDIR_P) $(dir $@)
1126         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }'  > $@
1127
1128 src/shared/errno-from-name.gperf: src/shared/errno-list.txt
1129         $(AM_V_at)$(MKDIR_P) $(dir $@)
1130         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct errno_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
1131
1132 src/shared/errno-from-name.h: src/shared/errno-from-name.gperf
1133         $(AM_V_at)$(MKDIR_P) $(dir $@)
1134         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_errno -H hash_errno_name -p -C < $< > $@
1135
1136 src/shared/errno-to-name.h: src/shared/errno-list.txt
1137         $(AM_V_at)$(MKDIR_P) $(dir $@)
1138         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
1139
1140 src/shared/af-list.txt:
1141         $(AM_V_at)$(MKDIR_P) $(dir $@)
1142         $(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; }'  > $@
1143
1144 src/shared/af-from-name.gperf: src/shared/af-list.txt
1145         $(AM_V_at)$(MKDIR_P) $(dir $@)
1146         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct af_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
1147
1148 src/shared/af-from-name.h: src/shared/af-from-name.gperf
1149         $(AM_V_at)$(MKDIR_P) $(dir $@)
1150         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_af -H hash_af_name -p -C < $< > $@
1151
1152 src/shared/af-to-name.h: src/shared/af-list.txt
1153         $(AM_V_at)$(MKDIR_P) $(dir $@)
1154         $(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 "};"}' < $< > $@
1155
1156 # ------------------------------------------------------------------------------
1157 systemd_SOURCES = \
1158         src/core/main.c
1159
1160 systemd_CFLAGS = \
1161         $(AM_CFLAGS) \
1162         $(SECCOMP_CFLAGS)
1163
1164 systemd_LDADD = \
1165         libsystemd-core.la \
1166         $(RT_LIBS)
1167
1168 dist_pkgsysconf_DATA += \
1169         src/core/system.conf \
1170         src/core/user.conf
1171
1172 dist_dbuspolicy_DATA += \
1173         src/core/org.freedesktop.systemd1.conf
1174
1175 dist_dbussystemservice_DATA += \
1176         src/core/org.freedesktop.systemd1.service
1177
1178 polkitpolicy_in_in_files += \
1179         src/core/org.freedesktop.systemd1.policy.in.in
1180
1181 pkgconfigdata_DATA = \
1182         src/core/systemd.pc
1183
1184 nodist_rpmmacros_DATA = \
1185         src/core/macros.systemd
1186
1187 EXTRA_DIST += \
1188         src/core/systemd.pc.in \
1189         src/core/macros.systemd.in
1190
1191 CLEANFILES += \
1192         src/core/macros.systemd \
1193         src/core/org.freedesktop.systemd1.policy.in
1194
1195 # ------------------------------------------------------------------------------
1196 manual_tests += \
1197         test-engine \
1198         test-ns \
1199         test-loopback \
1200         test-hostname \
1201         test-daemon \
1202         test-cgroup \
1203         test-cgroup-mask \
1204         test-install \
1205         test-watchdog \
1206         test-log \
1207         test-ipcrm
1208
1209 if HAVE_KMOD
1210 manual_tests += \
1211         test-rtnl-manual
1212 endif
1213
1214 tests += \
1215         test-job-type \
1216         test-env-replace \
1217         test-strbuf \
1218         test-strv \
1219         test-path-util \
1220         test-strxcpyx \
1221         test-unit-name \
1222         test-unit-file \
1223         test-utf8 \
1224         test-ellipsize \
1225         test-util \
1226         test-ring \
1227         test-tmpfiles \
1228         test-namespace \
1229         test-date \
1230         test-sleep \
1231         test-replace-var \
1232         test-sched-prio \
1233         test-calendarspec \
1234         test-strip-tab-ansi \
1235         test-cgroup-util \
1236         test-prioq \
1237         test-fileio \
1238         test-time \
1239         test-hashmap \
1240         test-list \
1241         test-tables \
1242         test-device-nodes \
1243         test-xml \
1244         test-architecture \
1245         test-socket-util \
1246         test-fdset \
1247         test-conf-files
1248
1249 EXTRA_DIST += \
1250         test/sched_idle_bad.service \
1251         test/sched_idle_ok.service \
1252         test/sched_rr_bad.service \
1253         test/sched_rr_ok.service \
1254         test/sched_rr_change.service \
1255         test/son.service \
1256         test/daughter.service \
1257         test/parent.slice
1258
1259 EXTRA_DIST += \
1260         src/test/test-helper.h
1261
1262 test_device_nodes_SOURCES = \
1263         src/test/test-device-nodes.c
1264
1265 test_device_nodes_LDADD = \
1266         libsystemd-shared.la
1267
1268 test_engine_SOURCES = \
1269         src/test/test-engine.c
1270
1271 test_engine_CFLAGS = \
1272         $(AM_CFLAGS) \
1273         $(SECCOMP_CFLAGS)
1274
1275 test_engine_LDADD = \
1276         libsystemd-core.la \
1277         $(RT_LIBS)
1278
1279 test_job_type_SOURCES = \
1280         src/test/test-job-type.c
1281
1282 test_job_type_CFLAGS = \
1283         $(AM_CFLAGS) \
1284         $(SECCOMP_CFLAGS)
1285
1286 test_job_type_LDADD = \
1287         libsystemd-core.la \
1288         $(RT_LIBS)
1289
1290 test_ns_SOURCES = \
1291         src/test/test-ns.c
1292
1293 test_ns_CFLAGS = \
1294         $(AM_CFLAGS) \
1295         $(SECCOMP_CFLAGS)
1296
1297 test_ns_LDADD = \
1298         libsystemd-core.la
1299
1300 test_loopback_SOURCES = \
1301         src/test/test-loopback.c
1302
1303 test_loopback_LDADD = \
1304         libsystemd-core.la
1305
1306 test_hostname_SOURCES = \
1307         src/test/test-hostname.c
1308
1309 test_hostname_LDADD = \
1310         libsystemd-core.la
1311
1312 if ENABLE_EFI
1313 manual_tests += \
1314         test-boot-timestamp
1315
1316 test_boot_timestamp_SOURCES = \
1317         src/test/test-boot-timestamps.c
1318
1319 test_boot_timestamp_LDADD = \
1320         libsystemd-shared.la
1321 endif
1322
1323 test_unit_name_SOURCES = \
1324         src/test/test-unit-name.c
1325
1326 test_unit_name_CFLAGS = \
1327         $(AM_CFLAGS) \
1328         $(SECCOMP_CFLAGS)
1329
1330 test_unit_name_LDADD = \
1331         libsystemd-core.la \
1332         $(RT_LIBS)
1333
1334 test_unit_file_SOURCES = \
1335         src/test/test-unit-file.c
1336
1337 test_unit_file_CFLAGS = \
1338         $(AM_CFLAGS) \
1339         $(SECCOMP_CFLAGS)
1340
1341 test_unit_file_LDADD = \
1342         libsystemd-core.la \
1343         $(RT_LIBS)
1344
1345 test_utf8_SOURCES = \
1346         src/test/test-utf8.c
1347
1348 test_utf8_LDADD = \
1349         libsystemd-shared.la
1350
1351 test_fdset_SOURCES = \
1352         src/test/test-fdset.c
1353
1354 test_fdset_LDADD = \
1355         libsystemd-core.la
1356
1357 test_util_SOURCES = \
1358         src/test/test-util.c
1359
1360 test_util_LDADD = \
1361         libsystemd-core.la
1362
1363 test_socket_util_SOURCES = \
1364         src/test/test-socket-util.c
1365
1366 test_socket_util_LDADD = \
1367         libsystemd-core.la
1368
1369 test_ring_SOURCES = \
1370         src/test/test-ring.c
1371
1372 test_ring_LDADD = \
1373         libsystemd-core.la
1374
1375 test_tmpfiles_SOURCES = \
1376         src/test/test-tmpfiles.c
1377
1378 test_tmpfiles_LDADD = \
1379         libsystemd-shared.la
1380
1381 test_namespace_SOURCES = \
1382         src/test/test-namespace.c
1383
1384 test_namespace_LDADD = \
1385         libsystemd-core.la
1386
1387 test_hashmap_SOURCES = \
1388         src/test/test-hashmap.c
1389
1390 test_hashmap_LDADD = \
1391         libsystemd-core.la
1392
1393 test_xml_SOURCES = \
1394         src/test/test-xml.c
1395
1396 test_xml_LDADD = \
1397         libsystemd-shared.la
1398
1399 test_list_SOURCES = \
1400         src/test/test-list.c
1401
1402 test_list_LDADD = \
1403         libsystemd-core.la
1404
1405 test_tables_SOURCES = \
1406         src/test/test-tables.c \
1407         src/shared/test-tables.h
1408
1409 test_tables_CFLAGS = \
1410         $(AM_CFLAGS) \
1411         $(SECCOMP_CFLAGS)
1412
1413 test_tables_LDADD = \
1414         libsystemd-logs.la \
1415         libsystemd-journal-internal.la \
1416         libsystemd-core.la \
1417         $(RT_LIBS)
1418
1419 test_prioq_SOURCES = \
1420         src/test/test-prioq.c
1421
1422 test_prioq_LDADD = \
1423         libsystemd-core.la
1424
1425 test_fileio_SOURCES = \
1426         src/test/test-fileio.c
1427
1428 test_fileio_LDADD = \
1429         libsystemd-core.la
1430
1431 test_time_SOURCES = \
1432         src/test/test-time.c
1433
1434 test_time_LDADD = \
1435         libsystemd-core.la
1436
1437 test_architecture_SOURCES = \
1438         src/test/test-architecture.c
1439
1440 test_architecture_LDADD = \
1441         libsystemd-shared.la
1442
1443 test_log_SOURCES = \
1444         src/test/test-log.c
1445
1446 test_log_LDADD = \
1447         libsystemd-core.la
1448
1449 test_ipcrm_SOURCES = \
1450         src/test/test-ipcrm.c
1451
1452 test_ipcrm_LDADD = \
1453         libsystemd-shared.la \
1454         -lrt
1455
1456 test_rtnl_manual_SOURCES = \
1457         src/test/test-rtnl-manual.c
1458
1459 test_rtnl_manual_CFLAGS = \
1460         $(AM_CFLAGS) \
1461         $(KMOD_CFLAGS)
1462
1463 test_rtnl_manual_LDADD = \
1464         libsystemd-internal.la \
1465         libsystemd-shared.la \
1466         $(KMOD_LIBS)
1467
1468 test_ellipsize_SOURCES = \
1469         src/test/test-ellipsize.c
1470
1471 test_ellipsize_LDADD = \
1472         libsystemd-core.la
1473
1474 test_date_SOURCES = \
1475         src/test/test-date.c
1476
1477 test_date_LDADD = \
1478         libsystemd-core.la
1479
1480 test_sleep_SOURCES = \
1481         src/test/test-sleep.c
1482
1483 test_sleep_LDADD = \
1484         libsystemd-core.la
1485
1486 test_replace_var_SOURCES = \
1487         src/test/test-replace-var.c
1488
1489 test_replace_var_LDADD = \
1490         libsystemd-shared.la
1491
1492 test_calendarspec_SOURCES = \
1493         src/test/test-calendarspec.c
1494
1495 test_calendarspec_LDADD = \
1496         libsystemd-shared.la
1497
1498 test_strip_tab_ansi_SOURCES = \
1499         src/test/test-strip-tab-ansi.c
1500
1501 test_strip_tab_ansi_LDADD = \
1502         libsystemd-shared.la
1503
1504 test_daemon_SOURCES = \
1505         src/test/test-daemon.c
1506
1507 test_daemon_LDADD = \
1508         libsystemd-internal.la \
1509         libsystemd-shared.la
1510
1511 test_cgroup_SOURCES = \
1512         src/test/test-cgroup.c
1513
1514 test_cgroup_LDADD = \
1515         libsystemd-label.la \
1516         libsystemd-shared.la \
1517         libsystemd-internal.la
1518
1519 test_cgroup_mask_SOURCES = \
1520         src/test/test-cgroup-mask.c
1521
1522 test_cgroup_mask_CPPFLAGS = \
1523         $(AM_CPPFLAGS) \
1524         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1525
1526 test_cgroup_mask_CFLAGS = \
1527         $(AM_CFLAGS) \
1528         $(SECCOMP_CFLAGS)
1529
1530 test_cgroup_mask_LDADD = \
1531         libsystemd-core.la \
1532         $(RT_LIBS)
1533
1534 test_cgroup_util_SOURCES = \
1535         src/test/test-cgroup-util.c
1536
1537 test_cgroup_util_LDADD = \
1538         libsystemd-label.la \
1539         libsystemd-internal.la \
1540         libsystemd-shared.la
1541
1542 test_env_replace_SOURCES = \
1543         src/test/test-env-replace.c
1544
1545 test_env_replace_LDADD = \
1546         libsystemd-shared.la
1547
1548 test_strbuf_SOURCES = \
1549         src/test/test-strbuf.c
1550
1551 test_strbuf_LDADD = \
1552         libsystemd-shared.la
1553
1554 test_strv_SOURCES = \
1555         src/test/test-strv.c
1556
1557 test_strv_LDADD = \
1558         libsystemd-units.la \
1559         libsystemd-internal.la \
1560         libsystemd-shared.la
1561
1562 test_path_util_SOURCES = \
1563         src/test/test-path-util.c
1564
1565 test_path_util_LDADD = \
1566         libsystemd-shared.la
1567
1568 test_strxcpyx_SOURCES = \
1569         src/test/test-strxcpyx.c
1570
1571 test_strxcpyx_LDADD = \
1572         libsystemd-shared.la
1573
1574 test_install_SOURCES = \
1575         src/test/test-install.c
1576
1577 test_install_LDADD = \
1578         libsystemd-units.la \
1579         libsystemd-label.la \
1580         libsystemd-shared.la \
1581         libsystemd-internal.la
1582
1583 test_watchdog_SOURCES = \
1584         src/test/test-watchdog.c
1585
1586 test_watchdog_LDADD = \
1587         libsystemd-shared.la
1588
1589 test_sched_prio_SOURCES = \
1590         src/test/test-sched-prio.c
1591
1592 test_sched_prio_CPPFLAGS = \
1593         $(AM_CPPFLAGS) \
1594         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1595
1596 test_sched_prio_CFLAGS = \
1597         $(AM_CFLAGS) \
1598         $(SECCOMP_CFLAGS)
1599
1600 test_sched_prio_LDADD = \
1601         libsystemd-core.la \
1602         $(RT_LIBS)
1603
1604 test_conf_files_SOURCES = \
1605         src/test/test-conf-files.c
1606
1607 test_conf_files_LDADD = \
1608         libsystemd-shared.la
1609
1610 # ------------------------------------------------------------------------------
1611 ## .PHONY so it always rebuilds it
1612 .PHONY: coverage lcov-run lcov-report coverage-sync
1613
1614 # run lcov from scratch, always
1615 coverage:
1616         $(MAKE) lcov-run
1617         $(MAKE) lcov-report
1618
1619 coverage_dir = coverage
1620 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
1621
1622 if ENABLE_COVERAGE
1623 # reset run coverage tests
1624 lcov-run:
1625         @rm -rf $(coverage_dir)
1626         lcov $(coverage_opts) --zerocounters
1627         -$(MAKE) check
1628
1629 # generate report based on current coverage data
1630 lcov-report:
1631         $(MKDIR_P) $(coverage_dir)
1632         lcov $(coverage_opts) --compat-libtool --capture --no-external \
1633                 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
1634         genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov.info
1635         @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
1636
1637 # lcov doesn't work properly with vpath builds, make sure that bad
1638 # output is not uploaded by mistake.
1639 coverage-sync: coverage
1640         test "$(builddir)" = "$(srcdir)"
1641         rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
1642
1643 else
1644 lcov-run lcov-report:
1645         echo "Need to reconfigure with --enable-coverage"
1646 endif
1647
1648 # ------------------------------------------------------------------------------
1649 systemd_analyze_SOURCES = \
1650         src/analyze/analyze.c
1651
1652 systemd_analyze_LDADD = \
1653         libsystemd-internal.la \
1654         libsystemd-shared.la
1655
1656 # ------------------------------------------------------------------------------
1657 systemd_initctl_SOURCES = \
1658         src/initctl/initctl.c
1659
1660 systemd_initctl_LDADD = \
1661         libsystemd-internal.la \
1662         libsystemd-shared.la
1663
1664 # ------------------------------------------------------------------------------
1665 systemd_update_utmp_SOURCES = \
1666         src/update-utmp/update-utmp.c
1667
1668 systemd_update_utmp_CFLAGS = \
1669         $(AM_CFLAGS) \
1670         $(AUDIT_CFLAGS)
1671
1672 systemd_update_utmp_LDADD = \
1673         libsystemd-internal.la \
1674         libsystemd-shared.la \
1675         $(AUDIT_LIBS)
1676
1677 # ------------------------------------------------------------------------------
1678 systemd_update_done_SOURCES = \
1679         src/update-done/update-done.c
1680
1681 systemd_update_done_LDADD = \
1682         libsystemd-internal.la \
1683         libsystemd-shared.la
1684
1685 # ------------------------------------------------------------------------------
1686 systemd_shutdownd_SOURCES = \
1687         src/shutdownd/shutdownd.c
1688
1689 systemd_shutdownd_LDADD = \
1690         libsystemd-label.la \
1691         libsystemd-internal.la \
1692         libsystemd-shared.la
1693
1694 dist_doc_DATA += \
1695         src/systemd/sd-shutdown.h
1696
1697 # ------------------------------------------------------------------------------
1698 systemd_shutdown_SOURCES = \
1699         src/core/umount.c \
1700         src/core/umount.h \
1701         src/core/shutdown.c \
1702         src/core/mount-setup.c \
1703         src/core/mount-setup.h \
1704         src/core/killall.h \
1705         src/core/killall.c
1706
1707 systemd_shutdown_LDADD = \
1708         libsystemd-label.la \
1709         libudev-internal.la \
1710         libsystemd-shared.la
1711
1712 # ------------------------------------------------------------------------------
1713 if HAVE_KMOD
1714 systemd_modules_load_SOURCES = \
1715         src/modules-load/modules-load.c
1716
1717 systemd_modules_load_CFLAGS = \
1718         $(AM_CFLAGS) \
1719         $(KMOD_CFLAGS)
1720
1721 systemd_modules_load_LDADD = \
1722         libsystemd-shared.la \
1723         $(KMOD_LIBS)
1724
1725 rootlibexec_PROGRAMS += \
1726         systemd-modules-load
1727
1728 nodist_systemunit_DATA += \
1729         units/systemd-modules-load.service
1730
1731 SYSINIT_TARGET_WANTS += \
1732         systemd-modules-load.service
1733
1734 if ENABLE_TMPFILES
1735 nodist_systemunit_DATA += \
1736         units/kmod-static-nodes.service
1737
1738 SYSINIT_TARGET_WANTS += \
1739         kmod-static-nodes.service
1740 endif
1741 endif
1742
1743 EXTRA_DIST += \
1744         units/systemd-modules-load.service.in \
1745         units/kmod-static-nodes.service.in
1746
1747 # ------------------------------------------------------------------------------
1748 if ENABLE_TMPFILES
1749 systemd_tmpfiles_SOURCES = \
1750         src/tmpfiles/tmpfiles.c
1751
1752 systemd_tmpfiles_LDADD = \
1753         libsystemd-units.la \
1754         libsystemd-label.la \
1755         libsystemd-capability.la \
1756         libsystemd-internal.la \
1757         libsystemd-shared.la
1758
1759 rootbin_PROGRAMS += \
1760         systemd-tmpfiles
1761
1762 dist_systemunit_DATA += \
1763         units/systemd-tmpfiles-clean.timer
1764
1765 nodist_systemunit_DATA += \
1766         units/systemd-tmpfiles-setup-dev.service \
1767         units/systemd-tmpfiles-setup.service \
1768         units/systemd-tmpfiles-clean.service
1769
1770 dist_tmpfiles_DATA = \
1771         tmpfiles.d/systemd.conf \
1772         tmpfiles.d/systemd-nologin.conf \
1773         tmpfiles.d/tmp.conf \
1774         tmpfiles.d/x11.conf \
1775         tmpfiles.d/var.conf \
1776         tmpfiles.d/etc.conf
1777
1778 if HAVE_SYSV_COMPAT
1779 dist_tmpfiles_DATA += \
1780         tmpfiles.d/legacy.conf
1781 endif
1782
1783 SYSINIT_TARGET_WANTS += \
1784         systemd-tmpfiles-setup-dev.service \
1785         systemd-tmpfiles-setup.service
1786
1787 dist_zshcompletion_DATA += \
1788         shell-completion/zsh/_systemd-tmpfiles
1789
1790 TIMERS_TARGET_WANTS += \
1791         systemd-tmpfiles-clean.timer
1792
1793 INSTALL_DIRS += \
1794         $(tmpfilesdir) \
1795         $(sysconfdir)/tmpfiles.d
1796 endif
1797
1798 EXTRA_DIST += \
1799         units/systemd-tmpfiles-setup-dev.service.in \
1800         units/systemd-tmpfiles-setup.service.in \
1801         units/systemd-tmpfiles-clean.service.in
1802
1803 # ------------------------------------------------------------------------------
1804 if ENABLE_SYSUSERS
1805 systemd_sysusers_SOURCES = \
1806         src/sysusers/sysusers.c
1807
1808 systemd_sysusers_LDADD = \
1809         libsystemd-units.la \
1810         libsystemd-label.la \
1811         libsystemd-capability.la \
1812         libsystemd-internal.la \
1813         libsystemd-shared.la
1814
1815 rootbin_PROGRAMS += \
1816         systemd-sysusers
1817
1818 nodist_systemunit_DATA += \
1819         units/systemd-sysusers.service
1820
1821 SYSINIT_TARGET_WANTS += \
1822         systemd-sysusers.service
1823
1824 nodist_sysusers_DATA = \
1825         sysusers.d/systemd.conf
1826
1827 EXTRA_DIST += \
1828         units/systemd-sysusers.service.in \
1829         sysusers.d/systemd.conf.in
1830
1831 INSTALL_DIRS += \
1832         $(sysusersdir)
1833 endif
1834
1835 # ------------------------------------------------------------------------------
1836 systemd_machine_id_setup_SOURCES = \
1837         src/machine-id-setup/machine-id-setup-main.c \
1838         src/core/machine-id-setup.c \
1839         src/core/machine-id-setup.h
1840
1841 systemd_machine_id_setup_LDADD = \
1842         libsystemd-label.la \
1843         libsystemd-internal.la \
1844         libsystemd-shared.la
1845
1846 # ------------------------------------------------------------------------------
1847 systemd_sysctl_SOURCES = \
1848         src/sysctl/sysctl.c
1849
1850 systemd_sysctl_LDADD = \
1851         libsystemd-shared.la
1852
1853 # ------------------------------------------------------------------------------
1854 systemd_sleep_SOURCES = \
1855         src/sleep/sleep.c
1856
1857 systemd_sleep_LDADD = \
1858         libsystemd-shared.la
1859
1860 # ------------------------------------------------------------------------------
1861 systemd_fsck_SOURCES = \
1862         src/fsck/fsck.c
1863
1864 systemd_fsck_LDADD = \
1865         libsystemd-internal.la \
1866         libudev-internal.la \
1867         libsystemd-shared.la
1868
1869 # ------------------------------------------------------------------------------
1870 systemd_ac_power_SOURCES = \
1871         src/ac-power/ac-power.c
1872
1873 systemd_ac_power_LDADD = \
1874         libudev-internal.la \
1875         libsystemd-shared.la
1876
1877 # ------------------------------------------------------------------------------
1878 systemd_detect_virt_SOURCES = \
1879         src/detect-virt/detect-virt.c
1880
1881 systemd_detect_virt_LDADD = \
1882         libsystemd-shared.la
1883
1884 INSTALL_EXEC_HOOKS += \
1885         systemd-detect-virt-install-hook
1886
1887 # ------------------------------------------------------------------------------
1888 systemd_delta_SOURCES = \
1889         src/delta/delta.c
1890
1891 systemd_delta_LDADD = \
1892         libsystemd-shared.la
1893
1894 # ------------------------------------------------------------------------------
1895 systemd_getty_generator_SOURCES = \
1896         src/getty-generator/getty-generator.c
1897
1898 systemd_getty_generator_LDADD = \
1899         libsystemd-label.la \
1900         libsystemd-shared.la
1901
1902 # ------------------------------------------------------------------------------
1903 systemd_debug_generator_SOURCES = \
1904         src/debug-generator/debug-generator.c
1905
1906 systemd_debug_generator_LDADD = \
1907         libsystemd-label.la \
1908         libsystemd-shared.la
1909
1910 # ------------------------------------------------------------------------------
1911 systemd_fstab_generator_SOURCES = \
1912         src/fstab-generator/fstab-generator.c \
1913         src/core/mount-setup.c
1914
1915 systemd_fstab_generator_LDADD = \
1916         libsystemd-label.la \
1917         libsystemd-shared.la
1918
1919 # ------------------------------------------------------------------------------
1920 systemd_system_update_generator_SOURCES = \
1921         src/system-update-generator/system-update-generator.c
1922
1923 systemd_system_update_generator_LDADD = \
1924         libsystemd-label.la \
1925         libsystemd-shared.la
1926
1927 if ENABLE_EFI
1928 # ------------------------------------------------------------------------------
1929 systemgenerator_PROGRAMS +=  \
1930         systemd-efi-boot-generator
1931
1932 systemd_efi_boot_generator_SOURCES = \
1933         src/efi-boot-generator/efi-boot-generator.c
1934
1935 systemd_efi_boot_generator_LDADD = \
1936         libsystemd-label.la \
1937         libsystemd-shared.la
1938
1939 # ------------------------------------------------------------------------------
1940 bootctl_SOURCES = \
1941         src/boot/boot.h \
1942         src/boot/boot-loader.h \
1943         src/boot/bootctl.c \
1944         src/boot/boot-loader.c \
1945         src/boot/boot-efi.c
1946
1947 bootctl_LDADD = \
1948         libsystemd-shared.la \
1949         libsystemd-internal.la
1950
1951 bin_PROGRAMS += \
1952         bootctl
1953
1954 dist_bashcompletion_DATA += \
1955         shell-completion/bash/bootctl
1956
1957 dist_zshcompletion_DATA += \
1958         shell-completion/zsh/_bootctl
1959
1960 endif
1961
1962 # ------------------------------------------------------------------------------
1963 if HAVE_BLKID
1964 systemgenerator_PROGRAMS +=  \
1965         systemd-gpt-auto-generator
1966
1967 systemd_gpt_auto_generator_SOURCES = \
1968         src/gpt-auto-generator/gpt-auto-generator.c \
1969         src/shared/blkid-util.h
1970
1971 systemd_gpt_auto_generator_LDADD = \
1972         libsystemd-label.la \
1973         libsystemd-internal.la \
1974         libudev-internal.la \
1975         libsystemd-shared.la \
1976         $(BLKID_LIBS)
1977
1978 systemd_gpt_auto_generator_CFLAGS = \
1979         $(AM_CFLAGS) \
1980         $(BLKID_CFLAGS)
1981 endif
1982
1983 # ------------------------------------------------------------------------------
1984 if ENABLE_KDBUS
1985 systemgenerator_PROGRAMS +=  \
1986         systemd-dbus1-generator
1987
1988 systemd_dbus1_generator_SOURCES = \
1989         src/dbus1-generator/dbus1-generator.c
1990
1991 systemd_dbus1_generator_LDADD = \
1992         libsystemd-label.la \
1993         libsystemd-shared.la \
1994         libsystemd-internal.la
1995
1996 dbus1-generator-install-hook:
1997         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
1998         $(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
1999         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2000
2001 dbus1-generator-uninstall-hook:
2002         rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2003
2004 INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
2005 UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
2006 endif
2007
2008 # ------------------------------------------------------------------------------
2009 systemd_sysv_generator_SOURCES = \
2010         src/sysv-generator/sysv-generator.c
2011
2012 systemd_sysv_generator_LDADD = \
2013         libsystemd-core.la \
2014         libsystemd-label.la \
2015         libsystemd-shared.la
2016
2017 # ------------------------------------------------------------------------------
2018 systemd_rc_local_generator_SOURCES = \
2019         src/rc-local-generator/rc-local-generator.c
2020
2021 systemd_rc_local_generator_LDADD = \
2022         libsystemd-label.la \
2023         libsystemd-shared.la
2024
2025 # ------------------------------------------------------------------------------
2026 systemd_remount_fs_SOURCES = \
2027         src/remount-fs/remount-fs.c \
2028         src/core/mount-setup.c \
2029         src/core/mount-setup.h
2030
2031 systemd_remount_fs_LDADD = \
2032         libsystemd-label.la \
2033         libsystemd-shared.la
2034
2035 # ------------------------------------------------------------------------------
2036 systemd_cgroups_agent_SOURCES = \
2037         src/cgroups-agent/cgroups-agent.c
2038
2039 systemd_cgroups_agent_LDADD = \
2040         libsystemd-internal.la \
2041         libsystemd-shared.la
2042
2043 # ------------------------------------------------------------------------------
2044 systemctl_SOURCES = \
2045         src/systemctl/systemctl.c
2046
2047 systemctl_LDADD = \
2048         libsystemd-units.la \
2049         libsystemd-label.la \
2050         libsystemd-internal.la \
2051         libsystemd-logs.la \
2052         libsystemd-journal-internal.la \
2053         libsystemd-shared.la
2054
2055 # ------------------------------------------------------------------------------
2056 systemd_notify_SOURCES = \
2057         src/notify/notify.c \
2058         src/readahead/sd-readahead.c
2059
2060 systemd_notify_LDADD = \
2061         libsystemd-internal.la \
2062         libsystemd-shared.la
2063
2064 # ------------------------------------------------------------------------------
2065 systemd_ask_password_SOURCES = \
2066         src/ask-password/ask-password.c
2067
2068 systemd_ask_password_LDADD = \
2069         libsystemd-label.la \
2070         libsystemd-shared.la
2071
2072 # ------------------------------------------------------------------------------
2073 systemd_reply_password_SOURCES = \
2074         src/reply-password/reply-password.c
2075
2076 systemd_reply_password_LDADD = \
2077         libsystemd-shared.la
2078
2079 # ------------------------------------------------------------------------------
2080 systemd_cgls_SOURCES = \
2081         src/cgls/cgls.c
2082
2083 systemd_cgls_LDADD = \
2084         libsystemd-internal.la \
2085         libsystemd-shared.la
2086
2087 # ------------------------------------------------------------------------------
2088 systemd_cgtop_SOURCES = \
2089         src/cgtop/cgtop.c
2090
2091 systemd_cgtop_LDADD = \
2092         libsystemd-shared.la
2093
2094 # ------------------------------------------------------------------------------
2095 systemd_nspawn_SOURCES = \
2096         src/nspawn/nspawn.c \
2097         src/core/mount-setup.c \
2098         src/core/mount-setup.h \
2099         src/core/loopback-setup.c \
2100         src/core/loopback-setup.h
2101
2102 systemd_nspawn_CFLAGS = \
2103         $(AM_CFLAGS) \
2104         $(SECCOMP_CFLAGS) \
2105         $(BLKID_CFLAGS)
2106
2107 systemd_nspawn_LDADD = \
2108         libsystemd-label.la \
2109         libsystemd-capability.la \
2110         libsystemd-internal.la \
2111         libudev-internal.la \
2112         libsystemd-shared.la \
2113         $(BLKID_LIBS)
2114
2115 if HAVE_SECCOMP
2116 systemd_nspawn_LDADD += \
2117         libsystemd-seccomp.la \
2118         $(SECCOMP_LIBS)
2119 endif
2120
2121 # ------------------------------------------------------------------------------
2122 systemd_run_SOURCES = \
2123         src/run/run.c
2124
2125 systemd_run_LDADD = \
2126         libsystemd-label.la \
2127         libsystemd-capability.la \
2128         libsystemd-internal.la \
2129         libsystemd-shared.la
2130
2131 # ------------------------------------------------------------------------------
2132 systemd_bus_proxyd_SOURCES = \
2133         src/bus-proxyd/bus-proxyd.c \
2134         src/bus-proxyd/bus-policy.c \
2135         src/bus-proxyd/bus-policy.h
2136
2137 systemd_bus_proxyd_LDADD = \
2138         libsystemd-capability.la \
2139         libsystemd-internal.la \
2140         libsystemd-shared.la
2141
2142 bus-proxyd-install-hook:
2143         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
2144         $(AM_V_RM)rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
2145         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
2146
2147 bus-proxyd-uninstall-hook:
2148         rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
2149
2150 INSTALL_EXEC_HOOKS += bus-proxyd-install-hook
2151 UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook
2152
2153 if ENABLE_KDBUS
2154 nodist_systemunit_DATA += \
2155         units/systemd-bus-proxyd@.service
2156
2157 dist_systemunit_DATA += \
2158         units/systemd-bus-proxyd.socket
2159
2160 dist_userunit_DATA += \
2161         units/user/systemd-bus-proxyd.socket \
2162         units/user/systemd-bus-proxyd@.service
2163 endif
2164
2165 EXTRA_DIST += \
2166         units/systemd-bus-proxyd@.service.in
2167
2168 # ------------------------------------------------------------------------------
2169 systemd_tty_ask_password_agent_SOURCES = \
2170         src/tty-ask-password-agent/tty-ask-password-agent.c
2171
2172 systemd_tty_ask_password_agent_LDADD = \
2173         libsystemd-label.la \
2174         libsystemd-shared.la
2175
2176 # ------------------------------------------------------------------------------
2177 libsystemd_internal_la_SOURCES = \
2178         src/systemd/sd-bus.h \
2179         src/systemd/sd-bus-protocol.h \
2180         src/systemd/sd-bus-vtable.h \
2181         src/systemd/sd-memfd.h \
2182         src/systemd/sd-utf8.h \
2183         src/systemd/sd-event.h \
2184         src/systemd/sd-rtnl.h \
2185         src/systemd/sd-resolve.h \
2186         src/systemd/sd-login.h \
2187         src/systemd/sd-id128.h \
2188         src/systemd/sd-daemon.h \
2189         src/libsystemd/sd-bus/sd-bus.c \
2190         src/libsystemd/sd-bus/bus-control.c \
2191         src/libsystemd/sd-bus/bus-control.h \
2192         src/libsystemd/sd-bus/bus-error.c \
2193         src/libsystemd/sd-bus/bus-error.h \
2194         src/libsystemd/sd-bus/bus-internal.c \
2195         src/libsystemd/sd-bus/bus-internal.h \
2196         src/libsystemd/sd-bus/bus-socket.c \
2197         src/libsystemd/sd-bus/bus-socket.h \
2198         src/libsystemd/sd-bus/bus-kernel.c \
2199         src/libsystemd/sd-bus/bus-kernel.h \
2200         src/libsystemd/sd-bus/bus-container.c \
2201         src/libsystemd/sd-bus/bus-container.h \
2202         src/libsystemd/sd-bus/bus-message.c \
2203         src/libsystemd/sd-bus/bus-message.h \
2204         src/libsystemd/sd-bus/bus-creds.c \
2205         src/libsystemd/sd-bus/bus-creds.h \
2206         src/libsystemd/sd-bus/bus-signature.c \
2207         src/libsystemd/sd-bus/bus-signature.h \
2208         src/libsystemd/sd-bus/bus-type.c \
2209         src/libsystemd/sd-bus/bus-type.h \
2210         src/libsystemd/sd-bus/bus-match.c \
2211         src/libsystemd/sd-bus/bus-match.h \
2212         src/libsystemd/sd-bus/bus-bloom.c \
2213         src/libsystemd/sd-bus/bus-bloom.h \
2214         src/libsystemd/sd-bus/bus-introspect.c \
2215         src/libsystemd/sd-bus/bus-introspect.h \
2216         src/libsystemd/sd-bus/bus-objects.c \
2217         src/libsystemd/sd-bus/bus-objects.h \
2218         src/libsystemd/sd-bus/bus-gvariant.c \
2219         src/libsystemd/sd-bus/bus-gvariant.h \
2220         src/libsystemd/sd-bus/bus-convenience.c \
2221         src/libsystemd/sd-bus/bus-track.c \
2222         src/libsystemd/sd-bus/bus-track.h \
2223         src/libsystemd/sd-bus/bus-util.c \
2224         src/libsystemd/sd-bus/bus-util.h \
2225         src/libsystemd/sd-bus/bus-slot.c \
2226         src/libsystemd/sd-bus/bus-slot.h \
2227         src/libsystemd/sd-bus/bus-protocol.h \
2228         src/libsystemd/sd-bus/kdbus.h \
2229         src/libsystemd/sd-bus/sd-memfd.c \
2230         src/libsystemd/sd-utf8/sd-utf8.c \
2231         src/libsystemd/sd-event/sd-event.c \
2232         src/libsystemd/sd-event/event-util.h \
2233         src/libsystemd/sd-rtnl/sd-rtnl.c \
2234         src/libsystemd/sd-rtnl/rtnl-internal.h \
2235         src/libsystemd/sd-rtnl/rtnl-message.c \
2236         src/libsystemd/sd-rtnl/rtnl-types.h \
2237         src/libsystemd/sd-rtnl/rtnl-types.c \
2238         src/libsystemd/sd-rtnl/rtnl-util.h \
2239         src/libsystemd/sd-rtnl/rtnl-util.c \
2240         src/libsystemd/sd-id128/sd-id128.c \
2241         src/libsystemd/sd-daemon/sd-daemon.c \
2242         src/libsystemd/sd-login/sd-login.c
2243
2244 nodist_libsystemd_internal_la_SOURCES = \
2245         src/libsystemd/libsystemd.sym \
2246         src/libsystemd/sd-bus/bus-error-mapping.c
2247
2248 libsystemd_internal_la_CFLAGS = \
2249         $(AM_CFLAGS) \
2250         -pthread
2251
2252 libsystemd_internal_la_LIBADD = \
2253         $(RT_LIBS)
2254
2255 libsystemd_resolve_la_SOURCES = \
2256         src/libsystemd/sd-resolve/sd-resolve.c \
2257         src/libsystemd/sd-resolve/resolve-util.h
2258
2259 libsystemd_resolve_la_CFLAGS = \
2260         $(AM_CFLAGS) \
2261         -pthread
2262
2263 libsystemd_resolve_la_LIBADD = \
2264         -lresolv
2265
2266 noinst_LTLIBRARIES += \
2267         libsystemd-internal.la \
2268         libsystemd-resolve.la
2269
2270 libsystemd_dump_la_SOURCES = \
2271         src/libsystemd/sd-bus/bus-dump.c \
2272         src/libsystemd/sd-bus/bus-dump.h
2273
2274 libsystemd_dump_la_CFLAGS = \
2275         $(AM_CFLAGS) \
2276         $(CAP_CFLAGS)
2277
2278 noinst_LTLIBRARIES += \
2279         libsystemd-dump.la
2280
2281 EXTRA_DIST += \
2282         src/libsystemd/libsystemd.sym.m4 \
2283         src/libsystemd/libsystemd.pc.in \
2284         src/libsystemd/sd-bus/bus-error-mapping.gperf \
2285         src/libsystemd/sd-bus/DIFFERENCES \
2286         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
2287
2288 CLEANFILES += \
2289         src/libsystemd/libsystemd.sym \
2290         src/libsystemd/sd-bus/bus-error-mapping.c
2291
2292 BUILT_SOURCES += \
2293         src/libsystemd/libsystemd.sym
2294
2295 libsystemd_la_SOURCES = \
2296         $(libsystemd_internal_la_SOURCES) \
2297         $(libsystemd_resolve_la_SOURCES) \
2298         $(libsystemd_journal_internal_la_SOURCES)
2299
2300 nodist_libsystemd_la_SOURCES = \
2301         $(nodist_libsystemd_internal_la_SOURCES)
2302
2303 libsystemd_la_CFLAGS = \
2304         $(libsystemd_internal_la_CFLAGS) \
2305         $(libsystemd_resolve_la_CFLAGS) \
2306         $(libsystemd_journal_internal_la_CFLAGS)
2307
2308 libsystemd_la_LDFLAGS = \
2309         $(AM_LDFLAGS) \
2310         -version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
2311         -Wl,--version-script=$(top_builddir)/src/libsystemd/libsystemd.sym
2312
2313 libsystemd_la_LIBADD = \
2314         libsystemd-shared.la \
2315         $(libsystemd_internal_la_LIBADD) \
2316         $(libsystemd_journal_internal_la_LIBADD) \
2317         $(libsystemd_resolve_la_LIBADD)
2318
2319 libsystemd-install-hook:
2320         libname=libsystemd.so && $(move-to-rootlibdir)
2321
2322 libsystemd-uninstall-hook:
2323         rm -f $(DESTDIR)$(rootlibdir)/libsystemd.so*
2324
2325 INSTALL_EXEC_HOOKS += libsystemd-install-hook
2326 UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook
2327
2328 pkgconfiglib_DATA += \
2329         src/libsystemd/libsystemd.pc
2330
2331 pkginclude_HEADERS += \
2332         src/systemd/sd-login.h \
2333         src/systemd/sd-id128.h \
2334         src/systemd/sd-daemon.h
2335
2336 if ENABLE_KDBUS
2337 pkginclude_HEADERS += \
2338         src/systemd/sd-bus.h \
2339         src/systemd/sd-bus-protocol.h \
2340         src/systemd/sd-bus-vtable.h \
2341         src/systemd/sd-memfd.h \
2342         src/systemd/sd-utf8.h \
2343         src/systemd/sd-event.h \
2344         src/systemd/sd-rtnl.h \
2345         src/systemd/sd-resolve.h
2346 endif
2347
2348 lib_LTLIBRARIES += \
2349         libsystemd.la
2350
2351 tests += \
2352         test-bus-marshal \
2353         test-bus-signature \
2354         test-bus-chat \
2355         test-bus-cleanup \
2356         test-bus-server \
2357         test-bus-match \
2358         test-bus-kernel \
2359         test-bus-kernel-bloom \
2360         test-bus-kernel-benchmark \
2361         test-bus-memfd \
2362         test-bus-zero-copy \
2363         test-bus-introspect \
2364         test-bus-objects \
2365         test-bus-error \
2366         test-bus-creds \
2367         test-bus-gvariant \
2368         test-event \
2369         test-rtnl \
2370         test-resolve
2371
2372 bin_PROGRAMS += \
2373         busctl
2374
2375 test_bus_marshal_SOURCES = \
2376         src/libsystemd/sd-bus/test-bus-marshal.c
2377
2378 test_bus_marshal_LDADD = \
2379         libsystemd-internal.la \
2380         libsystemd-shared.la \
2381         libsystemd-dump.la \
2382         libsystemd-capability.la \
2383         $(GLIB_LIBS) \
2384         $(DBUS_LIBS) \
2385         $(CAP_LIBS)
2386
2387 test_bus_marshal_CFLAGS = \
2388         $(AM_CFLAGS) \
2389         $(GLIB_CFLAGS) \
2390         $(DBUS_CFLAGS) \
2391         $(CAP_CFLAGS)
2392
2393 test_bus_signature_SOURCES = \
2394         src/libsystemd/sd-bus/test-bus-signature.c
2395
2396 test_bus_signature_LDADD = \
2397         libsystemd-shared.la \
2398         libsystemd-internal.la
2399
2400 test_bus_chat_SOURCES = \
2401         src/libsystemd/sd-bus/test-bus-chat.c
2402
2403 test_bus_chat_CFLAGS = \
2404         $(AM_CFLAGS) \
2405         -pthread
2406
2407 test_bus_chat_LDADD = \
2408         libsystemd-internal.la \
2409         libsystemd-shared.la
2410
2411 test_bus_cleanup_SOURCES = \
2412         src/libsystemd/sd-bus/test-bus-cleanup.c
2413
2414 test_bus_cleanup_CFLAGS = \
2415         $(AM_CFLAGS) \
2416         $(SECCOMP_CFLAGS)
2417
2418 test_bus_cleanup_LDADD = \
2419         libsystemd-internal.la \
2420         libsystemd-shared.la
2421
2422 test_bus_server_SOURCES = \
2423         src/libsystemd/sd-bus/test-bus-server.c
2424
2425 test_bus_server_CFLAGS = \
2426         $(AM_CFLAGS) \
2427         -pthread
2428
2429 test_bus_server_LDADD = \
2430         libsystemd-internal.la \
2431         libsystemd-shared.la
2432
2433 test_bus_objects_SOURCES = \
2434         src/libsystemd/sd-bus/test-bus-objects.c
2435
2436 test_bus_objects_CFLAGS = \
2437         $(AM_CFLAGS) \
2438         $(CAP_CFLAGS) \
2439         -pthread
2440
2441 test_bus_objects_LDADD = \
2442         libsystemd-internal.la \
2443         libsystemd-shared.la \
2444         libsystemd-dump.la \
2445         libsystemd-capability.la \
2446         $(CAP_LIBS)
2447
2448 test_bus_error_SOURCES = \
2449         src/libsystemd/sd-bus/test-bus-error.c
2450
2451 test_bus_error_LDADD = \
2452         libsystemd-internal.la \
2453         libsystemd-shared.la
2454
2455 test_bus_gvariant_SOURCES = \
2456         src/libsystemd/sd-bus/test-bus-gvariant.c
2457
2458 test_bus_gvariant_LDADD = \
2459         libsystemd-internal.la \
2460         libsystemd-shared.la \
2461         libsystemd-dump.la \
2462         libsystemd-capability.la \
2463         $(GLIB_LIBS) \
2464         $(CAP_LIBS)
2465
2466 test_bus_gvariant_CFLAGS = \
2467         $(AM_CFLAGS) \
2468         $(GLIB_CFLAGS)
2469         $(CAP_CFLAGS)
2470
2471 test_bus_creds_SOURCES = \
2472         src/libsystemd/sd-bus/test-bus-creds.c
2473
2474 test_bus_creds_LDADD = \
2475         libsystemd-internal.la \
2476         libsystemd-shared.la \
2477         libsystemd-dump.la \
2478         libsystemd-capability.la
2479
2480 test_bus_match_SOURCES = \
2481         src/libsystemd/sd-bus/test-bus-match.c
2482
2483 test_bus_match_LDADD = \
2484         libsystemd-internal.la \
2485         libsystemd-shared.la
2486
2487 test_bus_kernel_SOURCES = \
2488         src/libsystemd/sd-bus/test-bus-kernel.c
2489
2490 test_bus_kernel_LDADD = \
2491         libsystemd-internal.la \
2492         libsystemd-shared.la \
2493         libsystemd-dump.la \
2494         libsystemd-capability.la \
2495         $(CAP_LIBS)
2496
2497 test_bus_kernel_CFLAGS = \
2498         $(AM_CFLAGS) \
2499         $(CAP_CFLAGS)
2500
2501 test_bus_kernel_bloom_SOURCES = \
2502         src/libsystemd/sd-bus/test-bus-kernel-bloom.c
2503
2504 test_bus_kernel_bloom_LDADD = \
2505         libsystemd-internal.la \
2506         libsystemd-shared.la
2507
2508 test_bus_kernel_benchmark_SOURCES = \
2509         src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
2510
2511 test_bus_kernel_benchmark_LDADD = \
2512         libsystemd-internal.la \
2513         libsystemd-shared.la
2514
2515 test_bus_memfd_SOURCES = \
2516         src/libsystemd/sd-bus/test-bus-memfd.c
2517
2518 test_bus_memfd_LDADD = \
2519         libsystemd-internal.la \
2520         libsystemd-shared.la
2521
2522 test_bus_zero_copy_SOURCES = \
2523         src/libsystemd/sd-bus/test-bus-zero-copy.c
2524
2525 test_bus_zero_copy_LDADD = \
2526         libsystemd-internal.la \
2527         libsystemd-shared.la \
2528         libsystemd-dump.la \
2529         libsystemd-capability.la \
2530         $(CAP_LIBS)
2531
2532 test_bus_zero_copy_CFLAGS = \
2533         $(AM_CFLAGS) \
2534         $(CAP_CFLAGS)
2535
2536 test_bus_introspect_SOURCES = \
2537         src/libsystemd/sd-bus/test-bus-introspect.c
2538
2539 test_bus_introspect_LDADD = \
2540         libsystemd-internal.la \
2541         libsystemd-shared.la
2542
2543 test_event_SOURCES = \
2544         src/libsystemd/sd-event/test-event.c
2545
2546 test_event_LDADD = \
2547         libsystemd-internal.la \
2548         libsystemd-shared.la
2549
2550 test_rtnl_SOURCES = \
2551         src/libsystemd/sd-rtnl/test-rtnl.c
2552
2553 test_rtnl_LDADD = \
2554         libsystemd-internal.la \
2555         libsystemd-shared.la
2556
2557 test_resolve_SOURCES = \
2558         src/libsystemd/sd-resolve/test-resolve.c
2559
2560 test_resolve_LDADD = \
2561         libsystemd-resolve.la \
2562         libsystemd-internal.la \
2563         libsystemd-shared.la
2564
2565 test_resolve_CFLAGS = \
2566         $(AM_CFLAGS) \
2567         -pthread
2568
2569 busctl_SOURCES = \
2570         src/libsystemd/sd-bus/busctl.c
2571
2572 busctl_LDADD = \
2573         libsystemd-internal.la \
2574         libsystemd-shared.la \
2575         libsystemd-dump.la \
2576         libsystemd-capability.la \
2577         $(CAP_LIBS)
2578
2579 busctl_CFLAGS = \
2580         $(AM_CFLAGS) \
2581         $(CAP_CFLAGS)
2582
2583 # ------------------------------------------------------------------------------
2584 noinst_LTLIBRARIES += \
2585         libsystemd-network.la
2586
2587 libsystemd_network_la_CFLAGS = \
2588         $(AM_CFLAGS) \
2589         $(KMOD_CFLAGS)
2590
2591 libsystemd_network_la_SOURCES = \
2592         src/systemd/sd-network.h \
2593         src/systemd/sd-dhcp-client.h \
2594         src/systemd/sd-dhcp-server.h \
2595         src/systemd/sd-dhcp-lease.h \
2596         src/systemd/sd-ipv4ll.h \
2597         src/network/sd-network.c \
2598         src/network/network-util.h \
2599         src/libsystemd-network/sd-dhcp-client.c \
2600         src/libsystemd-network/sd-dhcp-server.c \
2601         src/libsystemd-network/dhcp-network.c \
2602         src/libsystemd-network/dhcp-option.c \
2603         src/libsystemd-network/dhcp-packet.c \
2604         src/libsystemd-network/dhcp-internal.h \
2605         src/libsystemd-network/dhcp-server-internal.h \
2606         src/libsystemd-network/dhcp-protocol.h \
2607         src/libsystemd-network/dhcp-lease-internal.h \
2608         src/libsystemd-network/sd-dhcp-lease.c \
2609         src/libsystemd-network/sd-ipv4ll.c \
2610         src/libsystemd-network/ipv4ll-network.c \
2611         src/libsystemd-network/ipv4ll-packet.c \
2612         src/libsystemd-network/ipv4ll-internal.h \
2613         src/libsystemd-network/network-internal.c \
2614         src/libsystemd-network/network-internal.h \
2615         src/systemd/sd-icmp6-nd.h \
2616         src/systemd/sd-dhcp6-client.h \
2617         src/systemd/sd-dhcp6-lease.h \
2618         src/libsystemd-network/sd-icmp6-nd.c \
2619         src/libsystemd-network/sd-dhcp6-client.c \
2620         src/libsystemd-network/dhcp6-internal.h \
2621         src/libsystemd-network/dhcp6-protocol.h \
2622         src/libsystemd-network/dhcp6-network.c \
2623         src/libsystemd-network/dhcp6-option.c \
2624         src/libsystemd-network/dhcp6-lease-internal.h \
2625         src/libsystemd-network/sd-dhcp6-lease.c
2626
2627 libsystemd_network_la_LIBADD = \
2628         libudev-internal.la \
2629         libsystemd-label.la \
2630         libsystemd-internal.la \
2631         libsystemd-shared.la \
2632         $(KMOD_LIBS)
2633
2634 test_dhcp_option_SOURCES = \
2635         src/libsystemd-network/dhcp-protocol.h \
2636         src/libsystemd-network/dhcp-internal.h \
2637         src/libsystemd-network/test-dhcp-option.c
2638
2639 test_dhcp_option_LDADD = \
2640         libsystemd-network.la \
2641         libsystemd-internal.la \
2642         libsystemd-shared.la
2643
2644 test_dhcp_client_SOURCES = \
2645         src/systemd/sd-dhcp-client.h \
2646         src/libsystemd-network/dhcp-protocol.h \
2647         src/libsystemd-network/dhcp-internal.h \
2648         src/libsystemd-network/test-dhcp-client.c
2649
2650 test_dhcp_client_LDADD = \
2651         libsystemd-network.la \
2652         libsystemd-label.la \
2653         libsystemd-internal.la \
2654         libsystemd-shared.la
2655
2656 test_dhcp_server_SOURCES = \
2657         src/libsystemd-network/test-dhcp-server.c
2658
2659 test_dhcp_server_LDADD = \
2660         libsystemd-network.la \
2661         libsystemd-internal.la \
2662         libsystemd-shared.la
2663
2664 test_ipv4ll_SOURCES = \
2665         src/systemd/sd-ipv4ll.h \
2666         src/libsystemd-network/ipv4ll-internal.h \
2667         src/libsystemd-network/test-ipv4ll.c
2668
2669 test_ipv4ll_LDADD = \
2670         libsystemd-network.la \
2671         libsystemd-label.la \
2672         libsystemd-internal.la \
2673         libsystemd-shared.la
2674
2675 test_icmp6_rs_SOURCES = \
2676         src/systemd/sd-dhcp6-client.h \
2677         src/systemd/sd-icmp6-nd.h \
2678         src/libsystemd-network/dhcp6-internal.h \
2679         src/libsystemd-network/test-icmp6-rs.c
2680
2681 test_icmp6_rs_LDADD = \
2682         libsystemd-network.la \
2683         libsystemd-internal.la \
2684         libsystemd-shared.la
2685
2686 test_dhcp6_client_SOURCES = \
2687         src/systemd/sd-dhcp6-client.h \
2688         src/libsystemd-network/dhcp6-internal.h \
2689         src/libsystemd-network/test-dhcp6-client.c
2690
2691 test_dhcp6_client_LDADD = \
2692         libsystemd-network.la \
2693         libsystemd-internal.la \
2694         libsystemd-shared.la
2695
2696 tests += \
2697         test-dhcp-option \
2698         test-dhcp-client \
2699         test-dhcp-server \
2700         test-ipv4ll \
2701         test-icmp6-rs \
2702         test-dhcp6-client
2703
2704 # ------------------------------------------------------------------------------
2705 if ENABLE_GTK_DOC
2706 SUBDIRS += \
2707         docs/libudev
2708
2709 noinst_DATA += \
2710         docs/html/libudev \
2711         docs/html/gudev
2712 endif
2713
2714 include_HEADERS += \
2715         src/libudev/libudev.h
2716
2717 lib_LTLIBRARIES += \
2718         libudev.la
2719
2720 libudev_la_SOURCES =\
2721         src/libudev/libudev.sym \
2722         src/libudev/libudev-private.h \
2723         src/libudev/libudev.c \
2724         src/libudev/libudev-list.c \
2725         src/libudev/libudev-util.c \
2726         src/libudev/libudev-device.c \
2727         src/libudev/libudev-enumerate.c \
2728         src/libudev/libudev-monitor.c \
2729         src/libudev/libudev-queue.c \
2730         src/libudev/libudev-hwdb-def.h \
2731         src/libudev/libudev-hwdb.c
2732
2733 libudev_la_CFLAGS = \
2734         $(AM_CFLAGS) \
2735         -fvisibility=hidden
2736
2737 libudev_la_LDFLAGS = \
2738         $(AM_LDFLAGS) \
2739         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
2740         -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
2741
2742 libudev_la_LIBADD = \
2743         libsystemd-internal.la \
2744         libsystemd-shared.la
2745
2746 pkgconfiglib_DATA += \
2747         src/libudev/libudev.pc
2748
2749 EXTRA_DIST += \
2750         src/libudev/libudev.pc.in
2751
2752 CLEANFILES += \
2753         src/libudev/libudev.pc \
2754         docs/html/libudev \
2755         docs/html/gudev
2756
2757 docs/html/libudev:
2758         $(AM_V_at)$(MKDIR_P) $(dir $@)
2759         $(AM_V_LN)$(LN_S) -f ../libudev/html $@
2760
2761 docs/html/gudev:
2762         $(AM_V_at)$(MKDIR_P) $(dir $@)
2763         $(AM_V_LN)$(LN_S) -f ../gudev/html $@
2764
2765 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2766 libudev-install-hook:
2767         libname=libudev.so && $(move-to-rootlibdir)
2768
2769 libudev-uninstall-hook:
2770         rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
2771
2772 INSTALL_EXEC_HOOKS += libudev-install-hook
2773 UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
2774
2775 # ------------------------------------------------------------------------------
2776 noinst_LTLIBRARIES += \
2777         libudev-internal.la
2778
2779 libudev_internal_la_SOURCES =\
2780         $(libudev_la_SOURCES) \
2781         src/libudev/libudev-device-private.c
2782
2783 libudev_internal_la_CFLAGS = \
2784         $(AM_CFLAGS) \
2785         -fvisibility=default
2786
2787 # ------------------------------------------------------------------------------
2788 INSTALL_DIRS += \
2789         $(sysconfdir)/udev/rules.d \
2790         $(sysconfdir)/udev/hwdb.d
2791
2792 dist_network_DATA = \
2793         network/99-default.link \
2794         network/80-container-host0.network \
2795         network/80-container-ve.network
2796
2797 dist_udevrules_DATA += \
2798         rules/42-usb-hid-pm.rules \
2799         rules/50-udev-default.rules \
2800         rules/60-drm.rules \
2801         rules/60-keyboard.rules \
2802         rules/60-persistent-storage-tape.rules \
2803         rules/60-persistent-serial.rules \
2804         rules/60-persistent-input.rules \
2805         rules/60-persistent-alsa.rules \
2806         rules/60-persistent-storage.rules \
2807         rules/64-btrfs.rules \
2808         rules/75-net-description.rules \
2809         rules/75-tty-description.rules \
2810         rules/78-sound-card.rules \
2811         rules/80-net-setup-link.rules \
2812         rules/95-udev-late.rules
2813
2814 nodist_udevrules_DATA += \
2815         rules/99-systemd.rules
2816
2817 dist_udevhwdb_DATA = \
2818         hwdb/20-pci-vendor-model.hwdb \
2819         hwdb/20-pci-classes.hwdb \
2820         hwdb/20-usb-vendor-model.hwdb \
2821         hwdb/20-usb-classes.hwdb \
2822         hwdb/20-sdio-vendor-model.hwdb \
2823         hwdb/20-sdio-classes.hwdb \
2824         hwdb/20-bluetooth-vendor-product.hwdb \
2825         hwdb/20-acpi-vendor.hwdb \
2826         hwdb/20-OUI.hwdb \
2827         hwdb/20-net-ifname.hwdb \
2828         hwdb/60-keyboard.hwdb
2829
2830 udevconfdir = $(sysconfdir)/udev
2831 dist_udevconf_DATA = \
2832         src/udev/udev.conf
2833
2834 sharepkgconfigdir = $(datadir)/pkgconfig
2835 sharepkgconfig_DATA = \
2836         src/udev/udev.pc
2837
2838 EXTRA_DIST += \
2839         rules/99-systemd.rules.in \
2840         src/udev/udev.pc.in
2841
2842 CLEANFILES += \
2843         rules/99-systemd.rules \
2844         src/udev/udev.pc
2845
2846 EXTRA_DIST += \
2847         units/systemd-udevd.service.in \
2848         units/systemd-udev-trigger.service.in \
2849         units/systemd-udev-settle.service.in \
2850         units/systemd-udev-hwdb-update.service.in
2851
2852 CLEANFILES += \
2853         units/systemd-udevd.service \
2854         units/systemd-udev-trigger.service \
2855         units/systemd-udev-settle.service \
2856         units/systemd-udev-hwdb-update.service
2857
2858 SOCKETS_TARGET_WANTS += \
2859         systemd-udevd-control.socket \
2860         systemd-udevd-kernel.socket
2861
2862 SYSINIT_TARGET_WANTS += \
2863         systemd-udevd.service \
2864         systemd-udev-trigger.service \
2865         systemd-udev-hwdb-update.service
2866
2867 rootbin_PROGRAMS += \
2868         udevadm
2869
2870 rootlibexec_PROGRAMS += \
2871         systemd-udevd
2872
2873 noinst_LTLIBRARIES += \
2874         libudev-core.la
2875
2876 src/udev/keyboard-keys.txt:
2877         $(AM_V_at)$(MKDIR_P) $(dir $@)
2878         $(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/' > $@
2879
2880 src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt
2881         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
2882
2883 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
2884         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
2885
2886 src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt
2887         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
2888
2889 libudev_core_la_SOURCES = \
2890         src/udev/udev.h \
2891         src/udev/udev-event.c \
2892         src/udev/udev-watch.c \
2893         src/udev/udev-node.c \
2894         src/udev/udev-rules.c \
2895         src/udev/udev-ctrl.c \
2896         src/udev/udev-builtin.c \
2897         src/udev/udev-builtin-btrfs.c \
2898         src/udev/udev-builtin-hwdb.c \
2899         src/udev/udev-builtin-input_id.c \
2900         src/udev/udev-builtin-keyboard.c \
2901         src/udev/udev-builtin-net_id.c \
2902         src/udev/udev-builtin-net_setup_link.c \
2903         src/udev/udev-builtin-path_id.c \
2904         src/udev/udev-builtin-usb_id.c \
2905         src/udev/net/link-config.h \
2906         src/udev/net/link-config.c \
2907         src/udev/net/ethtool-util.h \
2908         src/udev/net/ethtool-util.c
2909
2910 nodist_libudev_core_la_SOURCES = \
2911         src/udev/keyboard-keys-from-name.h \
2912         src/udev/keyboard-keys-to-name.h \
2913         src/udev/net/link-config-gperf.c
2914
2915 BUILT_SOURCES += \
2916         $(nodist_libudev_core_la_SOURCES)
2917
2918 CLEANFILES += \
2919         src/udev/keyboard-keys-from-name.gperf \
2920         src/udev/keyboard-keys.txt \
2921         src/udev/net/link-config-gperf.c
2922
2923 EXTRA_DIST += \
2924         src/udev/net/link-config-gperf.gperf
2925
2926 libudev_core_la_CFLAGS = \
2927         $(AM_CFLAGS) \
2928         $(BLKID_CFLAGS) \
2929         $(KMOD_CFLAGS)
2930
2931 libudev_core_la_LIBADD = \
2932         libudev-internal.la \
2933         libsystemd-label.la \
2934         libsystemd-internal.la \
2935         libsystemd-network.la \
2936         libsystemd-shared.la \
2937         $(BLKID_LIBS) \
2938         $(KMOD_LIBS)
2939
2940 libudev_core_la_CPPFLAGS = \
2941         $(AM_CPPFLAGS) \
2942         -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
2943
2944 if ENABLE_FIRMWARE
2945 libudev_core_la_SOURCES += \
2946         src/udev/udev-builtin-firmware.c
2947
2948 dist_udevrules_DATA += \
2949         rules/50-firmware.rules
2950 endif
2951
2952 if HAVE_KMOD
2953 libudev_core_la_SOURCES += \
2954         src/udev/udev-builtin-kmod.c
2955
2956 dist_udevrules_DATA += \
2957         rules/80-drivers.rules
2958 endif
2959
2960 if HAVE_BLKID
2961 libudev_core_la_SOURCES += \
2962         src/udev/udev-builtin-blkid.c
2963 endif
2964
2965 if HAVE_ACL
2966 libudev_core_la_SOURCES += \
2967         src/udev/udev-builtin-uaccess.c \
2968         src/login/logind-acl.c \
2969         src/libsystemd/sd-login/sd-login.c \
2970         src/systemd/sd-login.h
2971
2972 libudev_core_la_LIBADD += \
2973         libsystemd-acl.la
2974 endif
2975
2976 systemd_udevd_SOURCES = \
2977         src/udev/udevd.c
2978
2979 systemd_udevd_LDADD = \
2980         libudev-core.la
2981
2982 udevadm_SOURCES = \
2983         src/udev/udevadm.c \
2984         src/udev/udevadm-info.c \
2985         src/udev/udevadm-control.c \
2986         src/udev/udevadm-monitor.c \
2987         src/udev/udevadm-hwdb.c \
2988         src/udev/udevadm-settle.c \
2989         src/udev/udevadm-trigger.c \
2990         src/udev/udevadm-test.c \
2991         src/udev/udevadm-test-builtin.c
2992
2993 udevadm_LDADD = \
2994         libudev-core.la
2995
2996 # Update hwdb on installation. Do not bother if installing
2997 # in DESTDIR, since this is likely for packaging purposes.
2998 hwdb-update-hook:
2999         -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update
3000
3001 INSTALL_DATA_HOOKS += \
3002         hwdb-update-hook
3003
3004 hwdb-remove-hook:
3005         -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
3006
3007 # ------------------------------------------------------------------------------
3008 TESTS += \
3009         test/udev-test.pl \
3010         test/rules-test.sh
3011
3012 manual_tests += \
3013         test-libudev \
3014         test-udev
3015
3016 test_libudev_SOURCES = \
3017         src/test/test-libudev.c
3018
3019 test_libudev_LDADD = \
3020         libsystemd-label.la \
3021         libudev-internal.la \
3022         libsystemd-shared.la
3023
3024 test_udev_SOURCES = \
3025         src/test/test-udev.c
3026
3027 test_udev_LDADD = \
3028         libudev-core.la \
3029         $(BLKID_LIBS) \
3030         $(KMOD_LIBS) \
3031         $(SELINUX_LIBS)
3032
3033 if HAVE_ACL
3034 test_udev_LDADD += \
3035         libsystemd-acl.la
3036 endif
3037
3038 check_DATA += \
3039         test/sys
3040
3041 # packed sysfs test tree
3042 test/sys:
3043         $(AM_V_at)$(MKDIR_P) $(dir $@)
3044         $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
3045
3046 test-sys-distclean:
3047         -rm -rf test/sys
3048 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
3049
3050 EXTRA_DIST += \
3051         test/sys.tar.xz \
3052         test/udev-test.pl \
3053         test/rules-test.sh \
3054         test/rule-syntax-check.py
3055
3056 # ------------------------------------------------------------------------------
3057 ata_id_SOURCES = \
3058         src/udev/ata_id/ata_id.c
3059
3060 ata_id_LDADD = \
3061         libudev-internal.la \
3062         libsystemd-shared.la
3063
3064 udevlibexec_PROGRAMS += \
3065         ata_id
3066
3067 # ------------------------------------------------------------------------------
3068 cdrom_id_SOURCES = \
3069         src/udev/cdrom_id/cdrom_id.c
3070
3071 cdrom_id_LDADD = \
3072         libudev-internal.la \
3073         libsystemd-shared.la
3074
3075 udevlibexec_PROGRAMS += \
3076         cdrom_id
3077
3078 dist_udevrules_DATA += \
3079         rules/60-cdrom_id.rules
3080
3081 # ------------------------------------------------------------------------------
3082 collect_SOURCES = \
3083         src/udev/collect/collect.c
3084
3085 collect_LDADD = \
3086         libudev-internal.la \
3087         libsystemd-shared.la
3088
3089 udevlibexec_PROGRAMS += \
3090         collect
3091
3092 # ------------------------------------------------------------------------------
3093 scsi_id_SOURCES =\
3094         src/udev/scsi_id/scsi_id.c \
3095         src/udev/scsi_id/scsi_serial.c \
3096         src/udev/scsi_id/scsi.h \
3097         src/udev/scsi_id/scsi_id.h
3098
3099 scsi_id_LDADD = \
3100         libudev-internal.la \
3101         libsystemd-shared.la
3102
3103 udevlibexec_PROGRAMS += \
3104         scsi_id
3105
3106 EXTRA_DIST += \
3107         src/udev/scsi_id/README
3108
3109 # ------------------------------------------------------------------------------
3110 v4l_id_SOURCES = \
3111         src/udev/v4l_id/v4l_id.c
3112
3113 v4l_id_LDADD = \
3114         libudev-internal.la
3115
3116 udevlibexec_PROGRAMS += \
3117         v4l_id
3118
3119 dist_udevrules_DATA += \
3120         rules/60-persistent-v4l.rules
3121
3122 # ------------------------------------------------------------------------------
3123 accelerometer_SOURCES = \
3124         src/udev/accelerometer/accelerometer.c
3125
3126 accelerometer_LDADD = \
3127         libudev-internal.la -lm \
3128         libsystemd-shared.la
3129
3130 udevlibexec_PROGRAMS += \
3131         accelerometer
3132
3133 dist_udevrules_DATA += \
3134         rules/61-accelerometer.rules
3135
3136 # ------------------------------------------------------------------------------
3137 if ENABLE_GUDEV
3138 if ENABLE_GTK_DOC
3139 SUBDIRS += \
3140         docs/gudev
3141 endif
3142
3143 libgudev_includedir = \
3144         $(includedir)/gudev-1.0/gudev
3145
3146 libgudev_include_HEADERS = \
3147         src/gudev/gudev.h \
3148         src/gudev/gudevenums.h \
3149         src/gudev/gudevenumtypes.h \
3150         src/gudev/gudevtypes.h \
3151         src/gudev/gudevclient.h \
3152         src/gudev/gudevdevice.h \
3153         src/gudev/gudevenumerator.h
3154
3155 lib_LTLIBRARIES += libgudev-1.0.la
3156
3157 pkgconfiglib_DATA += \
3158         src/gudev/gudev-1.0.pc
3159
3160 CLEANFILES += \
3161         src/gudev/gudev-1.0.pc
3162
3163 libgudev_1_0_la_SOURCES = \
3164         src/gudev/gudevenums.h \
3165         src/gudev/gudevenumtypes.h \
3166         src/gudev/gudevenumtypes.h\
3167         src/gudev/gudevtypes.h \
3168         src/gudev/gudevclient.h \
3169         src/gudev/gudevclient.c \
3170         src/gudev/gudevdevice.h \
3171         src/gudev/gudevdevice.c \
3172         src/gudev/gudevenumerator.h \
3173         src/gudev/gudevenumerator.c \
3174         src/gudev/gudevprivate.h
3175
3176 nodist_libgudev_1_0_la_SOURCES = \
3177         src/gudev/gudevmarshal.h \
3178         src/gudev/gudevmarshal.c \
3179         src/gudev/gudevenumtypes.h \
3180         src/gudev/gudevenumtypes.c
3181
3182 BUILT_SOURCES += \
3183         $(nodist_libgudev_1_0_la_SOURCES)
3184
3185 libgudev_1_0_la_CPPFLAGS = \
3186         $(AM_CPPFLAGS) \
3187         -I$(top_builddir)/src\
3188         -I$(top_srcdir)/src\
3189         -I$(top_builddir)/src/gudev \
3190         -I$(top_srcdir)/src/gudev \
3191         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
3192         -D_GUDEV_COMPILATION \
3193         -DG_LOG_DOMAIN=\"GUdev\"
3194
3195 libgudev_1_0_la_CFLAGS = \
3196         $(AM_CFLAGS) \
3197         -fvisibility=default \
3198         $(GLIB_CFLAGS)
3199
3200 libgudev_1_0_la_LIBADD = \
3201         libudev.la \
3202         $(GLIB_LIBS)
3203
3204 libgudev_1_0_la_LDFLAGS = \
3205         $(AM_LDFLAGS) \
3206         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
3207         -export-dynamic -no-undefined \
3208         -export-symbols-regex '^g_udev_.*'
3209
3210 src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
3211         $(AM_V_at)$(MKDIR_P) $(dir $@)
3212         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
3213
3214 src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
3215         $(AM_V_at)$(MKDIR_P) $(dir $@)
3216         $(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
3217         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
3218
3219 src/gudev/gudevenumtypes.%: src/gudev/gudevenumtypes.%.template src/gudev/gudevenums.h
3220         $(AM_V_at)$(MKDIR_P) $(dir $@)
3221         $(AM_V_GEN)glib-mkenums --template $^ > $@
3222
3223 if HAVE_INTROSPECTION
3224 -include $(INTROSPECTION_MAKEFILE)
3225
3226 src/gudev/GUdev-1.0.gir: libgudev-1.0.la
3227
3228 src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
3229
3230 src_gudev_GUdev_1_0_gir_CFLAGS = \
3231         $(AM_CFLAGS) \
3232         $(INCLUDES) \
3233         -D_GUDEV_COMPILATION \
3234         -D_GUDEV_WORK_AROUND_DEV_T_BUG \
3235         -I$(top_srcdir)/src \
3236         -I$(top_builddir)/src \
3237         -I$(top_srcdir)/src/gudev \
3238         -I$(top_builddir)/src/gudev
3239
3240 src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
3241
3242 src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
3243         --pkg-export=gudev-1.0 \
3244         --warn-all
3245
3246 src_gudev_GUdev_1_0_gir_FILES = \
3247         src/gudev/gudev.h \
3248         src/gudev/gudevtypes.h \
3249         src/gudev/gudevenums.h \
3250         src/gudev/gudevenumtypes.h \
3251         src/gudev/gudevclient.h \
3252         src/gudev/gudevdevice.h \
3253         src/gudev/gudevenumerator.h \
3254         src/gudev/gudevclient.c \
3255         src/gudev/gudevdevice.c \
3256         src/gudev/gudevenumerator.c
3257
3258 INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
3259 INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
3260
3261 girdir = $(datadir)/gir-1.0
3262 gir_DATA = \
3263         src/gudev/GUdev-1.0.gir
3264
3265 typelibsdir = $(libdir)/girepository-1.0
3266 typelibs_DATA = \
3267         src/gudev/GUdev-1.0.typelib
3268
3269 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
3270 endif # HAVE_INTROSPECTION
3271
3272 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
3273 libgudev-install-hook:
3274         libname=libgudev-1.0.so && $(move-to-rootlibdir)
3275
3276 libgudev-uninstall-hook:
3277         rm -f $(DESTDIR)$(rootlibdir)/libgudev-1.0.so*
3278
3279 INSTALL_EXEC_HOOKS += libgudev-install-hook
3280 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-hook
3281 endif
3282
3283 EXTRA_DIST += \
3284         src/gudev/gudev-1.0.pc.in \
3285         src/gudev/gudevmarshal.list \
3286         src/gudev/gudevenumtypes.h.template \
3287         src/gudev/gudevenumtypes.c.template \
3288         src/gudev/gjs-example.js \
3289         src/gudev/seed-example-enum.js \
3290         src/gudev/seed-example.js
3291
3292 # ------------------------------------------------------------------------------
3293 mtd_probe_SOURCES =  \
3294         src/udev/mtd_probe/mtd_probe.c \
3295         src/udev/mtd_probe/mtd_probe.h \
3296         src/udev/mtd_probe/probe_smartmedia.c
3297
3298 dist_udevrules_DATA += \
3299         rules/75-probe_mtd.rules
3300
3301 udevlibexec_PROGRAMS += \
3302         mtd_probe
3303
3304 # ------------------------------------------------------------------------------
3305 test_id128_SOURCES = \
3306         src/test/test-id128.c
3307
3308 test_id128_LDADD = \
3309         libsystemd-internal.la \
3310         libsystemd-shared.la
3311
3312 tests += \
3313         test-id128
3314
3315 # ------------------------------------------------------------------------------
3316
3317 rootlibexec_PROGRAMS += \
3318         systemd-activate
3319
3320 systemd_activate_SOURCES = \
3321         src/activate/activate.c
3322
3323 systemd_activate_LDADD = \
3324         libsystemd-label.la \
3325         libsystemd-internal.la \
3326         libsystemd-shared.la
3327
3328 # ------------------------------------------------------------------------------
3329 systemd_journald_SOURCES = \
3330         src/journal/journald.c \
3331         src/journal/journald-server.h
3332
3333 systemd_journald_LDADD = \
3334         libsystemd-journal-core.la \
3335         libsystemd-internal.la \
3336         libsystemd-shared.la
3337
3338 systemd_cat_SOURCES = \
3339         src/journal/cat.c
3340
3341 systemd_cat_LDADD = \
3342         libsystemd-journal-core.la
3343
3344 if HAVE_MICROHTTPD
3345 rootlibexec_PROGRAMS += \
3346         systemd-journal-remote
3347
3348 systemd_journal_remote_SOURCES = \
3349         src/journal/journal-remote-parse.h \
3350         src/journal/journal-remote-parse.c \
3351         src/journal/journal-remote-write.h \
3352         src/journal/journal-remote-write.c \
3353         src/journal/journal-remote.c
3354
3355 systemd_journal_remote_LDADD = \
3356         libsystemd-internal.la \
3357         libsystemd-journal-core.la
3358
3359 systemd_journal_remote_SOURCES += \
3360         src/journal/microhttpd-util.h \
3361         src/journal/microhttpd-util.c
3362
3363 systemd_journal_remote_CFLAGS = \
3364         $(AM_CFLAGS) \
3365         $(MICROHTTPD_CFLAGS)
3366
3367 systemd_journal_remote_LDADD += \
3368         $(MICROHTTPD_LIBS)
3369
3370 if HAVE_GNUTLS
3371 systemd_journal_remote_LDADD += \
3372         $(GNUTLS_LIBS)
3373 endif
3374 endif
3375
3376 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3377 journalctl_CFLAGS = \
3378         $(AM_CFLAGS)
3379
3380 journalctl_SOURCES = \
3381         src/journal/journalctl.c
3382
3383 journalctl_LDADD = \
3384         libsystemd-journal-internal.la \
3385         libsystemd-internal.la \
3386         libsystemd-logs.la \
3387         libsystemd-shared.la
3388
3389 if HAVE_ACL
3390 journalctl_LDADD += \
3391         libsystemd-acl.la
3392 endif
3393
3394 if HAVE_QRENCODE
3395 journalctl_SOURCES += \
3396         src/journal/journal-qrcode.c \
3397         src/journal/journal-qrcode.h
3398
3399 journalctl_CFLAGS += \
3400         $(QRENCODE_CFLAGS)
3401
3402 journalctl_LDADD += \
3403         $(QRENCODE_LIBS)
3404 endif
3405
3406 test_journal_SOURCES = \
3407         src/journal/test-journal.c
3408
3409 test_journal_LDADD = \
3410         libsystemd-journal-core.la
3411
3412 test_journal_send_SOURCES = \
3413         src/journal/test-journal-send.c
3414
3415 test_journal_send_LDADD = \
3416         libsystemd-journal-core.la
3417
3418 test_journal_syslog_SOURCES = \
3419         src/journal/test-journal-syslog.c
3420
3421 test_journal_syslog_LDADD = \
3422         libsystemd-journal-core.la
3423
3424 test_journal_match_SOURCES = \
3425         src/journal/test-journal-match.c
3426
3427 test_journal_match_LDADD = \
3428         libsystemd-journal-core.la
3429
3430 test_journal_enum_SOURCES = \
3431         src/journal/test-journal-enum.c
3432
3433 test_journal_enum_LDADD = \
3434         libsystemd-journal-core.la
3435
3436 test_journal_stream_SOURCES = \
3437         src/journal/test-journal-stream.c
3438
3439 test_journal_stream_LDADD = \
3440         libsystemd-journal-core.la
3441
3442 test_journal_flush_SOURCES = \
3443         src/journal/test-journal-flush.c
3444
3445 test_journal_flush_LDADD = \
3446         libsystemd-journal-core.la
3447
3448 test_journal_init_SOURCES = \
3449         src/journal/test-journal-init.c
3450
3451 test_journal_init_LDADD = \
3452         libsystemd-journal-core.la
3453
3454 test_journal_verify_SOURCES = \
3455         src/journal/test-journal-verify.c
3456
3457 test_journal_verify_LDADD = \
3458         libsystemd-journal-core.la
3459
3460 test_journal_interleaving_SOURCES = \
3461         src/journal/test-journal-interleaving.c
3462
3463 test_journal_interleaving_LDADD = \
3464         libsystemd-journal-core.la
3465
3466 test_mmap_cache_SOURCES = \
3467         src/journal/test-mmap-cache.c
3468
3469 test_mmap_cache_LDADD = \
3470         libsystemd-journal-core.la
3471
3472 test_catalog_SOURCES = \
3473         src/journal/test-catalog.c
3474
3475 test_catalog_CPPFLAGS = \
3476         $(AM_CPPFLAGS) \
3477         -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
3478
3479 test_catalog_LDADD = \
3480         libsystemd-journal-core.la
3481
3482 libsystemd_journal_core_la_SOURCES = \
3483         src/journal/journald-kmsg.c \
3484         src/journal/journald-kmsg.h \
3485         src/journal/journald-syslog.c \
3486         src/journal/journald-syslog.h \
3487         src/journal/journald-stream.c \
3488         src/journal/journald-stream.h \
3489         src/journal/journald-server.c \
3490         src/journal/journald-server.h \
3491         src/journal/journald-console.c \
3492         src/journal/journald-console.h \
3493         src/journal/journald-wall.c \
3494         src/journal/journald-wall.h \
3495         src/journal/journald-native.c \
3496         src/journal/journald-native.h \
3497         src/journal/journald-rate-limit.c \
3498         src/journal/journald-rate-limit.h \
3499         src/journal/journal-internal.h
3500
3501 nodist_libsystemd_journal_core_la_SOURCES = \
3502         src/journal/journald-gperf.c
3503
3504 libsystemd_journal_core_la_LIBADD = \
3505         libsystemd-journal-internal.la \
3506         libudev-internal.la \
3507         libsystemd-capability.la \
3508         libsystemd-label.la \
3509         libsystemd-internal.la \
3510         libsystemd-shared.la
3511
3512 if HAVE_ACL
3513 libsystemd_journal_core_la_LIBADD += \
3514         libsystemd-acl.la
3515 endif
3516
3517 noinst_LTLIBRARIES += \
3518         libsystemd-journal-core.la
3519
3520 journal-install-hook:
3521         -$(MKDIR_P) $(DESTDIR)/var/log/journal
3522         -chown 0:0 $(DESTDIR)/var/log/journal
3523         -chmod 755 $(DESTDIR)/var/log/journal
3524         -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
3525         -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
3526
3527 journal-uninstall-hook:
3528         -rmdir $(DESTDIR)/var/log/journal/
3529
3530 INSTALL_EXEC_HOOKS += journal-install-hook
3531 UNINSTALL_EXEC_HOOKS += journal-uninstall-hook
3532
3533 # ------------------------------------------------------------------------------
3534 # Update catalog on installation. Do not bother if installing
3535 # in DESTDIR, since this is likely for packaging purposes.
3536 catalog-update-hook:
3537         -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
3538
3539 INSTALL_DATA_HOOKS += \
3540         catalog-update-hook
3541
3542 catalog-remove-hook:
3543         -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
3544
3545 UNINSTALL_DATA_HOOKS += \
3546         catalog-remove-hook
3547
3548 manual_tests += \
3549         test-journal-enum
3550
3551 tests += \
3552         test-journal \
3553         test-journal-send \
3554         test-journal-syslog \
3555         test-journal-match \
3556         test-journal-stream \
3557         test-journal-init \
3558         test-journal-verify \
3559         test-journal-interleaving \
3560         test-journal-flush \
3561         test-mmap-cache \
3562         test-catalog
3563
3564 pkginclude_HEADERS += \
3565         src/systemd/sd-journal.h \
3566         src/systemd/sd-messages.h \
3567         src/systemd/_sd-common.h
3568
3569 libsystemd_journal_internal_la_SOURCES = \
3570         src/journal/sd-journal.c \
3571         src/systemd/sd-journal.h \
3572         src/systemd/_sd-common.h \
3573         src/journal/journal-file.c \
3574         src/journal/journal-file.h \
3575         src/journal/journal-vacuum.c \
3576         src/journal/journal-vacuum.h \
3577         src/journal/journal-verify.c \
3578         src/journal/journal-verify.h \
3579         src/journal/lookup3.c \
3580         src/journal/lookup3.h \
3581         src/journal/journal-send.c \
3582         src/journal/journal-def.h \
3583         src/journal/compress.h \
3584         src/journal/catalog.c \
3585         src/journal/catalog.h \
3586         src/journal/mmap-cache.c \
3587         src/journal/mmap-cache.h
3588
3589 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3590 libsystemd_journal_internal_la_CFLAGS = \
3591         $(AM_CFLAGS)
3592
3593 libsystemd_journal_internal_la_LIBADD =
3594
3595 if HAVE_XZ
3596 libsystemd_journal_internal_la_SOURCES += \
3597         src/journal/compress.c
3598
3599 libsystemd_journal_internal_la_CFLAGS += \
3600         $(XZ_CFLAGS)
3601
3602 libsystemd_journal_internal_la_LIBADD += \
3603         $(XZ_LIBS)
3604 endif
3605
3606 if HAVE_GCRYPT
3607 libsystemd_journal_internal_la_SOURCES += \
3608         src/journal/journal-authenticate.c \
3609         src/journal/journal-authenticate.h \
3610         src/journal/fsprg.c \
3611         src/journal/fsprg.h
3612
3613 libsystemd_journal_internal_la_LIBADD += \
3614         $(GCRYPT_LIBS)
3615
3616 # fsprg.c is a drop-in file using void pointer arithmetic
3617 libsystemd_journal_internal_la_CFLAGS += \
3618         $(GCRYPT_CFLAGS) \
3619         -Wno-pointer-arith
3620 endif
3621
3622 noinst_LTLIBRARIES += \
3623         libsystemd-journal-internal.la
3624
3625 rootlibexec_PROGRAMS += \
3626         systemd-journald
3627
3628 rootbin_PROGRAMS += \
3629         journalctl
3630
3631 bin_PROGRAMS += \
3632         systemd-cat
3633
3634 dist_systemunit_DATA += \
3635         units/systemd-journald.socket \
3636         units/systemd-journald-dev-log.socket
3637
3638 nodist_systemunit_DATA += \
3639         units/systemd-journald.service \
3640         units/systemd-journal-flush.service \
3641         units/systemd-journal-catalog-update.service
3642
3643 dist_pkgsysconf_DATA += \
3644         src/journal/journald.conf
3645
3646 dist_catalog_DATA = \
3647         catalog/systemd.fr.catalog \
3648         catalog/systemd.ru.catalog \
3649         catalog/systemd.it.catalog \
3650         catalog/systemd.catalog
3651
3652 SOCKETS_TARGET_WANTS += \
3653         systemd-journald.socket \
3654         systemd-journald-dev-log.socket
3655
3656 SYSINIT_TARGET_WANTS += \
3657         systemd-journald.service \
3658         systemd-journal-flush.service \
3659         systemd-journal-catalog-update.service
3660
3661 EXTRA_DIST += \
3662         units/systemd-journald.service.in \
3663         units/systemd-journal-flush.service.in \
3664         units/systemd-journal-catalog-update.service.in \
3665         src/journal/journald-gperf.gperf
3666
3667 CLEANFILES += \
3668         src/journal/journald-gperf.c
3669
3670 # ------------------------------------------------------------------------------
3671 if HAVE_MICROHTTPD
3672 gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
3673
3674 rootlibexec_PROGRAMS += \
3675         systemd-journal-gatewayd
3676
3677 systemd_journal_gatewayd_SOURCES = \
3678         src/journal/journal-gatewayd.c \
3679         src/journal/microhttpd-util.h \
3680         src/journal/microhttpd-util.c
3681
3682 systemd_journal_gatewayd_LDADD = \
3683         libsystemd-logs.la \
3684         libsystemd-journal-internal.la \
3685         libsystemd-internal.la \
3686         libsystemd-shared.la \
3687         $(MICROHTTPD_LIBS)
3688
3689 if HAVE_GNUTLS
3690 systemd_journal_gatewayd_LDADD += \
3691         $(GNUTLS_LIBS)
3692 endif
3693
3694 systemd_journal_gatewayd_CFLAGS = \
3695         $(AM_CFLAGS) \
3696         $(MICROHTTPD_CFLAGS)
3697
3698 systemd_journal_gatewayd_CPPFLAGS = \
3699         $(AM_CPPFLAGS) \
3700         -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
3701
3702 dist_systemunit_DATA += \
3703         units/systemd-journal-gatewayd.socket
3704
3705 nodist_systemunit_DATA += \
3706         units/systemd-journal-gatewayd.service
3707
3708 dist_gatewayddocumentroot_DATA = \
3709         src/journal/browse.html
3710
3711 endif
3712
3713 EXTRA_DIST += \
3714         units/systemd-journal-gatewayd.service.in
3715
3716 # ------------------------------------------------------------------------------
3717
3718 systemd_socket_proxyd_SOURCES = \
3719         src/socket-proxy/socket-proxyd.c
3720
3721 systemd_socket_proxyd_LDADD = \
3722         libsystemd-logs.la \
3723         libsystemd-internal.la \
3724         libsystemd-journal-internal.la \
3725         libsystemd-shared.la \
3726         libsystemd-resolve.la
3727
3728 # ------------------------------------------------------------------------------
3729 if ENABLE_COREDUMP
3730 systemd_coredump_SOURCES = \
3731         src/journal/coredump.c
3732
3733 systemd_coredump_LDADD = \
3734         libsystemd-journal-internal.la \
3735         libsystemd-label.la \
3736         libsystemd-internal.la \
3737         libsystemd-shared.la
3738
3739 if HAVE_ELFUTILS
3740 systemd_coredump_SOURCES += \
3741         src/journal/stacktrace.c \
3742         src/journal/stacktrace.h
3743
3744 systemd_coredump_LDADD += \
3745         $(ELFUTILS_LIBS)
3746 endif
3747
3748 rootlibexec_PROGRAMS += \
3749         systemd-coredump
3750
3751 dist_pkgsysconf_DATA += \
3752         src/journal/coredump.conf
3753
3754 if HAVE_ACL
3755 systemd_coredump_LDADD += \
3756         libsystemd-acl.la
3757 endif
3758
3759 coredumpctl_SOURCES = \
3760         src/journal/coredumpctl.c
3761
3762 coredumpctl_LDADD = \
3763         libsystemd-journal-internal.la \
3764         libsystemd-internal.la \
3765         libsystemd-shared.la
3766
3767 bin_PROGRAMS += \
3768         coredumpctl
3769
3770 dist_bashcompletion_DATA += \
3771         shell-completion/bash/coredumpctl
3772
3773 dist_zshcompletion_DATA += \
3774         shell-completion/zsh/_coredumpctl
3775
3776 sysctl_DATA = \
3777         sysctl.d/50-coredump.conf
3778
3779 CLEANFILES += \
3780         sysctl.d/50-coredump.conf
3781 endif
3782
3783 EXTRA_DIST += \
3784         sysctl.d/50-coredump.conf.in
3785
3786 # ------------------------------------------------------------------------------
3787 if ENABLE_BINFMT
3788 systemd_binfmt_SOURCES = \
3789         src/binfmt/binfmt.c
3790
3791 systemd_binfmt_LDADD = \
3792         libsystemd-shared.la
3793
3794 rootlibexec_PROGRAMS += \
3795         systemd-binfmt
3796
3797 dist_systemunit_DATA += \
3798         units/proc-sys-fs-binfmt_misc.automount \
3799         units/proc-sys-fs-binfmt_misc.mount
3800
3801 nodist_systemunit_DATA += \
3802         units/systemd-binfmt.service
3803
3804 INSTALL_DIRS += \
3805         $(prefix)/lib/binfmt.d \
3806         $(sysconfdir)/binfmt.d
3807
3808 SYSINIT_TARGET_WANTS += \
3809         systemd-binfmt.service \
3810         proc-sys-fs-binfmt_misc.automount
3811
3812 endif
3813
3814 EXTRA_DIST += \
3815         units/systemd-binfmt.service.in
3816
3817 # ------------------------------------------------------------------------------
3818 if ENABLE_VCONSOLE
3819 systemd_vconsole_setup_SOURCES = \
3820         src/vconsole/vconsole-setup.c
3821
3822 systemd_vconsole_setup_LDADD = \
3823         libsystemd-shared.la
3824
3825 rootlibexec_PROGRAMS += \
3826         systemd-vconsole-setup
3827
3828 nodist_systemunit_DATA += \
3829         units/systemd-vconsole-setup.service
3830
3831 SYSINIT_TARGET_WANTS += \
3832         systemd-vconsole-setup.service
3833 endif
3834
3835 EXTRA_DIST += \
3836         units/systemd-vconsole-setup.service.in
3837
3838 # ------------------------------------------------------------------------------
3839 if ENABLE_READAHEAD
3840 systemd_readahead_SOURCES = \
3841         src/readahead/readahead.c \
3842         src/readahead/readahead-collect.c \
3843         src/readahead/readahead-replay.c \
3844         src/readahead/readahead-analyze.c \
3845         src/readahead/readahead-common.c \
3846         src/readahead/readahead-common.h
3847
3848 systemd_readahead_LDADD = \
3849         libsystemd-internal.la \
3850         libudev-internal.la \
3851         libsystemd-shared.la
3852
3853 dist_doc_DATA += \
3854         src/readahead/sd-readahead.c \
3855         src/systemd/sd-readahead.h
3856
3857 rootlibexec_PROGRAMS += \
3858         systemd-readahead
3859
3860 dist_systemunit_DATA += \
3861         units/systemd-readahead-drop.service \
3862         units/systemd-readahead-done.timer
3863
3864 nodist_systemunit_DATA += \
3865         units/systemd-readahead-collect.service \
3866         units/systemd-readahead-replay.service \
3867         units/systemd-readahead-done.service
3868
3869 manual_tests += \
3870         test-ssd
3871
3872 test_ssd_SOURCES = \
3873         src/readahead/test-ssd.c \
3874         src/readahead/readahead-common.c \
3875         src/readahead/readahead-common.h
3876
3877 test_ssd_LDADD = \
3878         libsystemd-internal.la \
3879         libudev-internal.la \
3880         libsystemd-shared.la
3881
3882 endif
3883
3884 EXTRA_DIST += \
3885         units/systemd-readahead-collect.service.in \
3886         units/systemd-readahead-replay.service.in \
3887         units/systemd-readahead-done.service.in
3888
3889 # ------------------------------------------------------------------------------
3890 if ENABLE_BOOTCHART
3891 systemd_bootchart_SOURCES = \
3892         src/bootchart/bootchart.c \
3893         src/bootchart/bootchart.h \
3894         src/bootchart/store.c \
3895         src/bootchart/store.h \
3896         src/bootchart/svg.c \
3897         src/bootchart/svg.h
3898
3899 systemd_bootchart_LDADD = \
3900         libsystemd-journal-internal.la \
3901         libsystemd-shared.la
3902
3903 rootlibexec_PROGRAMS += \
3904         systemd-bootchart
3905
3906 dist_pkgsysconf_DATA += \
3907         src/bootchart/bootchart.conf
3908 endif
3909
3910 # ------------------------------------------------------------------------------
3911 if ENABLE_QUOTACHECK
3912 rootlibexec_PROGRAMS += \
3913         systemd-quotacheck
3914
3915 nodist_systemunit_DATA += \
3916         units/systemd-quotacheck.service
3917
3918 systemd_quotacheck_SOURCES = \
3919         src/quotacheck/quotacheck.c
3920
3921 systemd_quotacheck_LDADD = \
3922         libsystemd-shared.la
3923 endif
3924
3925 EXTRA_DIST += \
3926         units/systemd-quotacheck.service.in
3927
3928 nodist_systemunit_DATA += \
3929         units/quotaon.service
3930
3931 # ------------------------------------------------------------------------------
3932 if ENABLE_RANDOMSEED
3933 rootlibexec_PROGRAMS += \
3934         systemd-random-seed
3935
3936 nodist_systemunit_DATA += \
3937         units/systemd-random-seed.service
3938
3939 systemd_random_seed_SOURCES = \
3940         src/random-seed/random-seed.c
3941
3942 systemd_random_seed_LDADD = \
3943         libsystemd-label.la \
3944         libsystemd-shared.la
3945
3946 SYSINIT_TARGET_WANTS += \
3947         systemd-random-seed.service
3948
3949 endif
3950
3951 EXTRA_DIST += \
3952         units/systemd-random-seed.service.in
3953
3954 # ------------------------------------------------------------------------------
3955 if ENABLE_BACKLIGHT
3956 rootlibexec_PROGRAMS += \
3957         systemd-backlight
3958
3959 nodist_systemunit_DATA += \
3960         units/systemd-backlight@.service
3961
3962 systemd_backlight_SOURCES = \
3963         src/backlight/backlight.c
3964
3965 systemd_backlight_LDADD = \
3966         libsystemd-label.la \
3967         libudev-internal.la \
3968         libsystemd-shared.la
3969 endif
3970
3971 EXTRA_DIST += \
3972         units/systemd-backlight@.service.in
3973
3974 # ------------------------------------------------------------------------------
3975 if ENABLE_RFKILL
3976 rootlibexec_PROGRAMS += \
3977         systemd-rfkill
3978
3979 nodist_systemunit_DATA += \
3980         units/systemd-rfkill@.service
3981
3982 systemd_rfkill_SOURCES = \
3983         src/rfkill/rfkill.c
3984
3985 systemd_rfkill_LDADD = \
3986         libsystemd-label.la \
3987         libudev-internal.la \
3988         libsystemd-shared.la
3989 endif
3990
3991 EXTRA_DIST += \
3992         units/systemd-rfkill@.service.in
3993
3994 # ------------------------------------------------------------------------------
3995 if HAVE_LIBCRYPTSETUP
3996 rootlibexec_PROGRAMS += \
3997         systemd-cryptsetup
3998
3999 systemgenerator_PROGRAMS += \
4000         systemd-cryptsetup-generator
4001
4002 dist_systemunit_DATA += \
4003         units/cryptsetup.target \
4004         units/cryptsetup-pre.target
4005
4006 systemd_cryptsetup_SOURCES = \
4007         src/cryptsetup/cryptsetup.c
4008
4009 systemd_cryptsetup_CFLAGS = \
4010         $(AM_CFLAGS) \
4011         $(LIBCRYPTSETUP_CFLAGS)
4012
4013 systemd_cryptsetup_LDADD = \
4014         libsystemd-label.la \
4015         libudev-internal.la \
4016         libsystemd-shared.la \
4017         $(LIBCRYPTSETUP_LIBS)
4018
4019 systemd_cryptsetup_generator_SOURCES = \
4020         src/cryptsetup/cryptsetup-generator.c
4021
4022 systemd_cryptsetup_generator_LDADD = \
4023         libsystemd-label.la \
4024         libsystemd-shared.la
4025
4026 SYSINIT_TARGET_WANTS += \
4027         cryptsetup.target
4028
4029 endif
4030
4031 # ------------------------------------------------------------------------------
4032 if ENABLE_HOSTNAMED
4033 systemd_hostnamed_SOURCES = \
4034         src/hostname/hostnamed.c
4035
4036 systemd_hostnamed_LDADD = \
4037         libsystemd-label.la \
4038         libsystemd-internal.la \
4039         libsystemd-shared.la
4040
4041 rootlibexec_PROGRAMS += \
4042         systemd-hostnamed
4043
4044 nodist_systemunit_DATA += \
4045         units/systemd-hostnamed.service
4046
4047 dist_systemunit_DATA += \
4048         units/org.freedesktop.hostname1.busname
4049
4050 dist_dbuspolicy_DATA += \
4051         src/hostname/org.freedesktop.hostname1.conf
4052
4053 dist_dbussystemservice_DATA += \
4054         src/hostname/org.freedesktop.hostname1.service
4055
4056 polkitpolicy_files += \
4057         src/hostname/org.freedesktop.hostname1.policy
4058
4059 SYSTEM_UNIT_ALIASES += \
4060         systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
4061
4062 BUSNAMES_TARGET_WANTS += \
4063         org.freedesktop.hostname1.busname
4064
4065 hostnamectl_SOURCES = \
4066         src/hostname/hostnamectl.c
4067
4068 hostnamectl_LDADD = \
4069         libsystemd-internal.la \
4070         libsystemd-shared.la
4071
4072 bin_PROGRAMS += \
4073         hostnamectl
4074
4075 dist_bashcompletion_DATA += \
4076         shell-completion/bash/hostnamectl
4077
4078 dist_zshcompletion_DATA += \
4079         shell-completion/zsh/_hostnamectl
4080
4081 endif
4082
4083 polkitpolicy_in_files += \
4084         src/hostname/org.freedesktop.hostname1.policy.in
4085
4086 EXTRA_DIST += \
4087         units/systemd-hostnamed.service.in
4088
4089 # ------------------------------------------------------------------------------
4090 if ENABLE_KDBUS
4091 dist_systemunit_DATA += \
4092         units/org.freedesktop.systemd1.busname
4093
4094 BUSNAMES_TARGET_WANTS += \
4095         org.freedesktop.systemd1.busname
4096 endif
4097
4098 # ------------------------------------------------------------------------------
4099 if ENABLE_LOCALED
4100 systemd_localed_SOURCES = \
4101         src/locale/localed.c
4102
4103 systemd_localed_LDADD = \
4104         libsystemd-label.la \
4105         libsystemd-internal.la \
4106         libsystemd-shared.la
4107
4108 nodist_systemunit_DATA += \
4109         units/systemd-localed.service
4110
4111 dist_systemunit_DATA += \
4112         units/org.freedesktop.locale1.busname
4113
4114 rootlibexec_PROGRAMS += \
4115         systemd-localed
4116
4117 dist_dbuspolicy_DATA += \
4118         src/locale/org.freedesktop.locale1.conf
4119
4120 dist_dbussystemservice_DATA += \
4121         src/locale/org.freedesktop.locale1.service
4122
4123 polkitpolicy_files += \
4124         src/locale/org.freedesktop.locale1.policy
4125
4126 SYSTEM_UNIT_ALIASES += \
4127         systemd-localed.service dbus-org.freedesktop.locale1.service
4128
4129 BUSNAMES_TARGET_WANTS += \
4130         org.freedesktop.locale1.busname
4131
4132 dist_pkgdata_DATA += \
4133         src/locale/kbd-model-map
4134
4135 dist_noinst_SCRIPT = \
4136         src/locale/generate-kbd-model-map
4137
4138 update-kbd-model-map: src/locale/generate-kbd-model-map
4139         $PYTHON $< >src/locale/kbd-model-map
4140
4141 localectl_SOURCES = \
4142         src/locale/localectl.c
4143
4144 localectl_LDADD = \
4145         libsystemd-internal.la \
4146         libsystemd-shared.la
4147
4148 bin_PROGRAMS += \
4149         localectl
4150
4151 dist_bashcompletion_DATA += \
4152         shell-completion/bash/localectl
4153
4154 dist_zshcompletion_DATA += \
4155         shell-completion/zsh/_localectl
4156
4157 endif
4158
4159 .PHONY: update-kbd-model-map
4160
4161 polkitpolicy_in_files += \
4162         src/locale/org.freedesktop.locale1.policy.in
4163
4164 EXTRA_DIST += \
4165         units/systemd-localed.service.in
4166
4167 # ------------------------------------------------------------------------------
4168 if ENABLE_TIMEDATED
4169 systemd_timedated_SOURCES = \
4170         src/timedate/timedated.c
4171
4172 systemd_timedated_LDADD = \
4173         libsystemd-label.la \
4174         libsystemd-internal.la \
4175         libsystemd-shared.la
4176
4177 rootlibexec_PROGRAMS += \
4178         systemd-timedated
4179
4180 dist_dbussystemservice_DATA += \
4181         src/timedate/org.freedesktop.timedate1.service
4182
4183 dist_dbuspolicy_DATA += \
4184         src/timedate/org.freedesktop.timedate1.conf
4185
4186 nodist_systemunit_DATA += \
4187         units/systemd-timedated.service
4188
4189 dist_systemunit_DATA += \
4190         units/org.freedesktop.timedate1.busname
4191
4192 polkitpolicy_files += \
4193         src/timedate/org.freedesktop.timedate1.policy
4194
4195 INSTALL_DIRS += \
4196         $(prefix)/lib/systemd/ntp-units.d \
4197         $(sysconfdir)/systemd/ntp-units.d
4198
4199 SYSTEM_UNIT_ALIASES += \
4200         systemd-timedated.service dbus-org.freedesktop.timedate1.service
4201
4202 BUSNAMES_TARGET_WANTS += \
4203         org.freedesktop.timedate1.busname
4204
4205 timedatectl_SOURCES = \
4206         src/timedate/timedatectl.c
4207
4208 timedatectl_LDADD = \
4209         libsystemd-internal.la \
4210         libsystemd-shared.la
4211
4212 bin_PROGRAMS += \
4213         timedatectl
4214
4215 dist_bashcompletion_DATA += \
4216         shell-completion/bash/timedatectl
4217
4218 dist_zshcompletion_DATA += \
4219         shell-completion/zsh/_timedatectl
4220 endif
4221
4222 polkitpolicy_in_files += \
4223         src/timedate/org.freedesktop.timedate1.policy.in
4224
4225 EXTRA_DIST += \
4226         units/systemd-timedated.service.in
4227
4228 # ------------------------------------------------------------------------------
4229 if ENABLE_TIMESYNCD
4230 systemd_timesyncd_SOURCES = \
4231         src/timesync/timesyncd.c \
4232         src/timesync/timesyncd.h
4233
4234 nodist_systemd_timesyncd_SOURCES = \
4235         src/timesync/timesyncd-gperf.c
4236
4237 EXTRA_DIST += \
4238         src/timesync/timesyncd-gperf.gperf
4239
4240 CLEANFILES += \
4241         src/timesync/timesyncd-gperf.c
4242
4243 systemd_timesyncd_LDADD = \
4244         libsystemd-resolve.la \
4245         libsystemd-network.la \
4246         libsystemd-label.la \
4247         libsystemd-capability.la \
4248         libsystemd-internal.la \
4249         libsystemd-shared.la \
4250         -lm
4251
4252 rootlibexec_PROGRAMS += \
4253         systemd-timesyncd
4254
4255 nodist_systemunit_DATA += \
4256         units/systemd-timesyncd.service
4257
4258 EXTRA_DIST += \
4259         units/systemd-timesyncd.service.in
4260
4261 nodist_pkgsysconf_DATA += \
4262         src/timesync/timesyncd.conf
4263
4264 EXTRA_DIST += \
4265         src/timesync/timesyncd.conf.in
4266
4267 CLEANFILES += \
4268         src/timesync/timesyncd.conf
4269
4270 dist_ntpunits_DATA = \
4271         src/timesync/90-systemd.list
4272
4273 endif
4274
4275 # ------------------------------------------------------------------------------
4276 if HAVE_MYHOSTNAME
4277 libnss_myhostname_la_SOURCES = \
4278         src/nss-myhostname/nss-myhostname.c \
4279         src/nss-myhostname/ifconf.h \
4280         src/nss-myhostname/netlink.c
4281
4282 libnss_myhostname_la_LDFLAGS = \
4283         $(AM_LDFLAGS) \
4284         -module \
4285         -export-dynamic \
4286         -avoid-version \
4287         -shared \
4288         -shrext .so.2
4289
4290 libnss_myhostname_la_LIBADD = \
4291         libsystemd-shared.la \
4292         libsystemd-internal.la
4293
4294 lib_LTLIBRARIES += \
4295         libnss_myhostname.la
4296 endif
4297
4298 # ------------------------------------------------------------------------------
4299 if ENABLE_MACHINED
4300 systemd_machined_SOURCES = \
4301         src/machine/machined.c \
4302         src/machine/machined.h
4303
4304 systemd_machined_LDADD = \
4305         libsystemd-machine-core.la
4306
4307 rootlibexec_PROGRAMS += \
4308         systemd-machined
4309
4310 libsystemd_machine_core_la_SOURCES = \
4311         src/machine/machined-dbus.c \
4312         src/machine/machine.c \
4313         src/machine/machine.h \
4314         src/machine/machine-dbus.c
4315
4316 libsystemd_machine_core_la_LIBADD = \
4317         libsystemd-label.la \
4318         libsystemd-internal.la \
4319         libudev-internal.la \
4320         libsystemd-shared.la
4321
4322 noinst_LTLIBRARIES += \
4323         libsystemd-machine-core.la
4324
4325 machinectl_SOURCES = \
4326         src/machine/machinectl.c
4327
4328 machinectl_LDADD = \
4329         libsystemd-internal.la \
4330         libsystemd-shared.la
4331
4332 rootbin_PROGRAMS += \
4333         machinectl
4334
4335 dist_bashcompletion_DATA += \
4336         shell-completion/bash/machinectl
4337
4338 test_machine_tables_SOURCES = \
4339         src/machine/test-machine-tables.c
4340
4341 test_machine_tables_LDADD = \
4342         libsystemd-machine-core.la
4343
4344 tests += \
4345         test-machine-tables
4346
4347 nodist_systemunit_DATA += \
4348         units/systemd-machined.service
4349
4350 dist_systemunit_DATA += \
4351         units/machine.slice \
4352         units/org.freedesktop.machine1.busname
4353
4354 dist_dbussystemservice_DATA += \
4355         src/machine/org.freedesktop.machine1.service
4356
4357 dist_dbuspolicy_DATA += \
4358         src/machine/org.freedesktop.machine1.conf
4359
4360 dist_zshcompletion_DATA += \
4361         shell-completion/zsh/_machinectl \
4362         shell-completion/zsh/_sd_machines
4363
4364 SYSTEM_UNIT_ALIASES += \
4365         systemd-machined.service dbus-org.freedesktop.machine1.service
4366
4367 BUSNAMES_TARGET_WANTS += \
4368         org.freedesktop.machine1.busname
4369
4370 EXTRA_DIST += \
4371         units/systemd-machined.service.in
4372
4373 endif
4374
4375 # ------------------------------------------------------------------------------
4376 if ENABLE_RESOLVED
4377 systemd_resolved_SOURCES = \
4378         src/resolve/resolved.h \
4379         src/resolve/resolved.c \
4380         src/resolve/resolved-manager.c
4381
4382 systemd_resolved_CFLAGS = \
4383         $(AM_CFLAGS) \
4384         $(KMOD_CFLAGS)
4385
4386 nodist_systemd_resolved_SOURCES = \
4387         src/resolve/resolved-gperf.c
4388
4389 EXTRA_DIST += \
4390         src/resolve/resolved-gperf.gperf
4391
4392 CLEANFILES += \
4393         src/resolve/resolved-gperf.c
4394
4395 systemd_resolved_LDADD = \
4396         libsystemd-capability.la \
4397         libsystemd-network.la \
4398         libsystemd-label.la \
4399         libsystemd-internal.la \
4400         libsystemd-shared.la
4401
4402 rootlibexec_PROGRAMS += \
4403         systemd-resolved
4404
4405 nodist_systemunit_DATA += \
4406         units/systemd-resolved.service
4407
4408 EXTRA_DIST += \
4409         units/systemd-resolved.service.in
4410
4411 GENERAL_ALIASES += \
4412         $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service
4413
4414 nodist_pkgsysconf_DATA += \
4415         src/resolve/resolved.conf
4416
4417 EXTRA_DIST += \
4418         src/resolve/resolved.conf.in
4419
4420 CLEANFILES += \
4421         src/resolve/resolved.conf
4422
4423 endif
4424
4425 # ------------------------------------------------------------------------------
4426 if ENABLE_NETWORKD
4427 rootlibexec_PROGRAMS += \
4428         systemd-networkd
4429
4430 systemd_networkd_SOURCES = \
4431         src/network/networkd.c
4432
4433 systemd_networkd_LDADD = \
4434         libsystemd-networkd-core.la \
4435         libsystemd-capability.la
4436
4437 noinst_LTLIBRARIES += \
4438         libsystemd-networkd-core.la
4439
4440 libsystemd_networkd_core_la_CFLAGS = \
4441         $(AM_CFLAGS)
4442
4443 libsystemd_networkd_core_la_SOURCES = \
4444         src/libsystemd-network/network-internal.h \
4445         src/network/networkd.h \
4446         src/network/networkd-link.c \
4447         src/network/networkd-netdev.c \
4448         src/network/networkd-tunnel.c \
4449         src/network/networkd-veth.c \
4450         src/network/networkd-vxlan.c \
4451         src/network/networkd-network.c \
4452         src/network/networkd-address.c \
4453         src/network/networkd-route.c \
4454         src/network/networkd-manager.c \
4455         src/network/networkd-address-pool.c
4456
4457 nodist_libsystemd_networkd_core_la_SOURCES = \
4458         src/network/networkd-network-gperf.c \
4459         src/network/networkd-netdev-gperf.c
4460
4461 libsystemd_networkd_core_la_LIBADD = \
4462         libudev-internal.la \
4463         libsystemd-internal.la \
4464         libsystemd-network.la \
4465         libsystemd-label.la \
4466         libsystemd-shared.la
4467
4468 rootlibexec_PROGRAMS += \
4469         systemd-networkd-wait-online
4470
4471 systemd_networkd_wait_online_CFLAGS = \
4472         $(AM_CFLAGS)
4473
4474 systemd_networkd_wait_online_SOURCES = \
4475         src/libsystemd-network/network-internal.h \
4476         src/network/networkd-wait-online.c \
4477         src/network/networkd-wait-online.h
4478
4479 systemd_networkd_wait_online_LDADD = \
4480         libsystemd-network.la \
4481         libudev-internal.la \
4482         libsystemd-internal.la \
4483         libsystemd-shared.la
4484
4485 test_network_SOURCES = \
4486         src/network/test-network.c
4487
4488 test_network_CFLAGS = \
4489         $(AM_CFLAGS)
4490
4491 test_network_LDADD = \
4492         libsystemd-networkd-core.la
4493
4494 tests += \
4495         test-network
4496
4497 nodist_systemunit_DATA += \
4498         units/systemd-networkd.service \
4499         units/systemd-networkd-wait-online.service
4500
4501 GENERAL_ALIASES += \
4502         $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \
4503         $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service
4504
4505 EXTRA_DIST += \
4506         src/network/networkd-network-gperf.gperf \
4507         src/network/networkd-netdev-gperf.gperf \
4508         units/systemd-networkd.service.in \
4509         units/systemd-networkd-wait-online.service.in
4510
4511 CLEANFILES += \
4512         src/network/networkd-network-gperf.c \
4513         src/network/networkd-netdev-gperf.c
4514 endif
4515
4516 # ------------------------------------------------------------------------------
4517 if ENABLE_LOGIND
4518 systemd_logind_SOURCES = \
4519         src/login/logind.c \
4520         src/login/logind.h
4521
4522 nodist_systemd_logind_SOURCES = \
4523         src/login/logind-gperf.c
4524
4525 systemd_logind_LDADD = \
4526         libsystemd-logind-core.la
4527
4528 libsystemd_logind_core_la_SOURCES = \
4529         src/login/logind-core.c \
4530         src/login/logind-device.c \
4531         src/login/logind-device.h \
4532         src/login/logind-button.c \
4533         src/login/logind-button.h \
4534         src/login/logind-action.c \
4535         src/login/logind-action.h \
4536         src/login/logind-seat.c \
4537         src/login/logind-seat.h \
4538         src/login/logind-session.c \
4539         src/login/logind-session.h \
4540         src/login/logind-session-device.c \
4541         src/login/logind-session-device.h \
4542         src/login/logind-user.c \
4543         src/login/logind-user.h \
4544         src/login/logind-inhibit.c \
4545         src/login/logind-inhibit.h \
4546         src/login/logind-dbus.c \
4547         src/login/logind-session-dbus.c \
4548         src/login/logind-seat-dbus.c \
4549         src/login/logind-user-dbus.c \
4550         src/login/logind-acl.h
4551
4552 libsystemd_logind_core_la_LIBADD = \
4553         libsystemd-label.la \
4554         libsystemd-capability.la \
4555         libsystemd-internal.la \
4556         libudev-internal.la \
4557         libsystemd-shared.la
4558
4559 if HAVE_ACL
4560 libsystemd_logind_core_la_SOURCES += \
4561         src/login/logind-acl.c
4562
4563 libsystemd_logind_core_la_LIBADD += \
4564         libsystemd-acl.la
4565 endif
4566
4567 noinst_LTLIBRARIES += \
4568         libsystemd-logind-core.la
4569
4570 systemd_user_sessions_SOURCES = \
4571         src/login/user-sessions.c
4572
4573 systemd_user_sessions_LDADD = \
4574         libsystemd-shared.la
4575
4576 rootlibexec_PROGRAMS += \
4577         systemd-logind \
4578         systemd-user-sessions
4579
4580 loginctl_SOURCES = \
4581         src/login/loginctl.c \
4582         src/login/sysfs-show.c
4583
4584 loginctl_LDADD = \
4585         libsystemd-internal.la \
4586         libudev-internal.la \
4587         libsystemd-shared.la
4588
4589 rootbin_PROGRAMS += \
4590         loginctl
4591
4592 dist_bashcompletion_DATA += \
4593         shell-completion/bash/loginctl
4594
4595 dist_zshcompletion_DATA += \
4596         shell-completion/zsh/_loginctl \
4597         shell-completion/zsh/_systemd-inhibit
4598
4599 systemd_inhibit_SOURCES = \
4600         src/login/inhibit.c
4601
4602 systemd_inhibit_LDADD = \
4603         libsystemd-internal.la \
4604         libsystemd-shared.la
4605
4606 rootbin_PROGRAMS += \
4607         systemd-inhibit
4608
4609 test_login_SOURCES = \
4610         src/libsystemd/sd-login/test-login.c
4611
4612 test_login_LDADD = \
4613         libsystemd-internal.la \
4614         libsystemd-shared.la
4615
4616 test_login_shared_SOURCES = \
4617         src/login/test-login-shared.c
4618
4619 test_login_shared_LDADD = \
4620         libsystemd-internal.la \
4621         libsystemd-shared.la
4622
4623 test_inhibit_SOURCES = \
4624         src/login/test-inhibit.c
4625
4626 test_inhibit_LDADD = \
4627         libsystemd-internal.la \
4628         libsystemd-shared.la
4629
4630 test_login_tables_SOURCES = \
4631         src/login/test-login-tables.c
4632
4633 test_login_tables_LDADD = \
4634         libsystemd-logind-core.la
4635
4636 manual_tests += \
4637         test-login \
4638         test-inhibit
4639
4640 tests += \
4641         test-login-tables \
4642         test-login-shared
4643
4644 if HAVE_PAM
4645 pam_systemd_la_SOURCES = \
4646         src/login/pam-module.c
4647
4648 pam_systemd_la_CFLAGS = \
4649         $(AM_CFLAGS) \
4650         $(PAM_CFLAGS) \
4651         -fvisibility=hidden
4652
4653 pam_systemd_la_LDFLAGS = \
4654         $(AM_LDFLAGS) \
4655         -module \
4656         -export-dynamic \
4657         -avoid-version \
4658         -shared \
4659         -export-symbols-regex '^pam_sm_.*'
4660
4661 pam_systemd_la_LIBADD = \
4662         libsystemd-capability.la \
4663         libsystemd-internal.la \
4664         libsystemd-shared.la \
4665         $(PAM_LIBS)
4666
4667 pamlib_LTLIBRARIES = \
4668         pam_systemd.la
4669
4670 dist_pamconf_DATA = \
4671         src/login/systemd-user
4672 endif
4673
4674 nodist_systemunit_DATA += \
4675         units/systemd-logind.service \
4676         units/systemd-user-sessions.service
4677
4678 dist_systemunit_DATA += \
4679         units/user.slice \
4680         units/org.freedesktop.login1.busname
4681
4682 dist_dbussystemservice_DATA += \
4683         src/login/org.freedesktop.login1.service
4684
4685 dist_dbuspolicy_DATA += \
4686         src/login/org.freedesktop.login1.conf
4687
4688 dist_pkgsysconf_DATA += \
4689         src/login/logind.conf
4690
4691 polkitpolicy_files += \
4692         src/login/org.freedesktop.login1.policy
4693
4694 INSTALL_DIRS += \
4695         $(systemdstatedir)
4696
4697 MULTI_USER_TARGET_WANTS += \
4698         systemd-logind.service \
4699         systemd-user-sessions.service
4700
4701 SYSTEM_UNIT_ALIASES += \
4702         systemd-logind.service dbus-org.freedesktop.login1.service
4703
4704 BUSNAMES_TARGET_WANTS += \
4705         org.freedesktop.login1.busname
4706
4707 if ENABLE_MULTI_SEAT_X
4708
4709 systemd_multi_seat_x_SOURCES = \
4710         src/login/multi-seat-x.c
4711
4712 systemd_multi_seat_x_LDADD = \
4713         libsystemd-label.la \
4714         libsystemd-shared.la
4715
4716 rootlibexec_PROGRAMS += \
4717         systemd-multi-seat-x
4718
4719 endif
4720
4721 dist_udevrules_DATA += \
4722         src/login/70-uaccess.rules \
4723         src/login/70-power-switch.rules
4724
4725 nodist_udevrules_DATA += \
4726         src/login/71-seat.rules \
4727         src/login/73-seat-late.rules
4728
4729 CLEANFILES += \
4730         src/login/logind-gperf.c \
4731         src/login/71-seat.rules \
4732         src/login/73-seat-late.rules
4733 endif
4734
4735 polkitpolicy_in_files += \
4736         src/login/org.freedesktop.login1.policy.in
4737
4738 EXTRA_DIST += \
4739         src/login/logind-gperf.gperf \
4740         src/login/71-seat.rules.in \
4741         src/login/73-seat-late.rules.in \
4742         units/systemd-logind.service.in \
4743         units/systemd-user-sessions.service.in
4744
4745 # ------------------------------------------------------------------------------
4746 if HAVE_PYTHON_DEVEL
4747 pkgpyexec_LTLIBRARIES = \
4748         _journal.la \
4749         id128.la \
4750         _daemon.la \
4751         _reader.la \
4752         login.la
4753
4754 _journal_la_SOURCES = \
4755         src/python-systemd/_journal.c
4756
4757 _journal_la_CFLAGS = \
4758         $(AM_CFLAGS) \
4759         -fvisibility=default \
4760         $(PYTHON_DEVEL_CFLAGS)
4761
4762 _journal_la_LDFLAGS = \
4763         $(AM_LDFLAGS) \
4764         -shared \
4765         -module \
4766         -avoid-version
4767
4768 _journal_la_LIBADD = \
4769         $(PYTHON_DEVEL_LIBS) \
4770         libsystemd.la
4771
4772 id128_la_SOURCES = \
4773         src/python-systemd/id128.c \
4774         src/python-systemd/id128-constants.h \
4775         src/python-systemd/pyutil.c \
4776         src/python-systemd/pyutil.h
4777
4778 id128_la_CFLAGS = \
4779         $(AM_CFLAGS) \
4780         -fvisibility=default \
4781         $(PYTHON_DEVEL_CFLAGS) \
4782         -I$(top_builddir)/src/python-systemd
4783
4784 id128_la_LDFLAGS = \
4785         $(AM_LDFLAGS) \
4786         -shared \
4787         -module \
4788         -avoid-version
4789
4790 id128_la_LIBADD = \
4791         $(PYTHON_DEVEL_LIBS) \
4792         libsystemd-shared.la \
4793         libsystemd.la
4794
4795 _daemon_la_SOURCES = \
4796         src/python-systemd/_daemon.c \
4797         src/python-systemd/pyutil.c \
4798         src/python-systemd/pyutil.h
4799
4800 _daemon_la_CFLAGS = \
4801         $(AM_CFLAGS) \
4802         -fvisibility=default \
4803         $(PYTHON_DEVEL_CFLAGS) \
4804         -I$(top_builddir)/src/python-systemd
4805
4806 _daemon_la_LDFLAGS = \
4807         $(AM_LDFLAGS) \
4808         -shared \
4809         -module \
4810         -avoid-version
4811
4812 _daemon_la_LIBADD = \
4813         $(PYTHON_DEVEL_LIBS) \
4814         libsystemd-shared.la \
4815         libsystemd.la
4816
4817 _reader_la_SOURCES = \
4818         src/python-systemd/_reader.c \
4819         src/python-systemd/pyutil.c \
4820         src/python-systemd/pyutil.h
4821
4822 _reader_la_CFLAGS = \
4823         $(AM_CFLAGS) \
4824         -fvisibility=default \
4825         $(PYTHON_DEVEL_CFLAGS)
4826
4827 _reader_la_LDFLAGS = \
4828         $(AM_LDFLAGS) \
4829         -shared \
4830         -module \
4831         -avoid-version
4832
4833 _reader_la_LIBADD = \
4834         $(PYTHON_DEVEL_LIBS) \
4835         libsystemd-shared.la \
4836         libsystemd.la
4837
4838 login_la_SOURCES = \
4839         src/python-systemd/login.c \
4840         src/python-systemd/pyutil.c \
4841         src/python-systemd/pyutil.h
4842
4843 login_la_CFLAGS = \
4844         $(AM_CFLAGS) \
4845         -fvisibility=default \
4846         $(PYTHON_DEVEL_CFLAGS)
4847
4848 login_la_LDFLAGS = \
4849         $(AM_LDFLAGS) \
4850         -shared \
4851         -module \
4852         -avoid-version
4853
4854 login_la_LIBADD = \
4855         $(PYTHON_DEVEL_LIBS) \
4856         libsystemd-shared.la \
4857         libsystemd.la
4858
4859 dist_pkgpyexec_PYTHON = \
4860         src/python-systemd/journal.py \
4861         src/python-systemd/daemon.py \
4862         src/python-systemd/__init__.py
4863
4864 src/python-systemd/id128-constants.h: src/systemd/sd-messages.h
4865         $(AM_V_at)$(MKDIR_P) $(dir $@)
4866         $(AM_V_GEN)$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
4867
4868 BUILT_SOURCES += \
4869         src/python-systemd/id128-constants.h
4870
4871 SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
4872 sphinx-%:
4873         $(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
4874         $(AM_V_GEN)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) $(top_srcdir)/src/python-systemd/docs $(top_builddir)/docs/html/python-systemd/
4875         $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/html/python-systemd/
4876
4877 python-shell:
4878         $(AM_V_at)echo "Starting python with $(DESTDIR)$(pyexecdir)"
4879         $(AM_V_at)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(PYTHON)
4880
4881 destdir-sphinx: all
4882         dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
4883                 $(MAKE) DESTDIR="$$dir" install && \
4884                 $(MAKE) DESTDIR="$$dir" sphinx-html && \
4885                 rm -rf "$$dir"
4886
4887 endif
4888
4889 CLEAN_LOCAL_HOOKS += clean-sphinx
4890
4891 .PHONY: python-shell destdir-sphinx clean-sphinx clean-python
4892
4893 clean-sphinx:
4894         -rm -rf docs/html/python-systemd/
4895
4896 # Remove Python stuff, e.g. to force rebuilding for a different Python version.
4897 clean-python:
4898         -rm -rf src/python-systemd/.libs src/python-systemd/*.l[ao]
4899         -rm -f _daemon.la id128.la _journal.la login.la _reader.la
4900
4901 # ------------------------------------------------------------------------------
4902 if ENABLE_COMPAT_LIBS
4903 EXTRA_DIST += \
4904         src/compat-libs/linkwarning.h
4905
4906 libsystemd-%.c: src/compat-libs/libsystemd-%.sym
4907         $(AM_V_at)$(MKDIR_P) $(dir $@)
4908         $(AM_V_GEN)sed -r -n 's/^ +(sd_.*);/obsolete_lib(\1,$(notdir $(basename $<)));/p' <$< >$@
4909
4910 BUILT_SOURCES += \
4911         libsystemd-journal.c \
4912         libsystemd-login.c \
4913         libsystemd-id128.c \
4914         libsystemd-daemon.c
4915
4916 libsystemd_journal_la_SOURCES = \
4917         libsystemd-journal.c \
4918         src/compat-libs/libsystemd-journal.sym
4919
4920 libsystemd_journal_la_CPPFLAGS = \
4921         $(AM_CFLAGS) \
4922         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4923
4924 libsystemd_journal_la_LDFLAGS = \
4925         $(AM_LDFLAGS) \
4926         -version-info $(LIBSYSTEMD_JOURNAL_CURRENT):$(LIBSYSTEMD_JOURNAL_REVISION):$(LIBSYSTEMD_JOURNAL_AGE) \
4927         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-journal.sym
4928
4929 libsystemd_journal_la_LIBADD = \
4930         libsystemd-journal-internal.la \
4931         libsystemd-internal.la \
4932         libsystemd-shared.la
4933
4934 libsystemd_login_la_SOURCES = \
4935         libsystemd-login.c \
4936         src/compat-libs/libsystemd-login.sym
4937
4938 libsystemd_login_la_CPPFLAGS = \
4939         $(AM_CFLAGS) \
4940         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4941
4942 libsystemd_login_la_LDFLAGS = \
4943         $(AM_LDFLAGS) \
4944         -version-info $(LIBSYSTEMD_LOGIN_CURRENT):$(LIBSYSTEMD_LOGIN_REVISION):$(LIBSYSTEMD_LOGIN_AGE) \
4945         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-login.sym
4946
4947 libsystemd_login_la_LIBADD = \
4948         libsystemd-internal.la \
4949         libsystemd-shared.la
4950
4951 libsystemd_id128_la_SOURCES = \
4952         libsystemd-id128.c \
4953         src/compat-libs/libsystemd-id128.sym
4954
4955 libsystemd_id128_la_CPPFLAGS = \
4956         $(AM_CFLAGS) \
4957         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4958
4959 libsystemd_id128_la_LDFLAGS = \
4960         $(AM_LDFLAGS) \
4961         -version-info $(LIBSYSTEMD_ID128_CURRENT):$(LIBSYSTEMD_ID128_REVISION):$(LIBSYSTEMD_ID128_AGE) \
4962         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-id128.sym
4963
4964 libsystemd_id128_la_LIBADD = \
4965         libsystemd-internal.la \
4966         libsystemd-shared.la
4967
4968 libsystemd_daemon_la_SOURCES = \
4969         libsystemd-daemon.c \
4970         src/compat-libs/libsystemd-daemon.sym
4971
4972 libsystemd_daemon_la_CPPFLAGS = \
4973         $(AM_CFLAGS) \
4974         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4975
4976 libsystemd_daemon_la_LDFLAGS = \
4977         $(AM_LDFLAGS) \
4978         -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
4979         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-daemon.sym
4980
4981 libsystemd_daemon_la_LIBADD = \
4982         libsystemd-internal.la \
4983         libsystemd-shared.la
4984
4985 lib_LTLIBRARIES += \
4986         libsystemd-journal.la \
4987         libsystemd-login.la \
4988         libsystemd-id128.la \
4989         libsystemd-daemon.la
4990
4991 pkgconfiglib_DATA += \
4992         src/compat-libs/libsystemd-journal.pc \
4993         src/compat-libs/libsystemd-login.pc \
4994         src/compat-libs/libsystemd-id128.pc \
4995         src/compat-libs/libsystemd-daemon.pc
4996
4997 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
4998 compat-lib-install-hook:
4999         libname=libsystemd-login.so && $(move-to-rootlibdir)
5000         libname=libsystemd-journal.so && $(move-to-rootlibdir)
5001         libname=libsystemd-id128.so && $(move-to-rootlibdir)
5002         libname=libsystemd-daemon.so && $(move-to-rootlibdir)
5003
5004 compat-lib-uninstall-hook:
5005         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-login.so*
5006         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so*
5007         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-id128.so*
5008         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so*
5009
5010 INSTALL_EXEC_HOOKS += compat-lib-install-hook
5011 UNINSTALL_EXEC_HOOKS += compat-lib-uninstall-hook
5012 endif
5013
5014 EXTRA_DIST += \
5015         src/compat-libs/libsystemd-journal.pc.in \
5016         src/compat-libs/libsystemd-login.pc.in \
5017         src/compat-libs/libsystemd-id128.pc.in \
5018         src/compat-libs/libsystemd-daemon.pc.in
5019
5020 # ------------------------------------------------------------------------------
5021 substitutions = \
5022        '|rootlibexecdir=$(rootlibexecdir)|' \
5023        '|rootbindir=$(rootbindir)|' \
5024        '|bindir=$(bindir)|' \
5025        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
5026        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
5027        '|pkgsysconfdir=$(pkgsysconfdir)|' \
5028        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
5029        '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
5030        '|pkgdatadir=$(pkgdatadir)|' \
5031        '|systemunitdir=$(systemunitdir)|' \
5032        '|userunitdir=$(userunitdir)|' \
5033        '|systempresetdir=$(systempresetdir)|' \
5034        '|userpresetdir=$(userpresetdir)|' \
5035        '|udevhwdbdir=$(udevhwdbdir)|' \
5036        '|udevrulesdir=$(udevrulesdir)|' \
5037        '|catalogdir=$(catalogdir)|' \
5038        '|tmpfilesdir=$(tmpfilesdir)|' \
5039        '|sysusersdir=$(sysusersdir)|' \
5040        '|sysctldir=$(sysctldir)|' \
5041        '|systemgeneratordir=$(systemgeneratordir)|' \
5042        '|usergeneratordir=$(usergeneratordir)|' \
5043        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
5044        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
5045        '|PACKAGE_URL=$(PACKAGE_URL)|' \
5046        '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
5047        '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
5048        '|prefix=$(prefix)|' \
5049        '|exec_prefix=$(exec_prefix)|' \
5050        '|libdir=$(libdir)|' \
5051        '|includedir=$(includedir)|' \
5052        '|VERSION=$(VERSION)|' \
5053        '|rootprefix=$(rootprefix)|' \
5054        '|udevlibexecdir=$(udevlibexecdir)|' \
5055        '|SUSHELL=$(SUSHELL)|' \
5056        '|DEBUGTTY=$(DEBUGTTY)|' \
5057        '|KILL=$(KILL)|' \
5058        '|KMOD=$(KMOD)|' \
5059        '|MKDIR_P=$(MKDIR_P)|' \
5060        '|QUOTAON=$(QUOTAON)|' \
5061        '|QUOTACHECK=$(QUOTACHECK)|' \
5062        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
5063        '|VARLOGDIR=$(varlogdir)|' \
5064        '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
5065        '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
5066        '|PYTHON=$(PYTHON)|' \
5067        '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
5068        '|NTP_SERVERS=$(NTP_SERVERS)|' \
5069        '|DNS_SERVERS=$(DNS_SERVERS)|' \
5070        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
5071        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
5072        '|TTY_GID=$(TTY_GID)|'
5073
5074 SED_PROCESS = \
5075         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
5076         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
5077                 < $< > $@
5078
5079 units/%: units/%.in
5080         $(SED_PROCESS)
5081
5082 man/%: man/%.in
5083         $(SED_PROCESS)
5084
5085 sysctl.d/%: sysctl.d/%.in
5086         $(SED_PROCESS)
5087
5088 %.pc: %.pc.in
5089         $(SED_PROCESS)
5090
5091 src/core/macros.%: src/core/macros.%.in
5092         $(SED_PROCESS)
5093
5094 src/%.policy.in: src/%.policy.in.in
5095         $(SED_PROCESS)
5096
5097 %.rules: %.rules.in
5098         $(SED_PROCESS)
5099
5100 %.conf: %.conf.in
5101         $(SED_PROCESS)
5102
5103 %.sh: %.sh.in
5104         $(SED_PROCESS)
5105         $(AM_V_GEN)chmod +x $@
5106
5107 src/%.c: src/%.gperf
5108         $(AM_V_at)$(MKDIR_P) $(dir $@)
5109         $(AM_V_GPERF)$(GPERF) < $< > $@
5110
5111 src/%: src/%.m4
5112         $(AM_V_at)$(MKDIR_P) $(dir $@)
5113         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
5114
5115 units/%: units/%.m4
5116         $(AM_V_at)$(MKDIR_P) $(dir $@)
5117         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
5118
5119 units/user/%: units/%.m4
5120         $(AM_V_at)$(MKDIR_P) $(dir $@)
5121         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
5122
5123 if ENABLE_POLKIT
5124 nodist_polkitpolicy_DATA = \
5125         $(polkitpolicy_files) \
5126         $(polkitpolicy_in_in_files:.policy.in.in=.policy)
5127 endif
5128
5129 EXTRA_DIST += \
5130         $(polkitpolicy_in_files) \
5131         $(polkitpolicy_in_in_files)
5132
5133 CLEANFILES += \
5134         $(nodist_systemunit_DATA) \
5135         $(nodist_userunit_DATA) \
5136         $(pkgconfigdata_DATA) \
5137         $(pkgconfiglib_DATA) \
5138         $(nodist_polkitpolicy_DATA)
5139
5140 # ------------------------------------------------------------------------------
5141 if ENABLE_MANPAGES
5142 man/custom-entities.ent: configure.ac
5143         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
5144         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
5145          printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
5146          > $@ # '
5147
5148 DISTCLEANFILES += \
5149         man/custom-entities.ent
5150
5151 XSLTPROC_FLAGS = \
5152         --nonet \
5153         --xinclude \
5154         --stringparam man.output.quietly 1 \
5155         --stringparam funcsynopsis.style ansi \
5156         --stringparam man.authors.section.enabled 0 \
5157         --stringparam man.copyright.section.enabled 0 \
5158         --stringparam systemd.version $(VERSION) \
5159         --path '$(builddir)/man:$(srcdir)/man'
5160
5161 XSLTPROC_PROCESS_MAN = \
5162         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
5163
5164 XSLTPROC_PROCESS_HTML = \
5165         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
5166
5167 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
5168         $(XSLTPROC_PROCESS_MAN)
5169
5170 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
5171         $(XSLTPROC_PROCESS_MAN)
5172
5173 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
5174         $(XSLTPROC_PROCESS_MAN)
5175
5176 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
5177         $(XSLTPROC_PROCESS_MAN)
5178
5179 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
5180         $(XSLTPROC_PROCESS_MAN)
5181
5182 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
5183         $(XSLTPROC_PROCESS_HTML)
5184
5185 define html-alias
5186         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
5187 endef
5188
5189 endif
5190
5191 EXTRA_DIST += \
5192         man/custom-html.xsl \
5193         man/custom-man.xsl
5194
5195 # ------------------------------------------------------------------------------
5196 if HAVE_SYSV_COMPAT
5197 sysvinit_DATA = \
5198         docs/sysvinit/README
5199
5200 varlog_DATA = \
5201         docs/var-log/README
5202
5203 docs/sysvinit/README: docs/sysvinit/README.in
5204         $(SED_PROCESS)
5205
5206 docs/var-log/README: docs/var-log/README.in
5207         $(SED_PROCESS)
5208
5209 CLEANFILES += \
5210         docs/sysvinit/README \
5211         docs/var-log/README
5212 endif
5213
5214 EXTRA_DIST += \
5215         docs/sysvinit/README.in \
5216         docs/var-log/README.in
5217
5218 SOCKETS_TARGET_WANTS += \
5219         systemd-initctl.socket \
5220         systemd-shutdownd.socket
5221
5222 if HAVE_SYSV_COMPAT
5223 RUNLEVEL1_TARGET_WANTS += \
5224         systemd-update-utmp-runlevel.service
5225 RUNLEVEL2_TARGET_WANTS += \
5226         systemd-update-utmp-runlevel.service
5227 RUNLEVEL3_TARGET_WANTS += \
5228         systemd-update-utmp-runlevel.service
5229 RUNLEVEL4_TARGET_WANTS += \
5230         systemd-update-utmp-runlevel.service
5231 RUNLEVEL5_TARGET_WANTS += \
5232         systemd-update-utmp-runlevel.service
5233 endif
5234
5235 SYSINIT_TARGET_WANTS += \
5236         systemd-update-utmp.service \
5237         systemd-update-done.service \
5238         ldconfig.service
5239
5240 LOCAL_FS_TARGET_WANTS += \
5241         systemd-remount-fs.service \
5242         tmp.mount
5243
5244 MULTI_USER_TARGET_WANTS += \
5245         getty.target \
5246         systemd-ask-password-wall.path
5247
5248 SYSINIT_TARGET_WANTS += \
5249         dev-hugepages.mount \
5250         dev-mqueue.mount \
5251         sys-kernel-config.mount \
5252         sys-kernel-debug.mount \
5253         sys-fs-fuse-connections.mount \
5254         systemd-sysctl.service \
5255         systemd-ask-password-console.path
5256
5257 if HAVE_SYSV_COMPAT
5258 SYSTEM_UNIT_ALIASES += \
5259         poweroff.target runlevel0.target \
5260         rescue.target runlevel1.target \
5261         multi-user.target runlevel2.target \
5262         multi-user.target runlevel3.target \
5263         multi-user.target runlevel4.target \
5264         graphical.target runlevel5.target \
5265         reboot.target runlevel6.target
5266 endif
5267
5268 SYSTEM_UNIT_ALIASES += \
5269         graphical.target default.target \
5270         reboot.target ctrl-alt-del.target \
5271         getty@.service autovt@.service
5272
5273 USER_UNIT_ALIASES += \
5274         $(systemunitdir)/shutdown.target shutdown.target \
5275         $(systemunitdir)/sockets.target sockets.target \
5276         $(systemunitdir)/busnames.target busnames.target \
5277         $(systemunitdir)/timers.target timers.target \
5278         $(systemunitdir)/paths.target paths.target \
5279         $(systemunitdir)/bluetooth.target bluetooth.target \
5280         $(systemunitdir)/printer.target printer.target \
5281         $(systemunitdir)/sound.target sound.target \
5282         $(systemunitdir)/smartcard.target smartcard.target
5283
5284 GENERAL_ALIASES += \
5285         $(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
5286         $(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \
5287         $(pkgsysconfdir)/user $(sysconfdir)/xdg/systemd/user \
5288         $(dbussystemservicedir)/org.freedesktop.systemd1.service $(dbussessionservicedir)/org.freedesktop.systemd1.service
5289
5290 if HAVE_SYSV_COMPAT
5291 INSTALL_DIRS += \
5292         $(systemunitdir)/runlevel1.target.wants \
5293         $(systemunitdir)/runlevel2.target.wants \
5294         $(systemunitdir)/runlevel3.target.wants \
5295         $(systemunitdir)/runlevel4.target.wants \
5296         $(systemunitdir)/runlevel5.target.wants
5297 endif
5298
5299 INSTALL_DIRS += \
5300         $(prefix)/lib/modules-load.d \
5301         $(sysconfdir)/modules-load.d \
5302         $(prefix)/lib/systemd/network \
5303         $(sysconfdir)/systemd/network \
5304         $(prefix)/lib/sysctl.d \
5305         $(sysconfdir)/sysctl.d \
5306         $(prefix)/lib/kernel/install.d \
5307         $(sysconfdir)/kernel/install.d \
5308         $(systemshutdowndir) \
5309         $(systemsleepdir) \
5310         $(systemgeneratordir) \
5311         $(usergeneratordir) \
5312         \
5313         $(userunitdir) \
5314         $(pkgsysconfdir)/system \
5315         $(pkgsysconfdir)/system/multi-user.target.wants \
5316         $(pkgsysconfdir)/system/getty.target.wants \
5317         $(pkgsysconfdir)/user \
5318         $(dbussessionservicedir) \
5319         $(sysconfdir)/xdg/systemd
5320
5321 install-exec-hook: $(INSTALL_EXEC_HOOKS)
5322
5323 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
5324
5325 install-data-hook: $(INSTALL_DATA_HOOKS)
5326
5327 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
5328
5329 clean-local: $(CLEAN_LOCAL_HOOKS)
5330         rm -rf $(abs_srcdir)/install-tree
5331         rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
5332               $(abs_srcdir)/hwdb/iab.txt
5333
5334 DISTCHECK_CONFIGURE_FLAGS = \
5335         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
5336         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
5337         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
5338         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
5339         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
5340         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
5341         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
5342         --with-rootprefix=$$dc_install_base \
5343         --disable-split-usr \
5344         --enable-kdbus \
5345         --enable-compat-libs
5346
5347 if HAVE_SYSV_COMPAT
5348 DISTCHECK_CONFIGURE_FLAGS += \
5349         --with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
5350         --with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
5351 else
5352 DISTCHECK_CONFIGURE_FLAGS += \
5353         --with-sysvinit-path= \
5354         --with-sysvrcnd-path=
5355 endif
5356
5357 if ENABLE_GTK_DOC
5358 DISTCHECK_CONFIGURE_FLAGS += \
5359         --enable-gtk-doc
5360 endif
5361
5362 # check "broken" platforms limited toolchains for link breakage before we release
5363 .PHONY: linkcheck
5364 linkcheck:
5365         $(MAKE) CFLAGS='-fno-lto' LDFLAGS='-Wl,-fuse-ld=gold -Wl,--as-needed -Wl,--no-gc-sections' distcheck
5366
5367 .PHONY: hwdb-update
5368 hwdb-update:
5369         ( cd $(top_srcdir)/hwdb && \
5370         wget -N http://www.linux-usb.org/usb.ids \
5371                 http://pci-ids.ucw.cz/v2.2/pci.ids \
5372                 http://standards.ieee.org/develop/regauth/oui/oui.txt \
5373                 http://standards.ieee.org/develop/regauth/iab/iab.txt && \
5374         ./ids-update.pl )
5375
5376 .PHONY: kdbus-update
5377 kdbus-update:
5378         ( cd $(top_srcdir)/src/libsystemd/sd-bus/ && \
5379         wget -N https://d-bus.googlecode.com/git/kdbus.h )
5380
5381 .PHONY: git-tag
5382 git-tag:
5383         git tag -s "v$(VERSION)" -m "systemd $(VERSION)"
5384
5385 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
5386 .PHONY: upload
5387 upload: all check dist
5388         scp systemd-$(VERSION).tar.xz $(www_target)
5389
5390 .PHONY: doc-sync
5391 doc-sync: all destdir-sphinx
5392         gtkdoc-rebase --html-dir=docs/libudev/html --online
5393         rsync -rlv --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
5394         gtkdoc-rebase --html-dir=docs/gudev/html --online
5395         rsync -rlv --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
5396         rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
5397         rsync -rlv --delete --omit-dir-times docs/html/python-systemd/ $(www_target)/python-systemd/
5398
5399 .PHONY: tango
5400 tango: upload
5401         cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
5402         scp man/*.html tango:public/systemd-man/
5403
5404 .PHONY: install-tree
5405 install-tree: all
5406         rm -rf $(abs_srcdir)/install-tree
5407         $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
5408         tree $(abs_srcdir)/install-tree
5409
5410 # Let's run all tests of the test suite, but under valgrind. Let's
5411 # exclude the one perl script we have in there
5412 .PHONY: valgrind-tests
5413 valgrind-tests: $(TESTS)
5414         $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
5415                 if file $$f | grep -q shell; then \
5416                 echo -e "$${x}Skipping non-binary $$f"; else \
5417                 echo -e "$${x}Running $$f"; \
5418                 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
5419                 x="\n\n"; \
5420         done
5421
5422 exported-%: %
5423         $(AM_V_GEN)nm -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
5424
5425 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
5426         $(AM_V_GEN)cat $^ > $@
5427
5428 .PHONY: check-api-docs
5429 check-api-docs: exported man
5430         $(AM_V_GEN)for symbol in `cat exported` ; do \
5431                 if test -f $(builddir)/man/$$symbol.html ; then \
5432                         echo "  Symbol $$symbol() is documented." ; \
5433                 else \
5434                         echo "‣ Symbol $$symbol() lacks documentation." ; \
5435                 fi ; \
5436         done
5437
5438 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
5439 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
5440
5441 undefined defined: $(ALL_OBJECTS)
5442         $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
5443                 nm -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
5444         done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
5445
5446 CLEANFILES += \
5447         defined \
5448         undefined
5449
5450 .PHONY: check-api-unused
5451 check-api-unused: defined undefined exported
5452         ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
5453
5454 .PHONY: check-includes
5455 check-includes: $(top_srcdir)/tools/check-includes.pl
5456         $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
5457                 | xargs $(top_srcdir)/tools/check-includes.pl
5458
5459 EXTRA_DIST += \
5460         $(top_srcdir)/tools/check-includes.pl
5461
5462 # Stupid test that everything purported to be exported really is
5463 define generate-sym-test
5464         $(AM_V_at)$(MKDIR_P) $(dir $@)
5465         $(AM_V_at)printf '#include <stdio.h>\n' > $@
5466         $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
5467         $(AM_V_at)printf 'void* functions[] = {\n' >> $@
5468         $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
5469         $(AM_V_at)printf '};\nint main(void) {\n' >> $@
5470         $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
5471         $(AM_V_at)printf 'return 0; }\n' >> $@
5472 endef
5473
5474 test-libsystemd-sym.c: \
5475                 $(top_builddir)/src/libsystemd/libsystemd.sym \
5476                 src/systemd/sd-journal.h \
5477                 src/systemd/sd-daemon.h \
5478                 src/systemd/sd-login.h \
5479                 src/systemd/sd-bus.h \
5480                 src/systemd/sd-utf8.h \
5481                 src/systemd/sd-resolve.h
5482         $(generate-sym-test)
5483
5484 test-libudev-sym.c: \
5485                 src/libudev/libudev.sym \
5486                 src/udev/udev.h
5487         $(generate-sym-test)
5488
5489 test_libsystemd_sym_SOURCES = \
5490         test-libsystemd-sym.c
5491 test_libsystemd_sym_LDADD = \
5492         libsystemd.la
5493
5494 test_libudev_sym_SOURCES = \
5495         test-libudev-sym.c
5496 test_libudev_sym_CFLAGS = \
5497         $(AM_CFLAGS) \
5498         -Wno-deprecated-declarations
5499 test_libudev_sym_LDADD = \
5500         libudev.la
5501
5502 BUILT_SOURCES += \
5503         $(test_libsystemd_sym_SOURCES) \
5504         $(test_libudev_sym_SOURCES)
5505
5506 tests += \
5507         test-libsystemd-sym \
5508         test-libudev-sym
5509
5510 .PHONY: cppcheck
5511 cppcheck:
5512         cppcheck --enable=all -q $(top_srcdir)
5513
5514 # Used to extract compile flags for YCM.
5515 print-%:
5516         @echo $($*)
5517
5518 git-contrib:
5519         @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u