chiark / gitweb /
getty-generator: properly escape instance names
[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
1248 EXTRA_DIST += \
1249         test/sched_idle_bad.service \
1250         test/sched_idle_ok.service \
1251         test/sched_rr_bad.service \
1252         test/sched_rr_ok.service \
1253         test/sched_rr_change.service \
1254         test/son.service \
1255         test/daughter.service \
1256         test/parent.slice
1257
1258 EXTRA_DIST += \
1259         src/test/test-helper.h
1260
1261 test_device_nodes_SOURCES = \
1262         src/test/test-device-nodes.c
1263
1264 test_device_nodes_LDADD = \
1265         libsystemd-shared.la
1266
1267 test_engine_SOURCES = \
1268         src/test/test-engine.c
1269
1270 test_engine_CFLAGS = \
1271         $(AM_CFLAGS) \
1272         $(SECCOMP_CFLAGS)
1273
1274 test_engine_LDADD = \
1275         libsystemd-core.la \
1276         $(RT_LIBS)
1277
1278 test_job_type_SOURCES = \
1279         src/test/test-job-type.c
1280
1281 test_job_type_CFLAGS = \
1282         $(AM_CFLAGS) \
1283         $(SECCOMP_CFLAGS)
1284
1285 test_job_type_LDADD = \
1286         libsystemd-core.la \
1287         $(RT_LIBS)
1288
1289 test_ns_SOURCES = \
1290         src/test/test-ns.c
1291
1292 test_ns_CFLAGS = \
1293         $(AM_CFLAGS) \
1294         $(SECCOMP_CFLAGS)
1295
1296 test_ns_LDADD = \
1297         libsystemd-core.la
1298
1299 test_loopback_SOURCES = \
1300         src/test/test-loopback.c
1301
1302 test_loopback_LDADD = \
1303         libsystemd-core.la
1304
1305 test_hostname_SOURCES = \
1306         src/test/test-hostname.c
1307
1308 test_hostname_LDADD = \
1309         libsystemd-core.la
1310
1311 if ENABLE_EFI
1312 manual_tests += \
1313         test-boot-timestamp
1314
1315 test_boot_timestamp_SOURCES = \
1316         src/test/test-boot-timestamps.c
1317
1318 test_boot_timestamp_LDADD = \
1319         libsystemd-shared.la
1320 endif
1321
1322 test_unit_name_SOURCES = \
1323         src/test/test-unit-name.c
1324
1325 test_unit_name_CFLAGS = \
1326         $(AM_CFLAGS) \
1327         $(SECCOMP_CFLAGS)
1328
1329 test_unit_name_LDADD = \
1330         libsystemd-core.la \
1331         $(RT_LIBS)
1332
1333 test_unit_file_SOURCES = \
1334         src/test/test-unit-file.c
1335
1336 test_unit_file_CFLAGS = \
1337         $(AM_CFLAGS) \
1338         $(SECCOMP_CFLAGS)
1339
1340 test_unit_file_LDADD = \
1341         libsystemd-core.la \
1342         $(RT_LIBS)
1343
1344 test_utf8_SOURCES = \
1345         src/test/test-utf8.c
1346
1347 test_utf8_LDADD = \
1348         libsystemd-shared.la
1349
1350 test_fdset_SOURCES = \
1351         src/test/test-fdset.c
1352
1353 test_fdset_LDADD = \
1354         libsystemd-core.la
1355
1356 test_util_SOURCES = \
1357         src/test/test-util.c
1358
1359 test_util_LDADD = \
1360         libsystemd-core.la
1361
1362 test_socket_util_SOURCES = \
1363         src/test/test-socket-util.c
1364
1365 test_socket_util_LDADD = \
1366         libsystemd-core.la
1367
1368 test_ring_SOURCES = \
1369         src/test/test-ring.c
1370
1371 test_ring_LDADD = \
1372         libsystemd-core.la
1373
1374 test_tmpfiles_SOURCES = \
1375         src/test/test-tmpfiles.c
1376
1377 test_tmpfiles_LDADD = \
1378         libsystemd-shared.la
1379
1380 test_namespace_SOURCES = \
1381         src/test/test-namespace.c
1382
1383 test_namespace_LDADD = \
1384         libsystemd-core.la
1385
1386 test_hashmap_SOURCES = \
1387         src/test/test-hashmap.c
1388
1389 test_hashmap_LDADD = \
1390         libsystemd-core.la
1391
1392 test_xml_SOURCES = \
1393         src/test/test-xml.c
1394
1395 test_xml_LDADD = \
1396         libsystemd-shared.la
1397
1398 test_list_SOURCES = \
1399         src/test/test-list.c
1400
1401 test_list_LDADD = \
1402         libsystemd-core.la
1403
1404 test_tables_SOURCES = \
1405         src/test/test-tables.c \
1406         src/shared/test-tables.h
1407
1408 test_tables_CFLAGS = \
1409         $(AM_CFLAGS) \
1410         $(SECCOMP_CFLAGS)
1411
1412 test_tables_LDADD = \
1413         libsystemd-logs.la \
1414         libsystemd-journal-internal.la \
1415         libsystemd-core.la \
1416         $(RT_LIBS)
1417
1418 test_prioq_SOURCES = \
1419         src/test/test-prioq.c
1420
1421 test_prioq_LDADD = \
1422         libsystemd-core.la
1423
1424 test_fileio_SOURCES = \
1425         src/test/test-fileio.c
1426
1427 test_fileio_LDADD = \
1428         libsystemd-core.la
1429
1430 test_time_SOURCES = \
1431         src/test/test-time.c
1432
1433 test_time_LDADD = \
1434         libsystemd-core.la
1435
1436 test_architecture_SOURCES = \
1437         src/test/test-architecture.c
1438
1439 test_architecture_LDADD = \
1440         libsystemd-shared.la
1441
1442 test_log_SOURCES = \
1443         src/test/test-log.c
1444
1445 test_log_LDADD = \
1446         libsystemd-core.la
1447
1448 test_ipcrm_SOURCES = \
1449         src/test/test-ipcrm.c
1450
1451 test_ipcrm_LDADD = \
1452         libsystemd-shared.la \
1453         -lrt
1454
1455 test_rtnl_manual_SOURCES = \
1456         src/test/test-rtnl-manual.c
1457
1458 test_rtnl_manual_CFLAGS = \
1459         $(AM_CFLAGS) \
1460         $(KMOD_CFLAGS)
1461
1462 test_rtnl_manual_LDADD = \
1463         libsystemd-internal.la \
1464         libsystemd-shared.la \
1465         $(KMOD_LIBS)
1466
1467 test_ellipsize_SOURCES = \
1468         src/test/test-ellipsize.c
1469
1470 test_ellipsize_LDADD = \
1471         libsystemd-core.la
1472
1473 test_date_SOURCES = \
1474         src/test/test-date.c
1475
1476 test_date_LDADD = \
1477         libsystemd-core.la
1478
1479 test_sleep_SOURCES = \
1480         src/test/test-sleep.c
1481
1482 test_sleep_LDADD = \
1483         libsystemd-core.la
1484
1485 test_replace_var_SOURCES = \
1486         src/test/test-replace-var.c
1487
1488 test_replace_var_LDADD = \
1489         libsystemd-shared.la
1490
1491 test_calendarspec_SOURCES = \
1492         src/test/test-calendarspec.c
1493
1494 test_calendarspec_LDADD = \
1495         libsystemd-shared.la
1496
1497 test_strip_tab_ansi_SOURCES = \
1498         src/test/test-strip-tab-ansi.c
1499
1500 test_strip_tab_ansi_LDADD = \
1501         libsystemd-shared.la
1502
1503 test_daemon_SOURCES = \
1504         src/test/test-daemon.c
1505
1506 test_daemon_LDADD = \
1507         libsystemd-internal.la \
1508         libsystemd-shared.la
1509
1510 test_cgroup_SOURCES = \
1511         src/test/test-cgroup.c
1512
1513 test_cgroup_LDADD = \
1514         libsystemd-label.la \
1515         libsystemd-shared.la \
1516         libsystemd-internal.la
1517
1518 test_cgroup_mask_SOURCES = \
1519         src/test/test-cgroup-mask.c
1520
1521 test_cgroup_mask_CPPFLAGS = \
1522         $(AM_CPPFLAGS) \
1523         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1524
1525 test_cgroup_mask_CFLAGS = \
1526         $(AM_CFLAGS) \
1527         $(SECCOMP_CFLAGS)
1528
1529 test_cgroup_mask_LDADD = \
1530         libsystemd-core.la \
1531         $(RT_LIBS)
1532
1533 test_cgroup_util_SOURCES = \
1534         src/test/test-cgroup-util.c
1535
1536 test_cgroup_util_LDADD = \
1537         libsystemd-label.la \
1538         libsystemd-internal.la \
1539         libsystemd-shared.la
1540
1541 test_env_replace_SOURCES = \
1542         src/test/test-env-replace.c
1543
1544 test_env_replace_LDADD = \
1545         libsystemd-shared.la
1546
1547 test_strbuf_SOURCES = \
1548         src/test/test-strbuf.c
1549
1550 test_strbuf_LDADD = \
1551         libsystemd-shared.la
1552
1553 test_strv_SOURCES = \
1554         src/test/test-strv.c
1555
1556 test_strv_LDADD = \
1557         libsystemd-units.la \
1558         libsystemd-internal.la \
1559         libsystemd-shared.la
1560
1561 test_path_util_SOURCES = \
1562         src/test/test-path-util.c
1563
1564 test_path_util_LDADD = \
1565         libsystemd-shared.la
1566
1567 test_strxcpyx_SOURCES = \
1568         src/test/test-strxcpyx.c
1569
1570 test_strxcpyx_LDADD = \
1571         libsystemd-shared.la
1572
1573 test_install_SOURCES = \
1574         src/test/test-install.c
1575
1576 test_install_LDADD = \
1577         libsystemd-units.la \
1578         libsystemd-label.la \
1579         libsystemd-shared.la \
1580         libsystemd-internal.la
1581
1582 test_watchdog_SOURCES = \
1583         src/test/test-watchdog.c
1584
1585 test_watchdog_LDADD = \
1586         libsystemd-shared.la
1587
1588 test_sched_prio_SOURCES = \
1589         src/test/test-sched-prio.c
1590
1591 test_sched_prio_CPPFLAGS = \
1592         $(AM_CPPFLAGS) \
1593         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1594
1595 test_sched_prio_CFLAGS = \
1596         $(AM_CFLAGS) \
1597         $(SECCOMP_CFLAGS)
1598
1599 test_sched_prio_LDADD = \
1600         libsystemd-core.la \
1601         $(RT_LIBS)
1602
1603 # ------------------------------------------------------------------------------
1604 ## .PHONY so it always rebuilds it
1605 .PHONY: coverage lcov-run lcov-report coverage-sync
1606
1607 # run lcov from scratch, always
1608 coverage:
1609         $(MAKE) lcov-run
1610         $(MAKE) lcov-report
1611
1612 coverage_dir = coverage
1613 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
1614
1615 if ENABLE_COVERAGE
1616 # reset run coverage tests
1617 lcov-run:
1618         @rm -rf $(coverage_dir)
1619         lcov $(coverage_opts) --zerocounters
1620         -$(MAKE) check
1621
1622 # generate report based on current coverage data
1623 lcov-report:
1624         $(MKDIR_P) $(coverage_dir)
1625         lcov $(coverage_opts) --compat-libtool --capture --no-external \
1626                 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
1627         genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov.info
1628         @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
1629
1630 # lcov doesn't work properly with vpath builds, make sure that bad
1631 # output is not uploaded by mistake.
1632 coverage-sync: coverage
1633         test "$(builddir)" = "$(srcdir)"
1634         rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
1635
1636 else
1637 lcov-run lcov-report:
1638         echo "Need to reconfigure with --enable-coverage"
1639 endif
1640
1641 # ------------------------------------------------------------------------------
1642 systemd_analyze_SOURCES = \
1643         src/analyze/analyze.c
1644
1645 systemd_analyze_LDADD = \
1646         libsystemd-internal.la \
1647         libsystemd-shared.la
1648
1649 # ------------------------------------------------------------------------------
1650 systemd_initctl_SOURCES = \
1651         src/initctl/initctl.c
1652
1653 systemd_initctl_LDADD = \
1654         libsystemd-internal.la \
1655         libsystemd-shared.la
1656
1657 # ------------------------------------------------------------------------------
1658 systemd_update_utmp_SOURCES = \
1659         src/update-utmp/update-utmp.c
1660
1661 systemd_update_utmp_CFLAGS = \
1662         $(AM_CFLAGS) \
1663         $(AUDIT_CFLAGS)
1664
1665 systemd_update_utmp_LDADD = \
1666         libsystemd-internal.la \
1667         libsystemd-shared.la \
1668         $(AUDIT_LIBS)
1669
1670 # ------------------------------------------------------------------------------
1671 systemd_update_done_SOURCES = \
1672         src/update-done/update-done.c
1673
1674 systemd_update_done_LDADD = \
1675         libsystemd-internal.la \
1676         libsystemd-shared.la
1677
1678 # ------------------------------------------------------------------------------
1679 systemd_shutdownd_SOURCES = \
1680         src/shutdownd/shutdownd.c
1681
1682 systemd_shutdownd_LDADD = \
1683         libsystemd-label.la \
1684         libsystemd-internal.la \
1685         libsystemd-shared.la
1686
1687 dist_doc_DATA += \
1688         src/systemd/sd-shutdown.h
1689
1690 # ------------------------------------------------------------------------------
1691 systemd_shutdown_SOURCES = \
1692         src/core/umount.c \
1693         src/core/umount.h \
1694         src/core/shutdown.c \
1695         src/core/mount-setup.c \
1696         src/core/mount-setup.h \
1697         src/core/killall.h \
1698         src/core/killall.c
1699
1700 systemd_shutdown_LDADD = \
1701         libsystemd-label.la \
1702         libudev-internal.la \
1703         libsystemd-shared.la
1704
1705 # ------------------------------------------------------------------------------
1706 if HAVE_KMOD
1707 systemd_modules_load_SOURCES = \
1708         src/modules-load/modules-load.c
1709
1710 systemd_modules_load_CFLAGS = \
1711         $(AM_CFLAGS) \
1712         $(KMOD_CFLAGS)
1713
1714 systemd_modules_load_LDADD = \
1715         libsystemd-shared.la \
1716         $(KMOD_LIBS)
1717
1718 rootlibexec_PROGRAMS += \
1719         systemd-modules-load
1720
1721 nodist_systemunit_DATA += \
1722         units/systemd-modules-load.service
1723
1724 SYSINIT_TARGET_WANTS += \
1725         systemd-modules-load.service
1726
1727 if ENABLE_TMPFILES
1728 nodist_systemunit_DATA += \
1729         units/kmod-static-nodes.service
1730
1731 SYSINIT_TARGET_WANTS += \
1732         kmod-static-nodes.service
1733 endif
1734 endif
1735
1736 EXTRA_DIST += \
1737         units/systemd-modules-load.service.in \
1738         units/kmod-static-nodes.service.in
1739
1740 # ------------------------------------------------------------------------------
1741 if ENABLE_TMPFILES
1742 systemd_tmpfiles_SOURCES = \
1743         src/tmpfiles/tmpfiles.c
1744
1745 systemd_tmpfiles_LDADD = \
1746         libsystemd-units.la \
1747         libsystemd-label.la \
1748         libsystemd-capability.la \
1749         libsystemd-internal.la \
1750         libsystemd-shared.la
1751
1752 rootbin_PROGRAMS += \
1753         systemd-tmpfiles
1754
1755 dist_systemunit_DATA += \
1756         units/systemd-tmpfiles-clean.timer
1757
1758 nodist_systemunit_DATA += \
1759         units/systemd-tmpfiles-setup-dev.service \
1760         units/systemd-tmpfiles-setup.service \
1761         units/systemd-tmpfiles-clean.service
1762
1763 dist_tmpfiles_DATA = \
1764         tmpfiles.d/systemd.conf \
1765         tmpfiles.d/systemd-nologin.conf \
1766         tmpfiles.d/tmp.conf \
1767         tmpfiles.d/x11.conf \
1768         tmpfiles.d/var.conf \
1769         tmpfiles.d/etc.conf
1770
1771 if HAVE_SYSV_COMPAT
1772 dist_tmpfiles_DATA += \
1773         tmpfiles.d/legacy.conf
1774 endif
1775
1776 SYSINIT_TARGET_WANTS += \
1777         systemd-tmpfiles-setup-dev.service \
1778         systemd-tmpfiles-setup.service
1779
1780 dist_zshcompletion_DATA += \
1781         shell-completion/zsh/_systemd-tmpfiles
1782
1783 TIMERS_TARGET_WANTS += \
1784         systemd-tmpfiles-clean.timer
1785
1786 INSTALL_DIRS += \
1787         $(tmpfilesdir) \
1788         $(sysconfdir)/tmpfiles.d
1789 endif
1790
1791 EXTRA_DIST += \
1792         units/systemd-tmpfiles-setup-dev.service.in \
1793         units/systemd-tmpfiles-setup.service.in \
1794         units/systemd-tmpfiles-clean.service.in
1795
1796 # ------------------------------------------------------------------------------
1797 if ENABLE_SYSUSERS
1798 systemd_sysusers_SOURCES = \
1799         src/sysusers/sysusers.c
1800
1801 systemd_sysusers_LDADD = \
1802         libsystemd-units.la \
1803         libsystemd-label.la \
1804         libsystemd-capability.la \
1805         libsystemd-internal.la \
1806         libsystemd-shared.la
1807
1808 rootbin_PROGRAMS += \
1809         systemd-sysusers
1810
1811 nodist_systemunit_DATA += \
1812         units/systemd-sysusers.service
1813
1814 SYSINIT_TARGET_WANTS += \
1815         systemd-sysusers.service
1816
1817 nodist_sysusers_DATA = \
1818         sysusers.d/systemd.conf
1819
1820 EXTRA_DIST += \
1821         units/systemd-sysusers.service.in \
1822         sysusers.d/systemd.conf.in
1823
1824 INSTALL_DIRS += \
1825         $(sysusersdir)
1826 endif
1827
1828 # ------------------------------------------------------------------------------
1829 systemd_machine_id_setup_SOURCES = \
1830         src/machine-id-setup/machine-id-setup-main.c \
1831         src/core/machine-id-setup.c \
1832         src/core/machine-id-setup.h
1833
1834 systemd_machine_id_setup_LDADD = \
1835         libsystemd-label.la \
1836         libsystemd-internal.la \
1837         libsystemd-shared.la
1838
1839 # ------------------------------------------------------------------------------
1840 systemd_sysctl_SOURCES = \
1841         src/sysctl/sysctl.c
1842
1843 systemd_sysctl_LDADD = \
1844         libsystemd-shared.la
1845
1846 # ------------------------------------------------------------------------------
1847 systemd_sleep_SOURCES = \
1848         src/sleep/sleep.c
1849
1850 systemd_sleep_LDADD = \
1851         libsystemd-shared.la
1852
1853 # ------------------------------------------------------------------------------
1854 systemd_fsck_SOURCES = \
1855         src/fsck/fsck.c
1856
1857 systemd_fsck_LDADD = \
1858         libsystemd-internal.la \
1859         libudev-internal.la \
1860         libsystemd-shared.la
1861
1862 # ------------------------------------------------------------------------------
1863 systemd_ac_power_SOURCES = \
1864         src/ac-power/ac-power.c
1865
1866 systemd_ac_power_LDADD = \
1867         libudev-internal.la \
1868         libsystemd-shared.la
1869
1870 # ------------------------------------------------------------------------------
1871 systemd_detect_virt_SOURCES = \
1872         src/detect-virt/detect-virt.c
1873
1874 systemd_detect_virt_LDADD = \
1875         libsystemd-shared.la
1876
1877 INSTALL_EXEC_HOOKS += \
1878         systemd-detect-virt-install-hook
1879
1880 # ------------------------------------------------------------------------------
1881 systemd_delta_SOURCES = \
1882         src/delta/delta.c
1883
1884 systemd_delta_LDADD = \
1885         libsystemd-shared.la
1886
1887 # ------------------------------------------------------------------------------
1888 systemd_getty_generator_SOURCES = \
1889         src/getty-generator/getty-generator.c
1890
1891 systemd_getty_generator_LDADD = \
1892         libsystemd-label.la \
1893         libsystemd-shared.la
1894
1895 # ------------------------------------------------------------------------------
1896 systemd_debug_generator_SOURCES = \
1897         src/debug-generator/debug-generator.c
1898
1899 systemd_debug_generator_LDADD = \
1900         libsystemd-label.la \
1901         libsystemd-shared.la
1902
1903 # ------------------------------------------------------------------------------
1904 systemd_fstab_generator_SOURCES = \
1905         src/fstab-generator/fstab-generator.c \
1906         src/core/mount-setup.c
1907
1908 systemd_fstab_generator_LDADD = \
1909         libsystemd-label.la \
1910         libsystemd-shared.la
1911
1912 # ------------------------------------------------------------------------------
1913 systemd_system_update_generator_SOURCES = \
1914         src/system-update-generator/system-update-generator.c
1915
1916 systemd_system_update_generator_LDADD = \
1917         libsystemd-label.la \
1918         libsystemd-shared.la
1919
1920 if ENABLE_EFI
1921 # ------------------------------------------------------------------------------
1922 systemgenerator_PROGRAMS +=  \
1923         systemd-efi-boot-generator
1924
1925 systemd_efi_boot_generator_SOURCES = \
1926         src/efi-boot-generator/efi-boot-generator.c
1927
1928 systemd_efi_boot_generator_LDADD = \
1929         libsystemd-label.la \
1930         libsystemd-shared.la
1931
1932 # ------------------------------------------------------------------------------
1933 bootctl_SOURCES = \
1934         src/boot/boot.h \
1935         src/boot/boot-loader.h \
1936         src/boot/bootctl.c \
1937         src/boot/boot-loader.c \
1938         src/boot/boot-efi.c
1939
1940 bootctl_LDADD = \
1941         libsystemd-shared.la \
1942         libsystemd-internal.la
1943
1944 bin_PROGRAMS += \
1945         bootctl
1946
1947 dist_bashcompletion_DATA += \
1948         shell-completion/bash/bootctl
1949
1950 dist_zshcompletion_DATA += \
1951         shell-completion/zsh/_bootctl
1952
1953 endif
1954
1955 # ------------------------------------------------------------------------------
1956 if HAVE_BLKID
1957 systemgenerator_PROGRAMS +=  \
1958         systemd-gpt-auto-generator
1959
1960 systemd_gpt_auto_generator_SOURCES = \
1961         src/gpt-auto-generator/gpt-auto-generator.c \
1962         src/shared/blkid-util.h
1963
1964 systemd_gpt_auto_generator_LDADD = \
1965         libsystemd-label.la \
1966         libsystemd-internal.la \
1967         libudev-internal.la \
1968         libsystemd-shared.la \
1969         $(BLKID_LIBS)
1970
1971 systemd_gpt_auto_generator_CFLAGS = \
1972         $(AM_CFLAGS) \
1973         $(BLKID_CFLAGS)
1974 endif
1975
1976 # ------------------------------------------------------------------------------
1977 if ENABLE_KDBUS
1978 systemgenerator_PROGRAMS +=  \
1979         systemd-dbus1-generator
1980
1981 systemd_dbus1_generator_SOURCES = \
1982         src/dbus1-generator/dbus1-generator.c
1983
1984 systemd_dbus1_generator_LDADD = \
1985         libsystemd-label.la \
1986         libsystemd-shared.la \
1987         libsystemd-internal.la
1988
1989 dbus1-generator-install-hook:
1990         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
1991         $(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
1992         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
1993
1994 dbus1-generator-uninstall-hook:
1995         rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
1996
1997 INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
1998 UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
1999 endif
2000
2001 # ------------------------------------------------------------------------------
2002 systemd_sysv_generator_SOURCES = \
2003         src/sysv-generator/sysv-generator.c
2004
2005 systemd_sysv_generator_LDADD = \
2006         libsystemd-core.la \
2007         libsystemd-label.la \
2008         libsystemd-shared.la
2009
2010 # ------------------------------------------------------------------------------
2011 systemd_rc_local_generator_SOURCES = \
2012         src/rc-local-generator/rc-local-generator.c
2013
2014 systemd_rc_local_generator_LDADD = \
2015         libsystemd-label.la \
2016         libsystemd-shared.la
2017
2018 # ------------------------------------------------------------------------------
2019 systemd_remount_fs_SOURCES = \
2020         src/remount-fs/remount-fs.c \
2021         src/core/mount-setup.c \
2022         src/core/mount-setup.h
2023
2024 systemd_remount_fs_LDADD = \
2025         libsystemd-label.la \
2026         libsystemd-shared.la
2027
2028 # ------------------------------------------------------------------------------
2029 systemd_cgroups_agent_SOURCES = \
2030         src/cgroups-agent/cgroups-agent.c
2031
2032 systemd_cgroups_agent_LDADD = \
2033         libsystemd-internal.la \
2034         libsystemd-shared.la
2035
2036 # ------------------------------------------------------------------------------
2037 systemctl_SOURCES = \
2038         src/systemctl/systemctl.c
2039
2040 systemctl_LDADD = \
2041         libsystemd-units.la \
2042         libsystemd-label.la \
2043         libsystemd-internal.la \
2044         libsystemd-logs.la \
2045         libsystemd-journal-internal.la \
2046         libsystemd-shared.la
2047
2048 # ------------------------------------------------------------------------------
2049 systemd_notify_SOURCES = \
2050         src/notify/notify.c \
2051         src/readahead/sd-readahead.c
2052
2053 systemd_notify_LDADD = \
2054         libsystemd-internal.la \
2055         libsystemd-shared.la
2056
2057 # ------------------------------------------------------------------------------
2058 systemd_ask_password_SOURCES = \
2059         src/ask-password/ask-password.c
2060
2061 systemd_ask_password_LDADD = \
2062         libsystemd-label.la \
2063         libsystemd-shared.la
2064
2065 # ------------------------------------------------------------------------------
2066 systemd_reply_password_SOURCES = \
2067         src/reply-password/reply-password.c
2068
2069 systemd_reply_password_LDADD = \
2070         libsystemd-shared.la
2071
2072 # ------------------------------------------------------------------------------
2073 systemd_cgls_SOURCES = \
2074         src/cgls/cgls.c
2075
2076 systemd_cgls_LDADD = \
2077         libsystemd-internal.la \
2078         libsystemd-shared.la
2079
2080 # ------------------------------------------------------------------------------
2081 systemd_cgtop_SOURCES = \
2082         src/cgtop/cgtop.c
2083
2084 systemd_cgtop_LDADD = \
2085         libsystemd-shared.la
2086
2087 # ------------------------------------------------------------------------------
2088 systemd_nspawn_SOURCES = \
2089         src/nspawn/nspawn.c \
2090         src/core/mount-setup.c \
2091         src/core/mount-setup.h \
2092         src/core/loopback-setup.c \
2093         src/core/loopback-setup.h
2094
2095 systemd_nspawn_CFLAGS = \
2096         $(AM_CFLAGS) \
2097         $(SECCOMP_CFLAGS) \
2098         $(BLKID_CFLAGS)
2099
2100 systemd_nspawn_LDADD = \
2101         libsystemd-label.la \
2102         libsystemd-capability.la \
2103         libsystemd-internal.la \
2104         libudev-internal.la \
2105         libsystemd-shared.la \
2106         $(BLKID_LIBS)
2107
2108 if HAVE_SECCOMP
2109 systemd_nspawn_LDADD += \
2110         libsystemd-seccomp.la \
2111         $(SECCOMP_LIBS)
2112 endif
2113
2114 # ------------------------------------------------------------------------------
2115 systemd_run_SOURCES = \
2116         src/run/run.c
2117
2118 systemd_run_LDADD = \
2119         libsystemd-label.la \
2120         libsystemd-capability.la \
2121         libsystemd-internal.la \
2122         libsystemd-shared.la
2123
2124 # ------------------------------------------------------------------------------
2125 systemd_bus_proxyd_SOURCES = \
2126         src/bus-proxyd/bus-proxyd.c \
2127         src/bus-proxyd/bus-policy.c \
2128         src/bus-proxyd/bus-policy.h
2129
2130 systemd_bus_proxyd_LDADD = \
2131         libsystemd-capability.la \
2132         libsystemd-internal.la \
2133         libsystemd-shared.la
2134
2135 bus-proxyd-install-hook:
2136         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
2137         $(AM_V_RM)rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
2138         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
2139
2140 bus-proxyd-uninstall-hook:
2141         rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
2142
2143 INSTALL_EXEC_HOOKS += bus-proxyd-install-hook
2144 UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook
2145
2146 if ENABLE_KDBUS
2147 nodist_systemunit_DATA += \
2148         units/systemd-bus-proxyd@.service
2149
2150 dist_systemunit_DATA += \
2151         units/systemd-bus-proxyd.socket
2152
2153 dist_userunit_DATA += \
2154         units/user/systemd-bus-proxyd.socket \
2155         units/user/systemd-bus-proxyd@.service
2156 endif
2157
2158 EXTRA_DIST += \
2159         units/systemd-bus-proxyd@.service.in
2160
2161 # ------------------------------------------------------------------------------
2162 systemd_tty_ask_password_agent_SOURCES = \
2163         src/tty-ask-password-agent/tty-ask-password-agent.c
2164
2165 systemd_tty_ask_password_agent_LDADD = \
2166         libsystemd-label.la \
2167         libsystemd-shared.la
2168
2169 # ------------------------------------------------------------------------------
2170 libsystemd_internal_la_SOURCES = \
2171         src/systemd/sd-bus.h \
2172         src/systemd/sd-bus-protocol.h \
2173         src/systemd/sd-bus-vtable.h \
2174         src/systemd/sd-memfd.h \
2175         src/systemd/sd-utf8.h \
2176         src/systemd/sd-event.h \
2177         src/systemd/sd-rtnl.h \
2178         src/systemd/sd-resolve.h \
2179         src/systemd/sd-login.h \
2180         src/systemd/sd-id128.h \
2181         src/systemd/sd-daemon.h \
2182         src/libsystemd/sd-bus/sd-bus.c \
2183         src/libsystemd/sd-bus/bus-control.c \
2184         src/libsystemd/sd-bus/bus-control.h \
2185         src/libsystemd/sd-bus/bus-error.c \
2186         src/libsystemd/sd-bus/bus-error.h \
2187         src/libsystemd/sd-bus/bus-internal.c \
2188         src/libsystemd/sd-bus/bus-internal.h \
2189         src/libsystemd/sd-bus/bus-socket.c \
2190         src/libsystemd/sd-bus/bus-socket.h \
2191         src/libsystemd/sd-bus/bus-kernel.c \
2192         src/libsystemd/sd-bus/bus-kernel.h \
2193         src/libsystemd/sd-bus/bus-container.c \
2194         src/libsystemd/sd-bus/bus-container.h \
2195         src/libsystemd/sd-bus/bus-message.c \
2196         src/libsystemd/sd-bus/bus-message.h \
2197         src/libsystemd/sd-bus/bus-creds.c \
2198         src/libsystemd/sd-bus/bus-creds.h \
2199         src/libsystemd/sd-bus/bus-signature.c \
2200         src/libsystemd/sd-bus/bus-signature.h \
2201         src/libsystemd/sd-bus/bus-type.c \
2202         src/libsystemd/sd-bus/bus-type.h \
2203         src/libsystemd/sd-bus/bus-match.c \
2204         src/libsystemd/sd-bus/bus-match.h \
2205         src/libsystemd/sd-bus/bus-bloom.c \
2206         src/libsystemd/sd-bus/bus-bloom.h \
2207         src/libsystemd/sd-bus/bus-introspect.c \
2208         src/libsystemd/sd-bus/bus-introspect.h \
2209         src/libsystemd/sd-bus/bus-objects.c \
2210         src/libsystemd/sd-bus/bus-objects.h \
2211         src/libsystemd/sd-bus/bus-gvariant.c \
2212         src/libsystemd/sd-bus/bus-gvariant.h \
2213         src/libsystemd/sd-bus/bus-convenience.c \
2214         src/libsystemd/sd-bus/bus-track.c \
2215         src/libsystemd/sd-bus/bus-track.h \
2216         src/libsystemd/sd-bus/bus-util.c \
2217         src/libsystemd/sd-bus/bus-util.h \
2218         src/libsystemd/sd-bus/bus-slot.c \
2219         src/libsystemd/sd-bus/bus-slot.h \
2220         src/libsystemd/sd-bus/bus-protocol.h \
2221         src/libsystemd/sd-bus/kdbus.h \
2222         src/libsystemd/sd-bus/sd-memfd.c \
2223         src/libsystemd/sd-utf8/sd-utf8.c \
2224         src/libsystemd/sd-event/sd-event.c \
2225         src/libsystemd/sd-event/event-util.h \
2226         src/libsystemd/sd-rtnl/sd-rtnl.c \
2227         src/libsystemd/sd-rtnl/rtnl-internal.h \
2228         src/libsystemd/sd-rtnl/rtnl-message.c \
2229         src/libsystemd/sd-rtnl/rtnl-types.h \
2230         src/libsystemd/sd-rtnl/rtnl-types.c \
2231         src/libsystemd/sd-rtnl/rtnl-util.h \
2232         src/libsystemd/sd-rtnl/rtnl-util.c \
2233         src/libsystemd/sd-id128/sd-id128.c \
2234         src/libsystemd/sd-daemon/sd-daemon.c \
2235         src/libsystemd/sd-login/sd-login.c
2236
2237 nodist_libsystemd_internal_la_SOURCES = \
2238         src/libsystemd/libsystemd.sym \
2239         src/libsystemd/sd-bus/bus-error-mapping.c
2240
2241 libsystemd_internal_la_CFLAGS = \
2242         $(AM_CFLAGS) \
2243         -pthread
2244
2245 libsystemd_internal_la_LIBADD = \
2246         $(RT_LIBS)
2247
2248 libsystemd_resolve_la_SOURCES = \
2249         src/libsystemd/sd-resolve/sd-resolve.c \
2250         src/libsystemd/sd-resolve/resolve-util.h
2251
2252 libsystemd_resolve_la_CFLAGS = \
2253         $(AM_CFLAGS) \
2254         -pthread
2255
2256 libsystemd_resolve_la_LIBADD = \
2257         -lresolv
2258
2259 noinst_LTLIBRARIES += \
2260         libsystemd-internal.la \
2261         libsystemd-resolve.la
2262
2263 libsystemd_dump_la_SOURCES = \
2264         src/libsystemd/sd-bus/bus-dump.c \
2265         src/libsystemd/sd-bus/bus-dump.h
2266
2267 libsystemd_dump_la_CFLAGS = \
2268         $(AM_CFLAGS) \
2269         $(CAP_CFLAGS)
2270
2271 noinst_LTLIBRARIES += \
2272         libsystemd-dump.la
2273
2274 EXTRA_DIST += \
2275         src/libsystemd/libsystemd.sym.m4 \
2276         src/libsystemd/libsystemd.pc.in \
2277         src/libsystemd/sd-bus/bus-error-mapping.gperf \
2278         src/libsystemd/sd-bus/DIFFERENCES \
2279         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
2280
2281 CLEANFILES += \
2282         src/libsystemd/libsystemd.sym \
2283         src/libsystemd/sd-bus/bus-error-mapping.c
2284
2285 BUILT_SOURCES += \
2286         src/libsystemd/libsystemd.sym
2287
2288 libsystemd_la_SOURCES = \
2289         $(libsystemd_internal_la_SOURCES) \
2290         $(libsystemd_resolve_la_SOURCES) \
2291         $(libsystemd_journal_internal_la_SOURCES)
2292
2293 nodist_libsystemd_la_SOURCES = \
2294         $(nodist_libsystemd_internal_la_SOURCES)
2295
2296 libsystemd_la_CFLAGS = \
2297         $(libsystemd_internal_la_CFLAGS) \
2298         $(libsystemd_resolve_la_CFLAGS) \
2299         $(libsystemd_journal_internal_la_CFLAGS)
2300
2301 libsystemd_la_LDFLAGS = \
2302         $(AM_LDFLAGS) \
2303         -version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
2304         -Wl,--version-script=$(top_builddir)/src/libsystemd/libsystemd.sym
2305
2306 libsystemd_la_LIBADD = \
2307         libsystemd-shared.la \
2308         $(libsystemd_internal_la_LIBADD) \
2309         $(libsystemd_journal_internal_la_LIBADD) \
2310         $(libsystemd_resolve_la_LIBADD)
2311
2312 libsystemd-install-hook:
2313         libname=libsystemd.so && $(move-to-rootlibdir)
2314
2315 libsystemd-uninstall-hook:
2316         rm -f $(DESTDIR)$(rootlibdir)/libsystemd.so*
2317
2318 INSTALL_EXEC_HOOKS += libsystemd-install-hook
2319 UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook
2320
2321 pkgconfiglib_DATA += \
2322         src/libsystemd/libsystemd.pc
2323
2324 pkginclude_HEADERS += \
2325         src/systemd/sd-login.h \
2326         src/systemd/sd-id128.h \
2327         src/systemd/sd-daemon.h
2328
2329 if ENABLE_KDBUS
2330 pkginclude_HEADERS += \
2331         src/systemd/sd-bus.h \
2332         src/systemd/sd-bus-protocol.h \
2333         src/systemd/sd-bus-vtable.h \
2334         src/systemd/sd-memfd.h \
2335         src/systemd/sd-utf8.h \
2336         src/systemd/sd-event.h \
2337         src/systemd/sd-rtnl.h \
2338         src/systemd/sd-resolve.h
2339 endif
2340
2341 lib_LTLIBRARIES += \
2342         libsystemd.la
2343
2344 tests += \
2345         test-bus-marshal \
2346         test-bus-signature \
2347         test-bus-chat \
2348         test-bus-cleanup \
2349         test-bus-server \
2350         test-bus-match \
2351         test-bus-kernel \
2352         test-bus-kernel-bloom \
2353         test-bus-kernel-benchmark \
2354         test-bus-memfd \
2355         test-bus-zero-copy \
2356         test-bus-introspect \
2357         test-bus-objects \
2358         test-bus-error \
2359         test-bus-creds \
2360         test-bus-gvariant \
2361         test-event \
2362         test-rtnl \
2363         test-resolve
2364
2365 bin_PROGRAMS += \
2366         busctl
2367
2368 test_bus_marshal_SOURCES = \
2369         src/libsystemd/sd-bus/test-bus-marshal.c
2370
2371 test_bus_marshal_LDADD = \
2372         libsystemd-internal.la \
2373         libsystemd-shared.la \
2374         libsystemd-dump.la \
2375         libsystemd-capability.la \
2376         $(GLIB_LIBS) \
2377         $(DBUS_LIBS) \
2378         $(CAP_LIBS)
2379
2380 test_bus_marshal_CFLAGS = \
2381         $(AM_CFLAGS) \
2382         $(GLIB_CFLAGS) \
2383         $(DBUS_CFLAGS) \
2384         $(CAP_CFLAGS)
2385
2386 test_bus_signature_SOURCES = \
2387         src/libsystemd/sd-bus/test-bus-signature.c
2388
2389 test_bus_signature_LDADD = \
2390         libsystemd-shared.la \
2391         libsystemd-internal.la
2392
2393 test_bus_chat_SOURCES = \
2394         src/libsystemd/sd-bus/test-bus-chat.c
2395
2396 test_bus_chat_CFLAGS = \
2397         $(AM_CFLAGS) \
2398         -pthread
2399
2400 test_bus_chat_LDADD = \
2401         libsystemd-internal.la \
2402         libsystemd-shared.la
2403
2404 test_bus_cleanup_SOURCES = \
2405         src/libsystemd/sd-bus/test-bus-cleanup.c
2406
2407 test_bus_cleanup_CFLAGS = \
2408         $(AM_CFLAGS) \
2409         $(SECCOMP_CFLAGS)
2410
2411 test_bus_cleanup_LDADD = \
2412         libsystemd-internal.la \
2413         libsystemd-shared.la
2414
2415 test_bus_server_SOURCES = \
2416         src/libsystemd/sd-bus/test-bus-server.c
2417
2418 test_bus_server_CFLAGS = \
2419         $(AM_CFLAGS) \
2420         -pthread
2421
2422 test_bus_server_LDADD = \
2423         libsystemd-internal.la \
2424         libsystemd-shared.la
2425
2426 test_bus_objects_SOURCES = \
2427         src/libsystemd/sd-bus/test-bus-objects.c
2428
2429 test_bus_objects_CFLAGS = \
2430         $(AM_CFLAGS) \
2431         $(CAP_CFLAGS) \
2432         -pthread
2433
2434 test_bus_objects_LDADD = \
2435         libsystemd-internal.la \
2436         libsystemd-shared.la \
2437         libsystemd-dump.la \
2438         libsystemd-capability.la \
2439         $(CAP_LIBS)
2440
2441 test_bus_error_SOURCES = \
2442         src/libsystemd/sd-bus/test-bus-error.c
2443
2444 test_bus_error_LDADD = \
2445         libsystemd-internal.la \
2446         libsystemd-shared.la
2447
2448 test_bus_gvariant_SOURCES = \
2449         src/libsystemd/sd-bus/test-bus-gvariant.c
2450
2451 test_bus_gvariant_LDADD = \
2452         libsystemd-internal.la \
2453         libsystemd-shared.la \
2454         libsystemd-dump.la \
2455         libsystemd-capability.la \
2456         $(GLIB_LIBS) \
2457         $(CAP_LIBS)
2458
2459 test_bus_gvariant_CFLAGS = \
2460         $(AM_CFLAGS) \
2461         $(GLIB_CFLAGS)
2462         $(CAP_CFLAGS)
2463
2464 test_bus_creds_SOURCES = \
2465         src/libsystemd/sd-bus/test-bus-creds.c
2466
2467 test_bus_creds_LDADD = \
2468         libsystemd-internal.la \
2469         libsystemd-shared.la \
2470         libsystemd-dump.la \
2471         libsystemd-capability.la
2472
2473 test_bus_match_SOURCES = \
2474         src/libsystemd/sd-bus/test-bus-match.c
2475
2476 test_bus_match_LDADD = \
2477         libsystemd-internal.la \
2478         libsystemd-shared.la
2479
2480 test_bus_kernel_SOURCES = \
2481         src/libsystemd/sd-bus/test-bus-kernel.c
2482
2483 test_bus_kernel_LDADD = \
2484         libsystemd-internal.la \
2485         libsystemd-shared.la \
2486         libsystemd-dump.la \
2487         libsystemd-capability.la \
2488         $(CAP_LIBS)
2489
2490 test_bus_kernel_CFLAGS = \
2491         $(AM_CFLAGS) \
2492         $(CAP_CFLAGS)
2493
2494 test_bus_kernel_bloom_SOURCES = \
2495         src/libsystemd/sd-bus/test-bus-kernel-bloom.c
2496
2497 test_bus_kernel_bloom_LDADD = \
2498         libsystemd-internal.la \
2499         libsystemd-shared.la
2500
2501 test_bus_kernel_benchmark_SOURCES = \
2502         src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
2503
2504 test_bus_kernel_benchmark_LDADD = \
2505         libsystemd-internal.la \
2506         libsystemd-shared.la
2507
2508 test_bus_memfd_SOURCES = \
2509         src/libsystemd/sd-bus/test-bus-memfd.c
2510
2511 test_bus_memfd_LDADD = \
2512         libsystemd-internal.la \
2513         libsystemd-shared.la
2514
2515 test_bus_zero_copy_SOURCES = \
2516         src/libsystemd/sd-bus/test-bus-zero-copy.c
2517
2518 test_bus_zero_copy_LDADD = \
2519         libsystemd-internal.la \
2520         libsystemd-shared.la \
2521         libsystemd-dump.la \
2522         libsystemd-capability.la \
2523         $(CAP_LIBS)
2524
2525 test_bus_zero_copy_CFLAGS = \
2526         $(AM_CFLAGS) \
2527         $(CAP_CFLAGS)
2528
2529 test_bus_introspect_SOURCES = \
2530         src/libsystemd/sd-bus/test-bus-introspect.c
2531
2532 test_bus_introspect_LDADD = \
2533         libsystemd-internal.la \
2534         libsystemd-shared.la
2535
2536 test_event_SOURCES = \
2537         src/libsystemd/sd-event/test-event.c
2538
2539 test_event_LDADD = \
2540         libsystemd-internal.la \
2541         libsystemd-shared.la
2542
2543 test_rtnl_SOURCES = \
2544         src/libsystemd/sd-rtnl/test-rtnl.c
2545
2546 test_rtnl_LDADD = \
2547         libsystemd-internal.la \
2548         libsystemd-shared.la
2549
2550 test_resolve_SOURCES = \
2551         src/libsystemd/sd-resolve/test-resolve.c
2552
2553 test_resolve_LDADD = \
2554         libsystemd-resolve.la \
2555         libsystemd-internal.la \
2556         libsystemd-shared.la
2557
2558 test_resolve_CFLAGS = \
2559         $(AM_CFLAGS) \
2560         -pthread
2561
2562 busctl_SOURCES = \
2563         src/libsystemd/sd-bus/busctl.c
2564
2565 busctl_LDADD = \
2566         libsystemd-internal.la \
2567         libsystemd-shared.la \
2568         libsystemd-dump.la \
2569         libsystemd-capability.la \
2570         $(CAP_LIBS)
2571
2572 busctl_CFLAGS = \
2573         $(AM_CFLAGS) \
2574         $(CAP_CFLAGS)
2575
2576 # ------------------------------------------------------------------------------
2577 noinst_LTLIBRARIES += \
2578         libsystemd-network.la
2579
2580 libsystemd_network_la_CFLAGS = \
2581         $(AM_CFLAGS) \
2582         $(KMOD_CFLAGS)
2583
2584 libsystemd_network_la_SOURCES = \
2585         src/systemd/sd-network.h \
2586         src/systemd/sd-dhcp-client.h \
2587         src/systemd/sd-dhcp-server.h \
2588         src/systemd/sd-dhcp-lease.h \
2589         src/systemd/sd-ipv4ll.h \
2590         src/network/sd-network.c \
2591         src/network/network-util.h \
2592         src/libsystemd-network/sd-dhcp-client.c \
2593         src/libsystemd-network/sd-dhcp-server.c \
2594         src/libsystemd-network/dhcp-network.c \
2595         src/libsystemd-network/dhcp-option.c \
2596         src/libsystemd-network/dhcp-packet.c \
2597         src/libsystemd-network/dhcp-internal.h \
2598         src/libsystemd-network/dhcp-server-internal.h \
2599         src/libsystemd-network/dhcp-protocol.h \
2600         src/libsystemd-network/dhcp-lease-internal.h \
2601         src/libsystemd-network/sd-dhcp-lease.c \
2602         src/libsystemd-network/sd-ipv4ll.c \
2603         src/libsystemd-network/ipv4ll-network.c \
2604         src/libsystemd-network/ipv4ll-packet.c \
2605         src/libsystemd-network/ipv4ll-internal.h \
2606         src/libsystemd-network/network-internal.c \
2607         src/libsystemd-network/network-internal.h \
2608         src/systemd/sd-icmp6-nd.h \
2609         src/systemd/sd-dhcp6-client.h \
2610         src/systemd/sd-dhcp6-lease.h \
2611         src/libsystemd-network/sd-icmp6-nd.c \
2612         src/libsystemd-network/sd-dhcp6-client.c \
2613         src/libsystemd-network/dhcp6-internal.h \
2614         src/libsystemd-network/dhcp6-protocol.h \
2615         src/libsystemd-network/dhcp6-network.c \
2616         src/libsystemd-network/dhcp6-option.c \
2617         src/libsystemd-network/dhcp6-lease-internal.h \
2618         src/libsystemd-network/sd-dhcp6-lease.c
2619
2620 libsystemd_network_la_LIBADD = \
2621         libudev-internal.la \
2622         libsystemd-label.la \
2623         libsystemd-internal.la \
2624         libsystemd-shared.la \
2625         $(KMOD_LIBS)
2626
2627 test_dhcp_option_SOURCES = \
2628         src/libsystemd-network/dhcp-protocol.h \
2629         src/libsystemd-network/dhcp-internal.h \
2630         src/libsystemd-network/test-dhcp-option.c
2631
2632 test_dhcp_option_LDADD = \
2633         libsystemd-network.la \
2634         libsystemd-internal.la \
2635         libsystemd-shared.la
2636
2637 test_dhcp_client_SOURCES = \
2638         src/systemd/sd-dhcp-client.h \
2639         src/libsystemd-network/dhcp-protocol.h \
2640         src/libsystemd-network/dhcp-internal.h \
2641         src/libsystemd-network/test-dhcp-client.c
2642
2643 test_dhcp_client_LDADD = \
2644         libsystemd-network.la \
2645         libsystemd-label.la \
2646         libsystemd-internal.la \
2647         libsystemd-shared.la
2648
2649 test_dhcp_server_SOURCES = \
2650         src/libsystemd-network/test-dhcp-server.c
2651
2652 test_dhcp_server_LDADD = \
2653         libsystemd-network.la \
2654         libsystemd-internal.la \
2655         libsystemd-shared.la
2656
2657 test_ipv4ll_SOURCES = \
2658         src/systemd/sd-ipv4ll.h \
2659         src/libsystemd-network/ipv4ll-internal.h \
2660         src/libsystemd-network/test-ipv4ll.c
2661
2662 test_ipv4ll_LDADD = \
2663         libsystemd-network.la \
2664         libsystemd-label.la \
2665         libsystemd-internal.la \
2666         libsystemd-shared.la
2667
2668 test_icmp6_rs_SOURCES = \
2669         src/systemd/sd-dhcp6-client.h \
2670         src/systemd/sd-icmp6-nd.h \
2671         src/libsystemd-network/dhcp6-internal.h \
2672         src/libsystemd-network/test-icmp6-rs.c
2673
2674 test_icmp6_rs_LDADD = \
2675         libsystemd-network.la \
2676         libsystemd-internal.la \
2677         libsystemd-shared.la
2678
2679 test_dhcp6_client_SOURCES = \
2680         src/systemd/sd-dhcp6-client.h \
2681         src/libsystemd-network/dhcp6-internal.h \
2682         src/libsystemd-network/test-dhcp6-client.c
2683
2684 test_dhcp6_client_LDADD = \
2685         libsystemd-network.la \
2686         libsystemd-internal.la \
2687         libsystemd-shared.la
2688
2689 tests += \
2690         test-dhcp-option \
2691         test-dhcp-client \
2692         test-dhcp-server \
2693         test-ipv4ll \
2694         test-icmp6-rs \
2695         test-dhcp6-client
2696
2697 # ------------------------------------------------------------------------------
2698 if ENABLE_GTK_DOC
2699 SUBDIRS += \
2700         docs/libudev
2701
2702 noinst_DATA += \
2703         docs/html/libudev \
2704         docs/html/gudev
2705 endif
2706
2707 include_HEADERS += \
2708         src/libudev/libudev.h
2709
2710 lib_LTLIBRARIES += \
2711         libudev.la
2712
2713 libudev_la_SOURCES =\
2714         src/libudev/libudev.sym \
2715         src/libudev/libudev-private.h \
2716         src/libudev/libudev.c \
2717         src/libudev/libudev-list.c \
2718         src/libudev/libudev-util.c \
2719         src/libudev/libudev-device.c \
2720         src/libudev/libudev-enumerate.c \
2721         src/libudev/libudev-monitor.c \
2722         src/libudev/libudev-queue.c \
2723         src/libudev/libudev-hwdb-def.h \
2724         src/libudev/libudev-hwdb.c
2725
2726 libudev_la_CFLAGS = \
2727         $(AM_CFLAGS) \
2728         -fvisibility=hidden
2729
2730 libudev_la_LDFLAGS = \
2731         $(AM_LDFLAGS) \
2732         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
2733         -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
2734
2735 libudev_la_LIBADD = \
2736         libsystemd-internal.la \
2737         libsystemd-shared.la
2738
2739 pkgconfiglib_DATA += \
2740         src/libudev/libudev.pc
2741
2742 EXTRA_DIST += \
2743         src/libudev/libudev.pc.in
2744
2745 CLEANFILES += \
2746         src/libudev/libudev.pc \
2747         docs/html/libudev \
2748         docs/html/gudev
2749
2750 docs/html/libudev:
2751         $(AM_V_at)$(MKDIR_P) $(dir $@)
2752         $(AM_V_LN)$(LN_S) -f ../libudev/html $@
2753
2754 docs/html/gudev:
2755         $(AM_V_at)$(MKDIR_P) $(dir $@)
2756         $(AM_V_LN)$(LN_S) -f ../gudev/html $@
2757
2758 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2759 libudev-install-hook:
2760         libname=libudev.so && $(move-to-rootlibdir)
2761
2762 libudev-uninstall-hook:
2763         rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
2764
2765 INSTALL_EXEC_HOOKS += libudev-install-hook
2766 UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
2767
2768 # ------------------------------------------------------------------------------
2769 noinst_LTLIBRARIES += \
2770         libudev-internal.la
2771
2772 libudev_internal_la_SOURCES =\
2773         $(libudev_la_SOURCES) \
2774         src/libudev/libudev-device-private.c
2775
2776 libudev_internal_la_CFLAGS = \
2777         $(AM_CFLAGS) \
2778         -fvisibility=default
2779
2780 # ------------------------------------------------------------------------------
2781 INSTALL_DIRS += \
2782         $(sysconfdir)/udev/rules.d \
2783         $(sysconfdir)/udev/hwdb.d
2784
2785 dist_network_DATA = \
2786         network/99-default.link \
2787         network/80-container-host0.network \
2788         network/80-container-ve.network
2789
2790 dist_udevrules_DATA += \
2791         rules/42-usb-hid-pm.rules \
2792         rules/50-udev-default.rules \
2793         rules/60-drm.rules \
2794         rules/60-keyboard.rules \
2795         rules/60-persistent-storage-tape.rules \
2796         rules/60-persistent-serial.rules \
2797         rules/60-persistent-input.rules \
2798         rules/60-persistent-alsa.rules \
2799         rules/60-persistent-storage.rules \
2800         rules/64-btrfs.rules \
2801         rules/75-net-description.rules \
2802         rules/75-tty-description.rules \
2803         rules/78-sound-card.rules \
2804         rules/80-net-setup-link.rules \
2805         rules/95-udev-late.rules
2806
2807 nodist_udevrules_DATA += \
2808         rules/99-systemd.rules
2809
2810 dist_udevhwdb_DATA = \
2811         hwdb/20-pci-vendor-model.hwdb \
2812         hwdb/20-pci-classes.hwdb \
2813         hwdb/20-usb-vendor-model.hwdb \
2814         hwdb/20-usb-classes.hwdb \
2815         hwdb/20-sdio-vendor-model.hwdb \
2816         hwdb/20-sdio-classes.hwdb \
2817         hwdb/20-bluetooth-vendor-product.hwdb \
2818         hwdb/20-acpi-vendor.hwdb \
2819         hwdb/20-OUI.hwdb \
2820         hwdb/20-net-ifname.hwdb \
2821         hwdb/60-keyboard.hwdb
2822
2823 udevconfdir = $(sysconfdir)/udev
2824 dist_udevconf_DATA = \
2825         src/udev/udev.conf
2826
2827 sharepkgconfigdir = $(datadir)/pkgconfig
2828 sharepkgconfig_DATA = \
2829         src/udev/udev.pc
2830
2831 EXTRA_DIST += \
2832         rules/99-systemd.rules.in \
2833         src/udev/udev.pc.in
2834
2835 CLEANFILES += \
2836         rules/99-systemd.rules \
2837         src/udev/udev.pc
2838
2839 EXTRA_DIST += \
2840         units/systemd-udevd.service.in \
2841         units/systemd-udev-trigger.service.in \
2842         units/systemd-udev-settle.service.in \
2843         units/systemd-udev-hwdb-update.service.in
2844
2845 CLEANFILES += \
2846         units/systemd-udevd.service \
2847         units/systemd-udev-trigger.service \
2848         units/systemd-udev-settle.service \
2849         units/systemd-udev-hwdb-update.service
2850
2851 SOCKETS_TARGET_WANTS += \
2852         systemd-udevd-control.socket \
2853         systemd-udevd-kernel.socket
2854
2855 SYSINIT_TARGET_WANTS += \
2856         systemd-udevd.service \
2857         systemd-udev-trigger.service \
2858         systemd-udev-hwdb-update.service
2859
2860 rootbin_PROGRAMS += \
2861         udevadm
2862
2863 rootlibexec_PROGRAMS += \
2864         systemd-udevd
2865
2866 noinst_LTLIBRARIES += \
2867         libudev-core.la
2868
2869 src/udev/keyboard-keys.txt:
2870         $(AM_V_at)$(MKDIR_P) $(dir $@)
2871         $(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/' > $@
2872
2873 src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt
2874         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
2875
2876 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
2877         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
2878
2879 src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt
2880         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
2881
2882 libudev_core_la_SOURCES = \
2883         src/udev/udev.h \
2884         src/udev/udev-event.c \
2885         src/udev/udev-watch.c \
2886         src/udev/udev-node.c \
2887         src/udev/udev-rules.c \
2888         src/udev/udev-ctrl.c \
2889         src/udev/udev-builtin.c \
2890         src/udev/udev-builtin-btrfs.c \
2891         src/udev/udev-builtin-hwdb.c \
2892         src/udev/udev-builtin-input_id.c \
2893         src/udev/udev-builtin-keyboard.c \
2894         src/udev/udev-builtin-net_id.c \
2895         src/udev/udev-builtin-net_setup_link.c \
2896         src/udev/udev-builtin-path_id.c \
2897         src/udev/udev-builtin-usb_id.c \
2898         src/udev/net/link-config.h \
2899         src/udev/net/link-config.c \
2900         src/udev/net/ethtool-util.h \
2901         src/udev/net/ethtool-util.c
2902
2903 nodist_libudev_core_la_SOURCES = \
2904         src/udev/keyboard-keys-from-name.h \
2905         src/udev/keyboard-keys-to-name.h \
2906         src/udev/net/link-config-gperf.c
2907
2908 BUILT_SOURCES += \
2909         $(nodist_libudev_core_la_SOURCES)
2910
2911 CLEANFILES += \
2912         src/udev/keyboard-keys-from-name.gperf \
2913         src/udev/keyboard-keys.txt \
2914         src/udev/net/link-config-gperf.c
2915
2916 EXTRA_DIST += \
2917         src/udev/net/link-config-gperf.gperf
2918
2919 libudev_core_la_CFLAGS = \
2920         $(AM_CFLAGS) \
2921         $(BLKID_CFLAGS) \
2922         $(KMOD_CFLAGS)
2923
2924 libudev_core_la_LIBADD = \
2925         libudev-internal.la \
2926         libsystemd-label.la \
2927         libsystemd-internal.la \
2928         libsystemd-network.la \
2929         libsystemd-shared.la \
2930         $(BLKID_LIBS) \
2931         $(KMOD_LIBS)
2932
2933 libudev_core_la_CPPFLAGS = \
2934         $(AM_CPPFLAGS) \
2935         -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
2936
2937 if ENABLE_FIRMWARE
2938 libudev_core_la_SOURCES += \
2939         src/udev/udev-builtin-firmware.c
2940
2941 dist_udevrules_DATA += \
2942         rules/50-firmware.rules
2943 endif
2944
2945 if HAVE_KMOD
2946 libudev_core_la_SOURCES += \
2947         src/udev/udev-builtin-kmod.c
2948
2949 dist_udevrules_DATA += \
2950         rules/80-drivers.rules
2951 endif
2952
2953 if HAVE_BLKID
2954 libudev_core_la_SOURCES += \
2955         src/udev/udev-builtin-blkid.c
2956 endif
2957
2958 if HAVE_ACL
2959 libudev_core_la_SOURCES += \
2960         src/udev/udev-builtin-uaccess.c \
2961         src/login/logind-acl.c \
2962         src/libsystemd/sd-login/sd-login.c \
2963         src/systemd/sd-login.h
2964
2965 libudev_core_la_LIBADD += \
2966         libsystemd-acl.la
2967 endif
2968
2969 systemd_udevd_SOURCES = \
2970         src/udev/udevd.c
2971
2972 systemd_udevd_LDADD = \
2973         libudev-core.la
2974
2975 udevadm_SOURCES = \
2976         src/udev/udevadm.c \
2977         src/udev/udevadm-info.c \
2978         src/udev/udevadm-control.c \
2979         src/udev/udevadm-monitor.c \
2980         src/udev/udevadm-hwdb.c \
2981         src/udev/udevadm-settle.c \
2982         src/udev/udevadm-trigger.c \
2983         src/udev/udevadm-test.c \
2984         src/udev/udevadm-test-builtin.c
2985
2986 udevadm_LDADD = \
2987         libudev-core.la
2988
2989 # Update hwdb on installation. Do not bother if installing
2990 # in DESTDIR, since this is likely for packaging purposes.
2991 hwdb-update-hook:
2992         -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update
2993
2994 INSTALL_DATA_HOOKS += \
2995         hwdb-update-hook
2996
2997 hwdb-remove-hook:
2998         -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
2999
3000 # ------------------------------------------------------------------------------
3001 TESTS += \
3002         test/udev-test.pl \
3003         test/rules-test.sh
3004
3005 manual_tests += \
3006         test-libudev \
3007         test-udev
3008
3009 test_libudev_SOURCES = \
3010         src/test/test-libudev.c
3011
3012 test_libudev_LDADD = \
3013         libsystemd-label.la \
3014         libudev-internal.la \
3015         libsystemd-shared.la
3016
3017 test_udev_SOURCES = \
3018         src/test/test-udev.c
3019
3020 test_udev_LDADD = \
3021         libudev-core.la \
3022         $(BLKID_LIBS) \
3023         $(KMOD_LIBS) \
3024         $(SELINUX_LIBS)
3025
3026 if HAVE_ACL
3027 test_udev_LDADD += \
3028         libsystemd-acl.la
3029 endif
3030
3031 check_DATA += \
3032         test/sys
3033
3034 # packed sysfs test tree
3035 test/sys:
3036         $(AM_V_at)$(MKDIR_P) $(dir $@)
3037         $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
3038
3039 test-sys-distclean:
3040         -rm -rf test/sys
3041 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
3042
3043 EXTRA_DIST += \
3044         test/sys.tar.xz \
3045         test/udev-test.pl \
3046         test/rules-test.sh \
3047         test/rule-syntax-check.py
3048
3049 # ------------------------------------------------------------------------------
3050 ata_id_SOURCES = \
3051         src/udev/ata_id/ata_id.c
3052
3053 ata_id_LDADD = \
3054         libudev-internal.la \
3055         libsystemd-shared.la
3056
3057 udevlibexec_PROGRAMS += \
3058         ata_id
3059
3060 # ------------------------------------------------------------------------------
3061 cdrom_id_SOURCES = \
3062         src/udev/cdrom_id/cdrom_id.c
3063
3064 cdrom_id_LDADD = \
3065         libudev-internal.la \
3066         libsystemd-shared.la
3067
3068 udevlibexec_PROGRAMS += \
3069         cdrom_id
3070
3071 dist_udevrules_DATA += \
3072         rules/60-cdrom_id.rules
3073
3074 # ------------------------------------------------------------------------------
3075 collect_SOURCES = \
3076         src/udev/collect/collect.c
3077
3078 collect_LDADD = \
3079         libudev-internal.la \
3080         libsystemd-shared.la
3081
3082 udevlibexec_PROGRAMS += \
3083         collect
3084
3085 # ------------------------------------------------------------------------------
3086 scsi_id_SOURCES =\
3087         src/udev/scsi_id/scsi_id.c \
3088         src/udev/scsi_id/scsi_serial.c \
3089         src/udev/scsi_id/scsi.h \
3090         src/udev/scsi_id/scsi_id.h
3091
3092 scsi_id_LDADD = \
3093         libudev-internal.la \
3094         libsystemd-shared.la
3095
3096 udevlibexec_PROGRAMS += \
3097         scsi_id
3098
3099 EXTRA_DIST += \
3100         src/udev/scsi_id/README
3101
3102 # ------------------------------------------------------------------------------
3103 v4l_id_SOURCES = \
3104         src/udev/v4l_id/v4l_id.c
3105
3106 v4l_id_LDADD = \
3107         libudev-internal.la
3108
3109 udevlibexec_PROGRAMS += \
3110         v4l_id
3111
3112 dist_udevrules_DATA += \
3113         rules/60-persistent-v4l.rules
3114
3115 # ------------------------------------------------------------------------------
3116 accelerometer_SOURCES = \
3117         src/udev/accelerometer/accelerometer.c
3118
3119 accelerometer_LDADD = \
3120         libudev-internal.la -lm \
3121         libsystemd-shared.la
3122
3123 udevlibexec_PROGRAMS += \
3124         accelerometer
3125
3126 dist_udevrules_DATA += \
3127         rules/61-accelerometer.rules
3128
3129 # ------------------------------------------------------------------------------
3130 if ENABLE_GUDEV
3131 if ENABLE_GTK_DOC
3132 SUBDIRS += \
3133         docs/gudev
3134 endif
3135
3136 libgudev_includedir = \
3137         $(includedir)/gudev-1.0/gudev
3138
3139 libgudev_include_HEADERS = \
3140         src/gudev/gudev.h \
3141         src/gudev/gudevenums.h \
3142         src/gudev/gudevenumtypes.h \
3143         src/gudev/gudevtypes.h \
3144         src/gudev/gudevclient.h \
3145         src/gudev/gudevdevice.h \
3146         src/gudev/gudevenumerator.h
3147
3148 lib_LTLIBRARIES += libgudev-1.0.la
3149
3150 pkgconfiglib_DATA += \
3151         src/gudev/gudev-1.0.pc
3152
3153 CLEANFILES += \
3154         src/gudev/gudev-1.0.pc
3155
3156 libgudev_1_0_la_SOURCES = \
3157         src/gudev/gudevenums.h \
3158         src/gudev/gudevenumtypes.h \
3159         src/gudev/gudevenumtypes.h\
3160         src/gudev/gudevtypes.h \
3161         src/gudev/gudevclient.h \
3162         src/gudev/gudevclient.c \
3163         src/gudev/gudevdevice.h \
3164         src/gudev/gudevdevice.c \
3165         src/gudev/gudevenumerator.h \
3166         src/gudev/gudevenumerator.c \
3167         src/gudev/gudevprivate.h
3168
3169 nodist_libgudev_1_0_la_SOURCES = \
3170         src/gudev/gudevmarshal.h \
3171         src/gudev/gudevmarshal.c \
3172         src/gudev/gudevenumtypes.h \
3173         src/gudev/gudevenumtypes.c
3174
3175 BUILT_SOURCES += \
3176         $(nodist_libgudev_1_0_la_SOURCES)
3177
3178 libgudev_1_0_la_CPPFLAGS = \
3179         $(AM_CPPFLAGS) \
3180         -I$(top_builddir)/src\
3181         -I$(top_srcdir)/src\
3182         -I$(top_builddir)/src/gudev \
3183         -I$(top_srcdir)/src/gudev \
3184         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
3185         -D_GUDEV_COMPILATION \
3186         -DG_LOG_DOMAIN=\"GUdev\"
3187
3188 libgudev_1_0_la_CFLAGS = \
3189         $(AM_CFLAGS) \
3190         -fvisibility=default \
3191         $(GLIB_CFLAGS)
3192
3193 libgudev_1_0_la_LIBADD = \
3194         libudev.la \
3195         $(GLIB_LIBS)
3196
3197 libgudev_1_0_la_LDFLAGS = \
3198         $(AM_LDFLAGS) \
3199         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
3200         -export-dynamic -no-undefined \
3201         -export-symbols-regex '^g_udev_.*'
3202
3203 src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
3204         $(AM_V_at)$(MKDIR_P) $(dir $@)
3205         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
3206
3207 src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
3208         $(AM_V_at)$(MKDIR_P) $(dir $@)
3209         $(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
3210         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
3211
3212 src/gudev/gudevenumtypes.%: src/gudev/gudevenumtypes.%.template src/gudev/gudevenums.h
3213         $(AM_V_at)$(MKDIR_P) $(dir $@)
3214         $(AM_V_GEN)glib-mkenums --template $^ > $@
3215
3216 if HAVE_INTROSPECTION
3217 -include $(INTROSPECTION_MAKEFILE)
3218
3219 src/gudev/GUdev-1.0.gir: libgudev-1.0.la
3220
3221 src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
3222
3223 src_gudev_GUdev_1_0_gir_CFLAGS = \
3224         $(AM_CFLAGS) \
3225         $(INCLUDES) \
3226         -D_GUDEV_COMPILATION \
3227         -D_GUDEV_WORK_AROUND_DEV_T_BUG \
3228         -I$(top_srcdir)/src \
3229         -I$(top_builddir)/src \
3230         -I$(top_srcdir)/src/gudev \
3231         -I$(top_builddir)/src/gudev
3232
3233 src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
3234
3235 src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
3236         --pkg-export=gudev-1.0 \
3237         --warn-all
3238
3239 src_gudev_GUdev_1_0_gir_FILES = \
3240         src/gudev/gudev.h \
3241         src/gudev/gudevtypes.h \
3242         src/gudev/gudevenums.h \
3243         src/gudev/gudevenumtypes.h \
3244         src/gudev/gudevclient.h \
3245         src/gudev/gudevdevice.h \
3246         src/gudev/gudevenumerator.h \
3247         src/gudev/gudevclient.c \
3248         src/gudev/gudevdevice.c \
3249         src/gudev/gudevenumerator.c
3250
3251 INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
3252 INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
3253
3254 girdir = $(datadir)/gir-1.0
3255 gir_DATA = \
3256         src/gudev/GUdev-1.0.gir
3257
3258 typelibsdir = $(libdir)/girepository-1.0
3259 typelibs_DATA = \
3260         src/gudev/GUdev-1.0.typelib
3261
3262 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
3263 endif # HAVE_INTROSPECTION
3264
3265 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
3266 libgudev-install-hook:
3267         libname=libgudev-1.0.so && $(move-to-rootlibdir)
3268
3269 libgudev-uninstall-hook:
3270         rm -f $(DESTDIR)$(rootlibdir)/libgudev-1.0.so*
3271
3272 INSTALL_EXEC_HOOKS += libgudev-install-hook
3273 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-hook
3274 endif
3275
3276 EXTRA_DIST += \
3277         src/gudev/gudev-1.0.pc.in \
3278         src/gudev/gudevmarshal.list \
3279         src/gudev/gudevenumtypes.h.template \
3280         src/gudev/gudevenumtypes.c.template \
3281         src/gudev/gjs-example.js \
3282         src/gudev/seed-example-enum.js \
3283         src/gudev/seed-example.js
3284
3285 # ------------------------------------------------------------------------------
3286 mtd_probe_SOURCES =  \
3287         src/udev/mtd_probe/mtd_probe.c \
3288         src/udev/mtd_probe/mtd_probe.h \
3289         src/udev/mtd_probe/probe_smartmedia.c
3290
3291 dist_udevrules_DATA += \
3292         rules/75-probe_mtd.rules
3293
3294 udevlibexec_PROGRAMS += \
3295         mtd_probe
3296
3297 # ------------------------------------------------------------------------------
3298 test_id128_SOURCES = \
3299         src/test/test-id128.c
3300
3301 test_id128_LDADD = \
3302         libsystemd-internal.la \
3303         libsystemd-shared.la
3304
3305 tests += \
3306         test-id128
3307
3308 # ------------------------------------------------------------------------------
3309
3310 rootlibexec_PROGRAMS += \
3311         systemd-activate
3312
3313 systemd_activate_SOURCES = \
3314         src/activate/activate.c
3315
3316 systemd_activate_LDADD = \
3317         libsystemd-label.la \
3318         libsystemd-internal.la \
3319         libsystemd-shared.la
3320
3321 # ------------------------------------------------------------------------------
3322 systemd_journald_SOURCES = \
3323         src/journal/journald.c \
3324         src/journal/journald-server.h
3325
3326 systemd_journald_LDADD = \
3327         libsystemd-journal-core.la \
3328         libsystemd-internal.la \
3329         libsystemd-shared.la
3330
3331 systemd_cat_SOURCES = \
3332         src/journal/cat.c
3333
3334 systemd_cat_LDADD = \
3335         libsystemd-journal-core.la
3336
3337 if HAVE_MICROHTTPD
3338 rootlibexec_PROGRAMS += \
3339         systemd-journal-remote
3340
3341 systemd_journal_remote_SOURCES = \
3342         src/journal/journal-remote-parse.h \
3343         src/journal/journal-remote-parse.c \
3344         src/journal/journal-remote-write.h \
3345         src/journal/journal-remote-write.c \
3346         src/journal/journal-remote.c
3347
3348 systemd_journal_remote_LDADD = \
3349         libsystemd-internal.la \
3350         libsystemd-journal-core.la
3351
3352 systemd_journal_remote_SOURCES += \
3353         src/journal/microhttpd-util.h \
3354         src/journal/microhttpd-util.c
3355
3356 systemd_journal_remote_CFLAGS = \
3357         $(AM_CFLAGS) \
3358         $(MICROHTTPD_CFLAGS)
3359
3360 systemd_journal_remote_LDADD += \
3361         $(MICROHTTPD_LIBS)
3362
3363 if HAVE_GNUTLS
3364 systemd_journal_remote_LDADD += \
3365         $(GNUTLS_LIBS)
3366 endif
3367 endif
3368
3369 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3370 journalctl_CFLAGS = \
3371         $(AM_CFLAGS)
3372
3373 journalctl_SOURCES = \
3374         src/journal/journalctl.c
3375
3376 journalctl_LDADD = \
3377         libsystemd-journal-internal.la \
3378         libsystemd-internal.la \
3379         libsystemd-logs.la \
3380         libsystemd-shared.la
3381
3382 if HAVE_ACL
3383 journalctl_LDADD += \
3384         libsystemd-acl.la
3385 endif
3386
3387 if HAVE_QRENCODE
3388 journalctl_SOURCES += \
3389         src/journal/journal-qrcode.c \
3390         src/journal/journal-qrcode.h
3391
3392 journalctl_CFLAGS += \
3393         $(QRENCODE_CFLAGS)
3394
3395 journalctl_LDADD += \
3396         $(QRENCODE_LIBS)
3397 endif
3398
3399 test_journal_SOURCES = \
3400         src/journal/test-journal.c
3401
3402 test_journal_LDADD = \
3403         libsystemd-journal-core.la
3404
3405 test_journal_send_SOURCES = \
3406         src/journal/test-journal-send.c
3407
3408 test_journal_send_LDADD = \
3409         libsystemd-journal-core.la
3410
3411 test_journal_syslog_SOURCES = \
3412         src/journal/test-journal-syslog.c
3413
3414 test_journal_syslog_LDADD = \
3415         libsystemd-journal-core.la
3416
3417 test_journal_match_SOURCES = \
3418         src/journal/test-journal-match.c
3419
3420 test_journal_match_LDADD = \
3421         libsystemd-journal-core.la
3422
3423 test_journal_enum_SOURCES = \
3424         src/journal/test-journal-enum.c
3425
3426 test_journal_enum_LDADD = \
3427         libsystemd-journal-core.la
3428
3429 test_journal_stream_SOURCES = \
3430         src/journal/test-journal-stream.c
3431
3432 test_journal_stream_LDADD = \
3433         libsystemd-journal-core.la
3434
3435 test_journal_flush_SOURCES = \
3436         src/journal/test-journal-flush.c
3437
3438 test_journal_flush_LDADD = \
3439         libsystemd-journal-core.la
3440
3441 test_journal_init_SOURCES = \
3442         src/journal/test-journal-init.c
3443
3444 test_journal_init_LDADD = \
3445         libsystemd-journal-core.la
3446
3447 test_journal_verify_SOURCES = \
3448         src/journal/test-journal-verify.c
3449
3450 test_journal_verify_LDADD = \
3451         libsystemd-journal-core.la
3452
3453 test_journal_interleaving_SOURCES = \
3454         src/journal/test-journal-interleaving.c
3455
3456 test_journal_interleaving_LDADD = \
3457         libsystemd-journal-core.la
3458
3459 test_mmap_cache_SOURCES = \
3460         src/journal/test-mmap-cache.c
3461
3462 test_mmap_cache_LDADD = \
3463         libsystemd-journal-core.la
3464
3465 test_catalog_SOURCES = \
3466         src/journal/test-catalog.c
3467
3468 test_catalog_CPPFLAGS = \
3469         $(AM_CPPFLAGS) \
3470         -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
3471
3472 test_catalog_LDADD = \
3473         libsystemd-journal-core.la
3474
3475 libsystemd_journal_core_la_SOURCES = \
3476         src/journal/journald-kmsg.c \
3477         src/journal/journald-kmsg.h \
3478         src/journal/journald-syslog.c \
3479         src/journal/journald-syslog.h \
3480         src/journal/journald-stream.c \
3481         src/journal/journald-stream.h \
3482         src/journal/journald-server.c \
3483         src/journal/journald-server.h \
3484         src/journal/journald-console.c \
3485         src/journal/journald-console.h \
3486         src/journal/journald-wall.c \
3487         src/journal/journald-wall.h \
3488         src/journal/journald-native.c \
3489         src/journal/journald-native.h \
3490         src/journal/journald-rate-limit.c \
3491         src/journal/journald-rate-limit.h \
3492         src/journal/journal-internal.h
3493
3494 nodist_libsystemd_journal_core_la_SOURCES = \
3495         src/journal/journald-gperf.c
3496
3497 libsystemd_journal_core_la_LIBADD = \
3498         libsystemd-journal-internal.la \
3499         libudev-internal.la \
3500         libsystemd-capability.la \
3501         libsystemd-label.la \
3502         libsystemd-internal.la \
3503         libsystemd-shared.la
3504
3505 if HAVE_ACL
3506 libsystemd_journal_core_la_LIBADD += \
3507         libsystemd-acl.la
3508 endif
3509
3510 noinst_LTLIBRARIES += \
3511         libsystemd-journal-core.la
3512
3513 journal-install-hook:
3514         -$(MKDIR_P) $(DESTDIR)/var/log/journal
3515         -chown 0:0 $(DESTDIR)/var/log/journal
3516         -chmod 755 $(DESTDIR)/var/log/journal
3517         -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
3518         -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
3519
3520 journal-uninstall-hook:
3521         -rmdir $(DESTDIR)/var/log/journal/
3522
3523 INSTALL_EXEC_HOOKS += journal-install-hook
3524 UNINSTALL_EXEC_HOOKS += journal-uninstall-hook
3525
3526 # ------------------------------------------------------------------------------
3527 # Update catalog on installation. Do not bother if installing
3528 # in DESTDIR, since this is likely for packaging purposes.
3529 catalog-update-hook:
3530         -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
3531
3532 INSTALL_DATA_HOOKS += \
3533         catalog-update-hook
3534
3535 catalog-remove-hook:
3536         -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
3537
3538 UNINSTALL_DATA_HOOKS += \
3539         catalog-remove-hook
3540
3541 manual_tests += \
3542         test-journal-enum
3543
3544 tests += \
3545         test-journal \
3546         test-journal-send \
3547         test-journal-syslog \
3548         test-journal-match \
3549         test-journal-stream \
3550         test-journal-init \
3551         test-journal-verify \
3552         test-journal-interleaving \
3553         test-journal-flush \
3554         test-mmap-cache \
3555         test-catalog
3556
3557 pkginclude_HEADERS += \
3558         src/systemd/sd-journal.h \
3559         src/systemd/sd-messages.h \
3560         src/systemd/_sd-common.h
3561
3562 libsystemd_journal_internal_la_SOURCES = \
3563         src/journal/sd-journal.c \
3564         src/systemd/sd-journal.h \
3565         src/systemd/_sd-common.h \
3566         src/journal/journal-file.c \
3567         src/journal/journal-file.h \
3568         src/journal/journal-vacuum.c \
3569         src/journal/journal-vacuum.h \
3570         src/journal/journal-verify.c \
3571         src/journal/journal-verify.h \
3572         src/journal/lookup3.c \
3573         src/journal/lookup3.h \
3574         src/journal/journal-send.c \
3575         src/journal/journal-def.h \
3576         src/journal/compress.h \
3577         src/journal/catalog.c \
3578         src/journal/catalog.h \
3579         src/journal/mmap-cache.c \
3580         src/journal/mmap-cache.h
3581
3582 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3583 libsystemd_journal_internal_la_CFLAGS = \
3584         $(AM_CFLAGS)
3585
3586 libsystemd_journal_internal_la_LIBADD =
3587
3588 if HAVE_XZ
3589 libsystemd_journal_internal_la_SOURCES += \
3590         src/journal/compress.c
3591
3592 libsystemd_journal_internal_la_CFLAGS += \
3593         $(XZ_CFLAGS)
3594
3595 libsystemd_journal_internal_la_LIBADD += \
3596         $(XZ_LIBS)
3597 endif
3598
3599 if HAVE_GCRYPT
3600 libsystemd_journal_internal_la_SOURCES += \
3601         src/journal/journal-authenticate.c \
3602         src/journal/journal-authenticate.h \
3603         src/journal/fsprg.c \
3604         src/journal/fsprg.h
3605
3606 libsystemd_journal_internal_la_LIBADD += \
3607         $(GCRYPT_LIBS)
3608
3609 # fsprg.c is a drop-in file using void pointer arithmetic
3610 libsystemd_journal_internal_la_CFLAGS += \
3611         $(GCRYPT_CFLAGS) \
3612         -Wno-pointer-arith
3613 endif
3614
3615 noinst_LTLIBRARIES += \
3616         libsystemd-journal-internal.la
3617
3618 rootlibexec_PROGRAMS += \
3619         systemd-journald
3620
3621 rootbin_PROGRAMS += \
3622         journalctl
3623
3624 bin_PROGRAMS += \
3625         systemd-cat
3626
3627 dist_systemunit_DATA += \
3628         units/systemd-journald.socket \
3629         units/systemd-journald-dev-log.socket
3630
3631 nodist_systemunit_DATA += \
3632         units/systemd-journald.service \
3633         units/systemd-journal-flush.service \
3634         units/systemd-journal-catalog-update.service
3635
3636 dist_pkgsysconf_DATA += \
3637         src/journal/journald.conf
3638
3639 dist_catalog_DATA = \
3640         catalog/systemd.fr.catalog \
3641         catalog/systemd.ru.catalog \
3642         catalog/systemd.it.catalog \
3643         catalog/systemd.catalog
3644
3645 SOCKETS_TARGET_WANTS += \
3646         systemd-journald.socket \
3647         systemd-journald-dev-log.socket
3648
3649 SYSINIT_TARGET_WANTS += \
3650         systemd-journald.service \
3651         systemd-journal-flush.service \
3652         systemd-journal-catalog-update.service
3653
3654 EXTRA_DIST += \
3655         units/systemd-journald.service.in \
3656         units/systemd-journal-flush.service.in \
3657         units/systemd-journal-catalog-update.service.in \
3658         src/journal/journald-gperf.gperf
3659
3660 CLEANFILES += \
3661         src/journal/journald-gperf.c
3662
3663 # ------------------------------------------------------------------------------
3664 if HAVE_MICROHTTPD
3665 gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
3666
3667 rootlibexec_PROGRAMS += \
3668         systemd-journal-gatewayd
3669
3670 systemd_journal_gatewayd_SOURCES = \
3671         src/journal/journal-gatewayd.c \
3672         src/journal/microhttpd-util.h \
3673         src/journal/microhttpd-util.c
3674
3675 systemd_journal_gatewayd_LDADD = \
3676         libsystemd-logs.la \
3677         libsystemd-journal-internal.la \
3678         libsystemd-internal.la \
3679         libsystemd-shared.la \
3680         $(MICROHTTPD_LIBS)
3681
3682 if HAVE_GNUTLS
3683 systemd_journal_gatewayd_LDADD += \
3684         $(GNUTLS_LIBS)
3685 endif
3686
3687 systemd_journal_gatewayd_CFLAGS = \
3688         $(AM_CFLAGS) \
3689         $(MICROHTTPD_CFLAGS)
3690
3691 systemd_journal_gatewayd_CPPFLAGS = \
3692         $(AM_CPPFLAGS) \
3693         -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
3694
3695 dist_systemunit_DATA += \
3696         units/systemd-journal-gatewayd.socket
3697
3698 nodist_systemunit_DATA += \
3699         units/systemd-journal-gatewayd.service
3700
3701 dist_gatewayddocumentroot_DATA = \
3702         src/journal/browse.html
3703
3704 endif
3705
3706 EXTRA_DIST += \
3707         units/systemd-journal-gatewayd.service.in
3708
3709 # ------------------------------------------------------------------------------
3710
3711 systemd_socket_proxyd_SOURCES = \
3712         src/socket-proxy/socket-proxyd.c
3713
3714 systemd_socket_proxyd_LDADD = \
3715         libsystemd-logs.la \
3716         libsystemd-internal.la \
3717         libsystemd-journal-internal.la \
3718         libsystemd-shared.la \
3719         libsystemd-resolve.la
3720
3721 # ------------------------------------------------------------------------------
3722 if ENABLE_COREDUMP
3723 systemd_coredump_SOURCES = \
3724         src/journal/coredump.c
3725
3726 systemd_coredump_LDADD = \
3727         libsystemd-journal-internal.la \
3728         libsystemd-label.la \
3729         libsystemd-internal.la \
3730         libsystemd-shared.la
3731
3732 if HAVE_ELFUTILS
3733 systemd_coredump_SOURCES += \
3734         src/journal/stacktrace.c \
3735         src/journal/stacktrace.h
3736
3737 systemd_coredump_LDADD += \
3738         $(ELFUTILS_LIBS)
3739 endif
3740
3741 rootlibexec_PROGRAMS += \
3742         systemd-coredump
3743
3744 dist_pkgsysconf_DATA += \
3745         src/journal/coredump.conf
3746
3747 if HAVE_ACL
3748 systemd_coredump_LDADD += \
3749         libsystemd-acl.la
3750 endif
3751
3752 coredumpctl_SOURCES = \
3753         src/journal/coredumpctl.c
3754
3755 coredumpctl_LDADD = \
3756         libsystemd-journal-internal.la \
3757         libsystemd-internal.la \
3758         libsystemd-shared.la
3759
3760 bin_PROGRAMS += \
3761         coredumpctl
3762
3763 dist_bashcompletion_DATA += \
3764         shell-completion/bash/coredumpctl
3765
3766 dist_zshcompletion_DATA += \
3767         shell-completion/zsh/_coredumpctl
3768
3769 sysctl_DATA = \
3770         sysctl.d/50-coredump.conf
3771
3772 CLEANFILES += \
3773         sysctl.d/50-coredump.conf
3774 endif
3775
3776 EXTRA_DIST += \
3777         sysctl.d/50-coredump.conf.in
3778
3779 # ------------------------------------------------------------------------------
3780 if ENABLE_BINFMT
3781 systemd_binfmt_SOURCES = \
3782         src/binfmt/binfmt.c
3783
3784 systemd_binfmt_LDADD = \
3785         libsystemd-shared.la
3786
3787 rootlibexec_PROGRAMS += \
3788         systemd-binfmt
3789
3790 dist_systemunit_DATA += \
3791         units/proc-sys-fs-binfmt_misc.automount \
3792         units/proc-sys-fs-binfmt_misc.mount
3793
3794 nodist_systemunit_DATA += \
3795         units/systemd-binfmt.service
3796
3797 INSTALL_DIRS += \
3798         $(prefix)/lib/binfmt.d \
3799         $(sysconfdir)/binfmt.d
3800
3801 SYSINIT_TARGET_WANTS += \
3802         systemd-binfmt.service \
3803         proc-sys-fs-binfmt_misc.automount
3804
3805 endif
3806
3807 EXTRA_DIST += \
3808         units/systemd-binfmt.service.in
3809
3810 # ------------------------------------------------------------------------------
3811 if ENABLE_VCONSOLE
3812 systemd_vconsole_setup_SOURCES = \
3813         src/vconsole/vconsole-setup.c
3814
3815 systemd_vconsole_setup_LDADD = \
3816         libsystemd-shared.la
3817
3818 rootlibexec_PROGRAMS += \
3819         systemd-vconsole-setup
3820
3821 nodist_systemunit_DATA += \
3822         units/systemd-vconsole-setup.service
3823
3824 SYSINIT_TARGET_WANTS += \
3825         systemd-vconsole-setup.service
3826 endif
3827
3828 EXTRA_DIST += \
3829         units/systemd-vconsole-setup.service.in
3830
3831 # ------------------------------------------------------------------------------
3832 if ENABLE_READAHEAD
3833 systemd_readahead_SOURCES = \
3834         src/readahead/readahead.c \
3835         src/readahead/readahead-collect.c \
3836         src/readahead/readahead-replay.c \
3837         src/readahead/readahead-analyze.c \
3838         src/readahead/readahead-common.c \
3839         src/readahead/readahead-common.h
3840
3841 systemd_readahead_LDADD = \
3842         libsystemd-internal.la \
3843         libudev-internal.la \
3844         libsystemd-shared.la
3845
3846 dist_doc_DATA += \
3847         src/readahead/sd-readahead.c \
3848         src/systemd/sd-readahead.h
3849
3850 rootlibexec_PROGRAMS += \
3851         systemd-readahead
3852
3853 dist_systemunit_DATA += \
3854         units/systemd-readahead-drop.service \
3855         units/systemd-readahead-done.timer
3856
3857 nodist_systemunit_DATA += \
3858         units/systemd-readahead-collect.service \
3859         units/systemd-readahead-replay.service \
3860         units/systemd-readahead-done.service
3861
3862 manual_tests += \
3863         test-ssd
3864
3865 test_ssd_SOURCES = \
3866         src/readahead/test-ssd.c \
3867         src/readahead/readahead-common.c \
3868         src/readahead/readahead-common.h
3869
3870 test_ssd_LDADD = \
3871         libsystemd-internal.la \
3872         libudev-internal.la \
3873         libsystemd-shared.la
3874
3875 endif
3876
3877 EXTRA_DIST += \
3878         units/systemd-readahead-collect.service.in \
3879         units/systemd-readahead-replay.service.in \
3880         units/systemd-readahead-done.service.in
3881
3882 # ------------------------------------------------------------------------------
3883 if ENABLE_BOOTCHART
3884 systemd_bootchart_SOURCES = \
3885         src/bootchart/bootchart.c \
3886         src/bootchart/bootchart.h \
3887         src/bootchart/store.c \
3888         src/bootchart/store.h \
3889         src/bootchart/svg.c \
3890         src/bootchart/svg.h
3891
3892 systemd_bootchart_LDADD = \
3893         libsystemd-journal-internal.la \
3894         libsystemd-shared.la
3895
3896 rootlibexec_PROGRAMS += \
3897         systemd-bootchart
3898
3899 dist_pkgsysconf_DATA += \
3900         src/bootchart/bootchart.conf
3901 endif
3902
3903 # ------------------------------------------------------------------------------
3904 if ENABLE_QUOTACHECK
3905 rootlibexec_PROGRAMS += \
3906         systemd-quotacheck
3907
3908 nodist_systemunit_DATA += \
3909         units/systemd-quotacheck.service
3910
3911 systemd_quotacheck_SOURCES = \
3912         src/quotacheck/quotacheck.c
3913
3914 systemd_quotacheck_LDADD = \
3915         libsystemd-shared.la
3916 endif
3917
3918 EXTRA_DIST += \
3919         units/systemd-quotacheck.service.in
3920
3921 nodist_systemunit_DATA += \
3922         units/quotaon.service
3923
3924 # ------------------------------------------------------------------------------
3925 if ENABLE_RANDOMSEED
3926 rootlibexec_PROGRAMS += \
3927         systemd-random-seed
3928
3929 nodist_systemunit_DATA += \
3930         units/systemd-random-seed.service
3931
3932 systemd_random_seed_SOURCES = \
3933         src/random-seed/random-seed.c
3934
3935 systemd_random_seed_LDADD = \
3936         libsystemd-label.la \
3937         libsystemd-shared.la
3938
3939 SYSINIT_TARGET_WANTS += \
3940         systemd-random-seed.service
3941
3942 endif
3943
3944 EXTRA_DIST += \
3945         units/systemd-random-seed.service.in
3946
3947 # ------------------------------------------------------------------------------
3948 if ENABLE_BACKLIGHT
3949 rootlibexec_PROGRAMS += \
3950         systemd-backlight
3951
3952 nodist_systemunit_DATA += \
3953         units/systemd-backlight@.service
3954
3955 systemd_backlight_SOURCES = \
3956         src/backlight/backlight.c
3957
3958 systemd_backlight_LDADD = \
3959         libsystemd-label.la \
3960         libudev-internal.la \
3961         libsystemd-shared.la
3962 endif
3963
3964 EXTRA_DIST += \
3965         units/systemd-backlight@.service.in
3966
3967 # ------------------------------------------------------------------------------
3968 if ENABLE_RFKILL
3969 rootlibexec_PROGRAMS += \
3970         systemd-rfkill
3971
3972 nodist_systemunit_DATA += \
3973         units/systemd-rfkill@.service
3974
3975 systemd_rfkill_SOURCES = \
3976         src/rfkill/rfkill.c
3977
3978 systemd_rfkill_LDADD = \
3979         libsystemd-label.la \
3980         libudev-internal.la \
3981         libsystemd-shared.la
3982 endif
3983
3984 EXTRA_DIST += \
3985         units/systemd-rfkill@.service.in
3986
3987 # ------------------------------------------------------------------------------
3988 if HAVE_LIBCRYPTSETUP
3989 rootlibexec_PROGRAMS += \
3990         systemd-cryptsetup
3991
3992 systemgenerator_PROGRAMS += \
3993         systemd-cryptsetup-generator
3994
3995 dist_systemunit_DATA += \
3996         units/cryptsetup.target \
3997         units/cryptsetup-pre.target
3998
3999 systemd_cryptsetup_SOURCES = \
4000         src/cryptsetup/cryptsetup.c
4001
4002 systemd_cryptsetup_CFLAGS = \
4003         $(AM_CFLAGS) \
4004         $(LIBCRYPTSETUP_CFLAGS)
4005
4006 systemd_cryptsetup_LDADD = \
4007         libsystemd-label.la \
4008         libudev-internal.la \
4009         libsystemd-shared.la \
4010         $(LIBCRYPTSETUP_LIBS)
4011
4012 systemd_cryptsetup_generator_SOURCES = \
4013         src/cryptsetup/cryptsetup-generator.c
4014
4015 systemd_cryptsetup_generator_LDADD = \
4016         libsystemd-label.la \
4017         libsystemd-shared.la
4018
4019 SYSINIT_TARGET_WANTS += \
4020         cryptsetup.target
4021
4022 endif
4023
4024 # ------------------------------------------------------------------------------
4025 if ENABLE_HOSTNAMED
4026 systemd_hostnamed_SOURCES = \
4027         src/hostname/hostnamed.c
4028
4029 systemd_hostnamed_LDADD = \
4030         libsystemd-label.la \
4031         libsystemd-internal.la \
4032         libsystemd-shared.la
4033
4034 rootlibexec_PROGRAMS += \
4035         systemd-hostnamed
4036
4037 nodist_systemunit_DATA += \
4038         units/systemd-hostnamed.service
4039
4040 dist_systemunit_DATA += \
4041         units/org.freedesktop.hostname1.busname
4042
4043 dist_dbuspolicy_DATA += \
4044         src/hostname/org.freedesktop.hostname1.conf
4045
4046 dist_dbussystemservice_DATA += \
4047         src/hostname/org.freedesktop.hostname1.service
4048
4049 polkitpolicy_files += \
4050         src/hostname/org.freedesktop.hostname1.policy
4051
4052 SYSTEM_UNIT_ALIASES += \
4053         systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
4054
4055 BUSNAMES_TARGET_WANTS += \
4056         org.freedesktop.hostname1.busname
4057
4058 hostnamectl_SOURCES = \
4059         src/hostname/hostnamectl.c
4060
4061 hostnamectl_LDADD = \
4062         libsystemd-internal.la \
4063         libsystemd-shared.la
4064
4065 bin_PROGRAMS += \
4066         hostnamectl
4067
4068 dist_bashcompletion_DATA += \
4069         shell-completion/bash/hostnamectl
4070
4071 dist_zshcompletion_DATA += \
4072         shell-completion/zsh/_hostnamectl
4073
4074 endif
4075
4076 polkitpolicy_in_files += \
4077         src/hostname/org.freedesktop.hostname1.policy.in
4078
4079 EXTRA_DIST += \
4080         units/systemd-hostnamed.service.in
4081
4082 # ------------------------------------------------------------------------------
4083 if ENABLE_KDBUS
4084 dist_systemunit_DATA += \
4085         units/org.freedesktop.systemd1.busname
4086
4087 BUSNAMES_TARGET_WANTS += \
4088         org.freedesktop.systemd1.busname
4089 endif
4090
4091 # ------------------------------------------------------------------------------
4092 if ENABLE_LOCALED
4093 systemd_localed_SOURCES = \
4094         src/locale/localed.c
4095
4096 systemd_localed_LDADD = \
4097         libsystemd-label.la \
4098         libsystemd-internal.la \
4099         libsystemd-shared.la
4100
4101 nodist_systemunit_DATA += \
4102         units/systemd-localed.service
4103
4104 dist_systemunit_DATA += \
4105         units/org.freedesktop.locale1.busname
4106
4107 rootlibexec_PROGRAMS += \
4108         systemd-localed
4109
4110 dist_dbuspolicy_DATA += \
4111         src/locale/org.freedesktop.locale1.conf
4112
4113 dist_dbussystemservice_DATA += \
4114         src/locale/org.freedesktop.locale1.service
4115
4116 polkitpolicy_files += \
4117         src/locale/org.freedesktop.locale1.policy
4118
4119 SYSTEM_UNIT_ALIASES += \
4120         systemd-localed.service dbus-org.freedesktop.locale1.service
4121
4122 BUSNAMES_TARGET_WANTS += \
4123         org.freedesktop.locale1.busname
4124
4125 dist_pkgdata_DATA += \
4126         src/locale/kbd-model-map
4127
4128 dist_noinst_SCRIPT = \
4129         src/locale/generate-kbd-model-map
4130
4131 update-kbd-model-map: src/locale/generate-kbd-model-map
4132         $PYTHON $< >src/locale/kbd-model-map
4133
4134 localectl_SOURCES = \
4135         src/locale/localectl.c
4136
4137 localectl_LDADD = \
4138         libsystemd-internal.la \
4139         libsystemd-shared.la
4140
4141 bin_PROGRAMS += \
4142         localectl
4143
4144 dist_bashcompletion_DATA += \
4145         shell-completion/bash/localectl
4146
4147 dist_zshcompletion_DATA += \
4148         shell-completion/zsh/_localectl
4149
4150 endif
4151
4152 .PHONY: update-kbd-model-map
4153
4154 polkitpolicy_in_files += \
4155         src/locale/org.freedesktop.locale1.policy.in
4156
4157 EXTRA_DIST += \
4158         units/systemd-localed.service.in
4159
4160 # ------------------------------------------------------------------------------
4161 if ENABLE_TIMEDATED
4162 systemd_timedated_SOURCES = \
4163         src/timedate/timedated.c
4164
4165 systemd_timedated_LDADD = \
4166         libsystemd-label.la \
4167         libsystemd-internal.la \
4168         libsystemd-shared.la
4169
4170 rootlibexec_PROGRAMS += \
4171         systemd-timedated
4172
4173 dist_dbussystemservice_DATA += \
4174         src/timedate/org.freedesktop.timedate1.service
4175
4176 dist_dbuspolicy_DATA += \
4177         src/timedate/org.freedesktop.timedate1.conf
4178
4179 nodist_systemunit_DATA += \
4180         units/systemd-timedated.service
4181
4182 dist_systemunit_DATA += \
4183         units/org.freedesktop.timedate1.busname
4184
4185 polkitpolicy_files += \
4186         src/timedate/org.freedesktop.timedate1.policy
4187
4188 INSTALL_DIRS += \
4189         $(prefix)/lib/systemd/ntp-units.d \
4190         $(sysconfdir)/systemd/ntp-units.d
4191
4192 SYSTEM_UNIT_ALIASES += \
4193         systemd-timedated.service dbus-org.freedesktop.timedate1.service
4194
4195 BUSNAMES_TARGET_WANTS += \
4196         org.freedesktop.timedate1.busname
4197
4198 timedatectl_SOURCES = \
4199         src/timedate/timedatectl.c
4200
4201 timedatectl_LDADD = \
4202         libsystemd-internal.la \
4203         libsystemd-shared.la
4204
4205 bin_PROGRAMS += \
4206         timedatectl
4207
4208 dist_bashcompletion_DATA += \
4209         shell-completion/bash/timedatectl
4210
4211 dist_zshcompletion_DATA += \
4212         shell-completion/zsh/_timedatectl
4213 endif
4214
4215 polkitpolicy_in_files += \
4216         src/timedate/org.freedesktop.timedate1.policy.in
4217
4218 EXTRA_DIST += \
4219         units/systemd-timedated.service.in
4220
4221 # ------------------------------------------------------------------------------
4222 if ENABLE_TIMESYNCD
4223 systemd_timesyncd_SOURCES = \
4224         src/timesync/timesyncd.c \
4225         src/timesync/timesyncd.h
4226
4227 nodist_systemd_timesyncd_SOURCES = \
4228         src/timesync/timesyncd-gperf.c
4229
4230 EXTRA_DIST += \
4231         src/timesync/timesyncd-gperf.gperf
4232
4233 CLEANFILES += \
4234         src/timesync/timesyncd-gperf.c
4235
4236 systemd_timesyncd_LDADD = \
4237         libsystemd-resolve.la \
4238         libsystemd-network.la \
4239         libsystemd-label.la \
4240         libsystemd-capability.la \
4241         libsystemd-internal.la \
4242         libsystemd-shared.la \
4243         -lm
4244
4245 rootlibexec_PROGRAMS += \
4246         systemd-timesyncd
4247
4248 nodist_systemunit_DATA += \
4249         units/systemd-timesyncd.service
4250
4251 EXTRA_DIST += \
4252         units/systemd-timesyncd.service.in
4253
4254 nodist_pkgsysconf_DATA += \
4255         src/timesync/timesyncd.conf
4256
4257 EXTRA_DIST += \
4258         src/timesync/timesyncd.conf.in
4259
4260 CLEANFILES += \
4261         src/timesync/timesyncd.conf
4262
4263 dist_ntpunits_DATA = \
4264         src/timesync/90-systemd.list
4265
4266 endif
4267
4268 # ------------------------------------------------------------------------------
4269 if HAVE_MYHOSTNAME
4270 libnss_myhostname_la_SOURCES = \
4271         src/nss-myhostname/nss-myhostname.c \
4272         src/nss-myhostname/ifconf.h \
4273         src/nss-myhostname/netlink.c
4274
4275 libnss_myhostname_la_LDFLAGS = \
4276         $(AM_LDFLAGS) \
4277         -module \
4278         -export-dynamic \
4279         -avoid-version \
4280         -shared \
4281         -shrext .so.2
4282
4283 libnss_myhostname_la_LIBADD = \
4284         libsystemd-shared.la \
4285         libsystemd-internal.la
4286
4287 lib_LTLIBRARIES += \
4288         libnss_myhostname.la
4289 endif
4290
4291 # ------------------------------------------------------------------------------
4292 if ENABLE_MACHINED
4293 systemd_machined_SOURCES = \
4294         src/machine/machined.c \
4295         src/machine/machined.h
4296
4297 systemd_machined_LDADD = \
4298         libsystemd-machine-core.la
4299
4300 rootlibexec_PROGRAMS += \
4301         systemd-machined
4302
4303 libsystemd_machine_core_la_SOURCES = \
4304         src/machine/machined-dbus.c \
4305         src/machine/machine.c \
4306         src/machine/machine.h \
4307         src/machine/machine-dbus.c
4308
4309 libsystemd_machine_core_la_LIBADD = \
4310         libsystemd-label.la \
4311         libsystemd-internal.la \
4312         libudev-internal.la \
4313         libsystemd-shared.la
4314
4315 noinst_LTLIBRARIES += \
4316         libsystemd-machine-core.la
4317
4318 machinectl_SOURCES = \
4319         src/machine/machinectl.c
4320
4321 machinectl_LDADD = \
4322         libsystemd-internal.la \
4323         libsystemd-shared.la
4324
4325 rootbin_PROGRAMS += \
4326         machinectl
4327
4328 dist_bashcompletion_DATA += \
4329         shell-completion/bash/machinectl
4330
4331 test_machine_tables_SOURCES = \
4332         src/machine/test-machine-tables.c
4333
4334 test_machine_tables_LDADD = \
4335         libsystemd-machine-core.la
4336
4337 tests += \
4338         test-machine-tables
4339
4340 nodist_systemunit_DATA += \
4341         units/systemd-machined.service
4342
4343 dist_systemunit_DATA += \
4344         units/machine.slice \
4345         units/org.freedesktop.machine1.busname
4346
4347 dist_dbussystemservice_DATA += \
4348         src/machine/org.freedesktop.machine1.service
4349
4350 dist_dbuspolicy_DATA += \
4351         src/machine/org.freedesktop.machine1.conf
4352
4353 dist_zshcompletion_DATA += \
4354         shell-completion/zsh/_machinectl \
4355         shell-completion/zsh/_sd_machines
4356
4357 SYSTEM_UNIT_ALIASES += \
4358         systemd-machined.service dbus-org.freedesktop.machine1.service
4359
4360 BUSNAMES_TARGET_WANTS += \
4361         org.freedesktop.machine1.busname
4362
4363 EXTRA_DIST += \
4364         units/systemd-machined.service.in
4365
4366 endif
4367
4368 # ------------------------------------------------------------------------------
4369 if ENABLE_RESOLVED
4370 systemd_resolved_SOURCES = \
4371         src/resolve/resolved.h \
4372         src/resolve/resolved.c \
4373         src/resolve/resolved-manager.c
4374
4375 systemd_resolved_CFLAGS = \
4376         $(AM_CFLAGS) \
4377         $(KMOD_CFLAGS)
4378
4379 nodist_systemd_resolved_SOURCES = \
4380         src/resolve/resolved-gperf.c
4381
4382 EXTRA_DIST += \
4383         src/resolve/resolved-gperf.gperf
4384
4385 CLEANFILES += \
4386         src/resolve/resolved-gperf.c
4387
4388 systemd_resolved_LDADD = \
4389         libsystemd-capability.la \
4390         libsystemd-network.la \
4391         libsystemd-label.la \
4392         libsystemd-internal.la \
4393         libsystemd-shared.la
4394
4395 rootlibexec_PROGRAMS += \
4396         systemd-resolved
4397
4398 nodist_systemunit_DATA += \
4399         units/systemd-resolved.service
4400
4401 EXTRA_DIST += \
4402         units/systemd-resolved.service.in
4403
4404 GENERAL_ALIASES += \
4405         $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service
4406
4407 nodist_pkgsysconf_DATA += \
4408         src/resolve/resolved.conf
4409
4410 EXTRA_DIST += \
4411         src/resolve/resolved.conf.in
4412
4413 CLEANFILES += \
4414         src/resolve/resolved.conf
4415
4416 endif
4417
4418 # ------------------------------------------------------------------------------
4419 if ENABLE_NETWORKD
4420 rootlibexec_PROGRAMS += \
4421         systemd-networkd
4422
4423 systemd_networkd_SOURCES = \
4424         src/network/networkd.c
4425
4426 systemd_networkd_LDADD = \
4427         libsystemd-networkd-core.la \
4428         libsystemd-capability.la
4429
4430 noinst_LTLIBRARIES += \
4431         libsystemd-networkd-core.la
4432
4433 libsystemd_networkd_core_la_CFLAGS = \
4434         $(AM_CFLAGS)
4435
4436 libsystemd_networkd_core_la_SOURCES = \
4437         src/libsystemd-network/network-internal.h \
4438         src/network/networkd.h \
4439         src/network/networkd-link.c \
4440         src/network/networkd-netdev.c \
4441         src/network/networkd-tunnel.c \
4442         src/network/networkd-veth.c \
4443         src/network/networkd-vxlan.c \
4444         src/network/networkd-network.c \
4445         src/network/networkd-address.c \
4446         src/network/networkd-route.c \
4447         src/network/networkd-manager.c \
4448         src/network/networkd-address-pool.c
4449
4450 nodist_libsystemd_networkd_core_la_SOURCES = \
4451         src/network/networkd-network-gperf.c \
4452         src/network/networkd-netdev-gperf.c
4453
4454 libsystemd_networkd_core_la_LIBADD = \
4455         libudev-internal.la \
4456         libsystemd-internal.la \
4457         libsystemd-network.la \
4458         libsystemd-label.la \
4459         libsystemd-shared.la
4460
4461 rootlibexec_PROGRAMS += \
4462         systemd-networkd-wait-online
4463
4464 systemd_networkd_wait_online_CFLAGS = \
4465         $(AM_CFLAGS)
4466
4467 systemd_networkd_wait_online_SOURCES = \
4468         src/libsystemd-network/network-internal.h \
4469         src/network/networkd-wait-online.c \
4470         src/network/networkd-wait-online.h
4471
4472 systemd_networkd_wait_online_LDADD = \
4473         libsystemd-network.la \
4474         libudev-internal.la \
4475         libsystemd-internal.la \
4476         libsystemd-shared.la
4477
4478 test_network_SOURCES = \
4479         src/network/test-network.c
4480
4481 test_network_CFLAGS = \
4482         $(AM_CFLAGS)
4483
4484 test_network_LDADD = \
4485         libsystemd-networkd-core.la
4486
4487 tests += \
4488         test-network
4489
4490 nodist_systemunit_DATA += \
4491         units/systemd-networkd.service \
4492         units/systemd-networkd-wait-online.service
4493
4494 GENERAL_ALIASES += \
4495         $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \
4496         $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service
4497
4498 EXTRA_DIST += \
4499         src/network/networkd-network-gperf.gperf \
4500         src/network/networkd-netdev-gperf.gperf \
4501         units/systemd-networkd.service.in \
4502         units/systemd-networkd-wait-online.service.in
4503
4504 CLEANFILES += \
4505         src/network/networkd-network-gperf.c \
4506         src/network/networkd-netdev-gperf.c
4507 endif
4508
4509 # ------------------------------------------------------------------------------
4510 if ENABLE_LOGIND
4511 systemd_logind_SOURCES = \
4512         src/login/logind.c \
4513         src/login/logind.h
4514
4515 nodist_systemd_logind_SOURCES = \
4516         src/login/logind-gperf.c
4517
4518 systemd_logind_LDADD = \
4519         libsystemd-logind-core.la
4520
4521 libsystemd_logind_core_la_SOURCES = \
4522         src/login/logind-core.c \
4523         src/login/logind-device.c \
4524         src/login/logind-device.h \
4525         src/login/logind-button.c \
4526         src/login/logind-button.h \
4527         src/login/logind-action.c \
4528         src/login/logind-action.h \
4529         src/login/logind-seat.c \
4530         src/login/logind-seat.h \
4531         src/login/logind-session.c \
4532         src/login/logind-session.h \
4533         src/login/logind-session-device.c \
4534         src/login/logind-session-device.h \
4535         src/login/logind-user.c \
4536         src/login/logind-user.h \
4537         src/login/logind-inhibit.c \
4538         src/login/logind-inhibit.h \
4539         src/login/logind-dbus.c \
4540         src/login/logind-session-dbus.c \
4541         src/login/logind-seat-dbus.c \
4542         src/login/logind-user-dbus.c \
4543         src/login/logind-acl.h
4544
4545 libsystemd_logind_core_la_LIBADD = \
4546         libsystemd-label.la \
4547         libsystemd-capability.la \
4548         libsystemd-internal.la \
4549         libudev-internal.la \
4550         libsystemd-shared.la
4551
4552 if HAVE_ACL
4553 libsystemd_logind_core_la_SOURCES += \
4554         src/login/logind-acl.c
4555
4556 libsystemd_logind_core_la_LIBADD += \
4557         libsystemd-acl.la
4558 endif
4559
4560 noinst_LTLIBRARIES += \
4561         libsystemd-logind-core.la
4562
4563 systemd_user_sessions_SOURCES = \
4564         src/login/user-sessions.c
4565
4566 systemd_user_sessions_LDADD = \
4567         libsystemd-shared.la
4568
4569 rootlibexec_PROGRAMS += \
4570         systemd-logind \
4571         systemd-user-sessions
4572
4573 loginctl_SOURCES = \
4574         src/login/loginctl.c \
4575         src/login/sysfs-show.c
4576
4577 loginctl_LDADD = \
4578         libsystemd-internal.la \
4579         libudev-internal.la \
4580         libsystemd-shared.la
4581
4582 rootbin_PROGRAMS += \
4583         loginctl
4584
4585 dist_bashcompletion_DATA += \
4586         shell-completion/bash/loginctl
4587
4588 dist_zshcompletion_DATA += \
4589         shell-completion/zsh/_loginctl \
4590         shell-completion/zsh/_systemd-inhibit
4591
4592 systemd_inhibit_SOURCES = \
4593         src/login/inhibit.c
4594
4595 systemd_inhibit_LDADD = \
4596         libsystemd-internal.la \
4597         libsystemd-shared.la
4598
4599 rootbin_PROGRAMS += \
4600         systemd-inhibit
4601
4602 test_login_SOURCES = \
4603         src/libsystemd/sd-login/test-login.c
4604
4605 test_login_LDADD = \
4606         libsystemd-internal.la \
4607         libsystemd-shared.la
4608
4609 test_login_shared_SOURCES = \
4610         src/login/test-login-shared.c
4611
4612 test_login_shared_LDADD = \
4613         libsystemd-internal.la \
4614         libsystemd-shared.la
4615
4616 test_inhibit_SOURCES = \
4617         src/login/test-inhibit.c
4618
4619 test_inhibit_LDADD = \
4620         libsystemd-internal.la \
4621         libsystemd-shared.la
4622
4623 test_login_tables_SOURCES = \
4624         src/login/test-login-tables.c
4625
4626 test_login_tables_LDADD = \
4627         libsystemd-logind-core.la
4628
4629 manual_tests += \
4630         test-login \
4631         test-inhibit
4632
4633 tests += \
4634         test-login-tables \
4635         test-login-shared
4636
4637 if HAVE_PAM
4638 pam_systemd_la_SOURCES = \
4639         src/login/pam-module.c
4640
4641 pam_systemd_la_CFLAGS = \
4642         $(AM_CFLAGS) \
4643         $(PAM_CFLAGS) \
4644         -fvisibility=hidden
4645
4646 pam_systemd_la_LDFLAGS = \
4647         $(AM_LDFLAGS) \
4648         -module \
4649         -export-dynamic \
4650         -avoid-version \
4651         -shared \
4652         -export-symbols-regex '^pam_sm_.*'
4653
4654 pam_systemd_la_LIBADD = \
4655         libsystemd-capability.la \
4656         libsystemd-internal.la \
4657         libsystemd-shared.la \
4658         $(PAM_LIBS)
4659
4660 pamlib_LTLIBRARIES = \
4661         pam_systemd.la
4662
4663 dist_pamconf_DATA = \
4664         src/login/systemd-user
4665 endif
4666
4667 nodist_systemunit_DATA += \
4668         units/systemd-logind.service \
4669         units/systemd-user-sessions.service
4670
4671 dist_systemunit_DATA += \
4672         units/user.slice \
4673         units/org.freedesktop.login1.busname
4674
4675 dist_dbussystemservice_DATA += \
4676         src/login/org.freedesktop.login1.service
4677
4678 dist_dbuspolicy_DATA += \
4679         src/login/org.freedesktop.login1.conf
4680
4681 dist_pkgsysconf_DATA += \
4682         src/login/logind.conf
4683
4684 polkitpolicy_files += \
4685         src/login/org.freedesktop.login1.policy
4686
4687 INSTALL_DIRS += \
4688         $(systemdstatedir)
4689
4690 MULTI_USER_TARGET_WANTS += \
4691         systemd-logind.service \
4692         systemd-user-sessions.service
4693
4694 SYSTEM_UNIT_ALIASES += \
4695         systemd-logind.service dbus-org.freedesktop.login1.service
4696
4697 BUSNAMES_TARGET_WANTS += \
4698         org.freedesktop.login1.busname
4699
4700 if ENABLE_MULTI_SEAT_X
4701
4702 systemd_multi_seat_x_SOURCES = \
4703         src/login/multi-seat-x.c
4704
4705 systemd_multi_seat_x_LDADD = \
4706         libsystemd-label.la \
4707         libsystemd-shared.la
4708
4709 rootlibexec_PROGRAMS += \
4710         systemd-multi-seat-x
4711
4712 endif
4713
4714 dist_udevrules_DATA += \
4715         src/login/70-uaccess.rules \
4716         src/login/70-power-switch.rules
4717
4718 nodist_udevrules_DATA += \
4719         src/login/71-seat.rules \
4720         src/login/73-seat-late.rules
4721
4722 CLEANFILES += \
4723         src/login/logind-gperf.c \
4724         src/login/71-seat.rules \
4725         src/login/73-seat-late.rules
4726 endif
4727
4728 polkitpolicy_in_files += \
4729         src/login/org.freedesktop.login1.policy.in
4730
4731 EXTRA_DIST += \
4732         src/login/logind-gperf.gperf \
4733         src/login/71-seat.rules.in \
4734         src/login/73-seat-late.rules.in \
4735         units/systemd-logind.service.in \
4736         units/systemd-user-sessions.service.in
4737
4738 # ------------------------------------------------------------------------------
4739 if HAVE_PYTHON_DEVEL
4740 pkgpyexec_LTLIBRARIES = \
4741         _journal.la \
4742         id128.la \
4743         _daemon.la \
4744         _reader.la \
4745         login.la
4746
4747 _journal_la_SOURCES = \
4748         src/python-systemd/_journal.c
4749
4750 _journal_la_CFLAGS = \
4751         $(AM_CFLAGS) \
4752         -fvisibility=default \
4753         $(PYTHON_DEVEL_CFLAGS)
4754
4755 _journal_la_LDFLAGS = \
4756         $(AM_LDFLAGS) \
4757         -shared \
4758         -module \
4759         -avoid-version
4760
4761 _journal_la_LIBADD = \
4762         $(PYTHON_DEVEL_LIBS) \
4763         libsystemd.la
4764
4765 id128_la_SOURCES = \
4766         src/python-systemd/id128.c \
4767         src/python-systemd/id128-constants.h \
4768         src/python-systemd/pyutil.c \
4769         src/python-systemd/pyutil.h
4770
4771 id128_la_CFLAGS = \
4772         $(AM_CFLAGS) \
4773         -fvisibility=default \
4774         $(PYTHON_DEVEL_CFLAGS) \
4775         -I$(top_builddir)/src/python-systemd
4776
4777 id128_la_LDFLAGS = \
4778         $(AM_LDFLAGS) \
4779         -shared \
4780         -module \
4781         -avoid-version
4782
4783 id128_la_LIBADD = \
4784         $(PYTHON_DEVEL_LIBS) \
4785         libsystemd-shared.la \
4786         libsystemd.la
4787
4788 _daemon_la_SOURCES = \
4789         src/python-systemd/_daemon.c \
4790         src/python-systemd/pyutil.c \
4791         src/python-systemd/pyutil.h
4792
4793 _daemon_la_CFLAGS = \
4794         $(AM_CFLAGS) \
4795         -fvisibility=default \
4796         $(PYTHON_DEVEL_CFLAGS) \
4797         -I$(top_builddir)/src/python-systemd
4798
4799 _daemon_la_LDFLAGS = \
4800         $(AM_LDFLAGS) \
4801         -shared \
4802         -module \
4803         -avoid-version
4804
4805 _daemon_la_LIBADD = \
4806         $(PYTHON_DEVEL_LIBS) \
4807         libsystemd-shared.la \
4808         libsystemd.la
4809
4810 _reader_la_SOURCES = \
4811         src/python-systemd/_reader.c \
4812         src/python-systemd/pyutil.c \
4813         src/python-systemd/pyutil.h
4814
4815 _reader_la_CFLAGS = \
4816         $(AM_CFLAGS) \
4817         -fvisibility=default \
4818         $(PYTHON_DEVEL_CFLAGS)
4819
4820 _reader_la_LDFLAGS = \
4821         $(AM_LDFLAGS) \
4822         -shared \
4823         -module \
4824         -avoid-version
4825
4826 _reader_la_LIBADD = \
4827         $(PYTHON_DEVEL_LIBS) \
4828         libsystemd-shared.la \
4829         libsystemd.la
4830
4831 login_la_SOURCES = \
4832         src/python-systemd/login.c \
4833         src/python-systemd/pyutil.c \
4834         src/python-systemd/pyutil.h
4835
4836 login_la_CFLAGS = \
4837         $(AM_CFLAGS) \
4838         -fvisibility=default \
4839         $(PYTHON_DEVEL_CFLAGS)
4840
4841 login_la_LDFLAGS = \
4842         $(AM_LDFLAGS) \
4843         -shared \
4844         -module \
4845         -avoid-version
4846
4847 login_la_LIBADD = \
4848         $(PYTHON_DEVEL_LIBS) \
4849         libsystemd-shared.la \
4850         libsystemd.la
4851
4852 dist_pkgpyexec_PYTHON = \
4853         src/python-systemd/journal.py \
4854         src/python-systemd/daemon.py \
4855         src/python-systemd/__init__.py
4856
4857 src/python-systemd/id128-constants.h: src/systemd/sd-messages.h
4858         $(AM_V_at)$(MKDIR_P) $(dir $@)
4859         $(AM_V_GEN)$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
4860
4861 BUILT_SOURCES += \
4862         src/python-systemd/id128-constants.h
4863
4864 SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
4865 sphinx-%:
4866         $(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
4867         $(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/
4868         $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/html/python-systemd/
4869
4870 python-shell:
4871         $(AM_V_at)echo "Starting python with $(DESTDIR)$(pyexecdir)"
4872         $(AM_V_at)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(PYTHON)
4873
4874 destdir-sphinx: all
4875         dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
4876                 $(MAKE) DESTDIR="$$dir" install && \
4877                 $(MAKE) DESTDIR="$$dir" sphinx-html && \
4878                 rm -rf "$$dir"
4879
4880 endif
4881
4882 CLEAN_LOCAL_HOOKS += clean-sphinx
4883
4884 .PHONY: python-shell destdir-sphinx clean-sphinx clean-python
4885
4886 clean-sphinx:
4887         -rm -rf docs/html/python-systemd/
4888
4889 # Remove Python stuff, e.g. to force rebuilding for a different Python version.
4890 clean-python:
4891         -rm -rf src/python-systemd/.libs src/python-systemd/*.l[ao]
4892         -rm -f _daemon.la id128.la _journal.la login.la _reader.la
4893
4894 # ------------------------------------------------------------------------------
4895 if ENABLE_COMPAT_LIBS
4896 EXTRA_DIST += \
4897         src/compat-libs/linkwarning.h
4898
4899 libsystemd-%.c: src/compat-libs/libsystemd-%.sym
4900         $(AM_V_at)$(MKDIR_P) $(dir $@)
4901         $(AM_V_GEN)sed -r -n 's/^ +(sd_.*);/obsolete_lib(\1,$(notdir $(basename $<)));/p' <$< >$@
4902
4903 BUILT_SOURCES += \
4904         libsystemd-journal.c \
4905         libsystemd-login.c \
4906         libsystemd-id128.c \
4907         libsystemd-daemon.c
4908
4909 libsystemd_journal_la_SOURCES = \
4910         libsystemd-journal.c \
4911         src/compat-libs/libsystemd-journal.sym
4912
4913 libsystemd_journal_la_CPPFLAGS = \
4914         $(AM_CFLAGS) \
4915         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4916
4917 libsystemd_journal_la_LDFLAGS = \
4918         $(AM_LDFLAGS) \
4919         -version-info $(LIBSYSTEMD_JOURNAL_CURRENT):$(LIBSYSTEMD_JOURNAL_REVISION):$(LIBSYSTEMD_JOURNAL_AGE) \
4920         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-journal.sym
4921
4922 libsystemd_journal_la_LIBADD = \
4923         libsystemd-journal-internal.la \
4924         libsystemd-internal.la \
4925         libsystemd-shared.la
4926
4927 libsystemd_login_la_SOURCES = \
4928         libsystemd-login.c \
4929         src/compat-libs/libsystemd-login.sym
4930
4931 libsystemd_login_la_CPPFLAGS = \
4932         $(AM_CFLAGS) \
4933         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4934
4935 libsystemd_login_la_LDFLAGS = \
4936         $(AM_LDFLAGS) \
4937         -version-info $(LIBSYSTEMD_LOGIN_CURRENT):$(LIBSYSTEMD_LOGIN_REVISION):$(LIBSYSTEMD_LOGIN_AGE) \
4938         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-login.sym
4939
4940 libsystemd_login_la_LIBADD = \
4941         libsystemd-internal.la \
4942         libsystemd-shared.la
4943
4944 libsystemd_id128_la_SOURCES = \
4945         libsystemd-id128.c \
4946         src/compat-libs/libsystemd-id128.sym
4947
4948 libsystemd_id128_la_CPPFLAGS = \
4949         $(AM_CFLAGS) \
4950         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4951
4952 libsystemd_id128_la_LDFLAGS = \
4953         $(AM_LDFLAGS) \
4954         -version-info $(LIBSYSTEMD_ID128_CURRENT):$(LIBSYSTEMD_ID128_REVISION):$(LIBSYSTEMD_ID128_AGE) \
4955         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-id128.sym
4956
4957 libsystemd_id128_la_LIBADD = \
4958         libsystemd-internal.la \
4959         libsystemd-shared.la
4960
4961 libsystemd_daemon_la_SOURCES = \
4962         libsystemd-daemon.c \
4963         src/compat-libs/libsystemd-daemon.sym
4964
4965 libsystemd_daemon_la_CPPFLAGS = \
4966         $(AM_CFLAGS) \
4967         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4968
4969 libsystemd_daemon_la_LDFLAGS = \
4970         $(AM_LDFLAGS) \
4971         -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
4972         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-daemon.sym
4973
4974 libsystemd_daemon_la_LIBADD = \
4975         libsystemd-internal.la \
4976         libsystemd-shared.la
4977
4978 lib_LTLIBRARIES += \
4979         libsystemd-journal.la \
4980         libsystemd-login.la \
4981         libsystemd-id128.la \
4982         libsystemd-daemon.la
4983
4984 pkgconfiglib_DATA += \
4985         src/compat-libs/libsystemd-journal.pc \
4986         src/compat-libs/libsystemd-login.pc \
4987         src/compat-libs/libsystemd-id128.pc \
4988         src/compat-libs/libsystemd-daemon.pc
4989
4990 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
4991 compat-lib-install-hook:
4992         libname=libsystemd-login.so && $(move-to-rootlibdir)
4993         libname=libsystemd-journal.so && $(move-to-rootlibdir)
4994         libname=libsystemd-id128.so && $(move-to-rootlibdir)
4995         libname=libsystemd-daemon.so && $(move-to-rootlibdir)
4996
4997 compat-lib-uninstall-hook:
4998         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-login.so*
4999         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so*
5000         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-id128.so*
5001         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so*
5002
5003 INSTALL_EXEC_HOOKS += compat-lib-install-hook
5004 UNINSTALL_EXEC_HOOKS += compat-lib-uninstall-hook
5005 endif
5006
5007 EXTRA_DIST += \
5008         src/compat-libs/libsystemd-journal.pc.in \
5009         src/compat-libs/libsystemd-login.pc.in \
5010         src/compat-libs/libsystemd-id128.pc.in \
5011         src/compat-libs/libsystemd-daemon.pc.in
5012
5013 # ------------------------------------------------------------------------------
5014 substitutions = \
5015        '|rootlibexecdir=$(rootlibexecdir)|' \
5016        '|rootbindir=$(rootbindir)|' \
5017        '|bindir=$(bindir)|' \
5018        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
5019        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
5020        '|pkgsysconfdir=$(pkgsysconfdir)|' \
5021        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
5022        '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
5023        '|pkgdatadir=$(pkgdatadir)|' \
5024        '|systemunitdir=$(systemunitdir)|' \
5025        '|userunitdir=$(userunitdir)|' \
5026        '|systempresetdir=$(systempresetdir)|' \
5027        '|userpresetdir=$(userpresetdir)|' \
5028        '|udevhwdbdir=$(udevhwdbdir)|' \
5029        '|udevrulesdir=$(udevrulesdir)|' \
5030        '|catalogdir=$(catalogdir)|' \
5031        '|tmpfilesdir=$(tmpfilesdir)|' \
5032        '|sysusersdir=$(sysusersdir)|' \
5033        '|sysctldir=$(sysctldir)|' \
5034        '|systemgeneratordir=$(systemgeneratordir)|' \
5035        '|usergeneratordir=$(usergeneratordir)|' \
5036        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
5037        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
5038        '|PACKAGE_URL=$(PACKAGE_URL)|' \
5039        '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
5040        '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
5041        '|prefix=$(prefix)|' \
5042        '|exec_prefix=$(exec_prefix)|' \
5043        '|libdir=$(libdir)|' \
5044        '|includedir=$(includedir)|' \
5045        '|VERSION=$(VERSION)|' \
5046        '|rootprefix=$(rootprefix)|' \
5047        '|udevlibexecdir=$(udevlibexecdir)|' \
5048        '|SUSHELL=$(SUSHELL)|' \
5049        '|DEBUGTTY=$(DEBUGTTY)|' \
5050        '|KILL=$(KILL)|' \
5051        '|KMOD=$(KMOD)|' \
5052        '|MKDIR_P=$(MKDIR_P)|' \
5053        '|QUOTAON=$(QUOTAON)|' \
5054        '|QUOTACHECK=$(QUOTACHECK)|' \
5055        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
5056        '|VARLOGDIR=$(varlogdir)|' \
5057        '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
5058        '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
5059        '|PYTHON=$(PYTHON)|' \
5060        '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
5061        '|NTP_SERVERS=$(NTP_SERVERS)|' \
5062        '|DNS_SERVERS=$(DNS_SERVERS)|' \
5063        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
5064        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
5065        '|TTY_GID=$(TTY_GID)|'
5066
5067 SED_PROCESS = \
5068         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
5069         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
5070                 < $< > $@
5071
5072 units/%: units/%.in
5073         $(SED_PROCESS)
5074
5075 man/%: man/%.in
5076         $(SED_PROCESS)
5077
5078 sysctl.d/%: sysctl.d/%.in
5079         $(SED_PROCESS)
5080
5081 %.pc: %.pc.in
5082         $(SED_PROCESS)
5083
5084 src/core/macros.%: src/core/macros.%.in
5085         $(SED_PROCESS)
5086
5087 src/%.policy.in: src/%.policy.in.in
5088         $(SED_PROCESS)
5089
5090 %.rules: %.rules.in
5091         $(SED_PROCESS)
5092
5093 %.conf: %.conf.in
5094         $(SED_PROCESS)
5095
5096 %.sh: %.sh.in
5097         $(SED_PROCESS)
5098         $(AM_V_GEN)chmod +x $@
5099
5100 src/%.c: src/%.gperf
5101         $(AM_V_at)$(MKDIR_P) $(dir $@)
5102         $(AM_V_GPERF)$(GPERF) < $< > $@
5103
5104 src/%: src/%.m4
5105         $(AM_V_at)$(MKDIR_P) $(dir $@)
5106         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
5107
5108 units/%: units/%.m4
5109         $(AM_V_at)$(MKDIR_P) $(dir $@)
5110         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
5111
5112 units/user/%: units/%.m4
5113         $(AM_V_at)$(MKDIR_P) $(dir $@)
5114         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
5115
5116 if ENABLE_POLKIT
5117 nodist_polkitpolicy_DATA = \
5118         $(polkitpolicy_files) \
5119         $(polkitpolicy_in_in_files:.policy.in.in=.policy)
5120 endif
5121
5122 EXTRA_DIST += \
5123         $(polkitpolicy_in_files) \
5124         $(polkitpolicy_in_in_files)
5125
5126 CLEANFILES += \
5127         $(nodist_systemunit_DATA) \
5128         $(nodist_userunit_DATA) \
5129         $(pkgconfigdata_DATA) \
5130         $(pkgconfiglib_DATA) \
5131         $(nodist_polkitpolicy_DATA)
5132
5133 # ------------------------------------------------------------------------------
5134 if ENABLE_MANPAGES
5135 man/custom-entities.ent: configure.ac
5136         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
5137         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
5138          printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
5139          > $@ # '
5140
5141 DISTCLEANFILES += \
5142         man/custom-entities.ent
5143
5144 XSLTPROC_FLAGS = \
5145         --nonet \
5146         --xinclude \
5147         --stringparam man.output.quietly 1 \
5148         --stringparam funcsynopsis.style ansi \
5149         --stringparam man.authors.section.enabled 0 \
5150         --stringparam man.copyright.section.enabled 0 \
5151         --stringparam systemd.version $(VERSION) \
5152         --path '$(builddir)/man:$(srcdir)/man'
5153
5154 XSLTPROC_PROCESS_MAN = \
5155         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
5156
5157 XSLTPROC_PROCESS_HTML = \
5158         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
5159
5160 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
5161         $(XSLTPROC_PROCESS_MAN)
5162
5163 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
5164         $(XSLTPROC_PROCESS_MAN)
5165
5166 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
5167         $(XSLTPROC_PROCESS_MAN)
5168
5169 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
5170         $(XSLTPROC_PROCESS_MAN)
5171
5172 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
5173         $(XSLTPROC_PROCESS_MAN)
5174
5175 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
5176         $(XSLTPROC_PROCESS_HTML)
5177
5178 define html-alias
5179         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
5180 endef
5181
5182 endif
5183
5184 EXTRA_DIST += \
5185         man/custom-html.xsl \
5186         man/custom-man.xsl
5187
5188 # ------------------------------------------------------------------------------
5189 if HAVE_SYSV_COMPAT
5190 sysvinit_DATA = \
5191         docs/sysvinit/README
5192
5193 varlog_DATA = \
5194         docs/var-log/README
5195
5196 docs/sysvinit/README: docs/sysvinit/README.in
5197         $(SED_PROCESS)
5198
5199 docs/var-log/README: docs/var-log/README.in
5200         $(SED_PROCESS)
5201
5202 CLEANFILES += \
5203         docs/sysvinit/README \
5204         docs/var-log/README
5205 endif
5206
5207 EXTRA_DIST += \
5208         docs/sysvinit/README.in \
5209         docs/var-log/README.in
5210
5211 SOCKETS_TARGET_WANTS += \
5212         systemd-initctl.socket \
5213         systemd-shutdownd.socket
5214
5215 if HAVE_SYSV_COMPAT
5216 RUNLEVEL1_TARGET_WANTS += \
5217         systemd-update-utmp-runlevel.service
5218 RUNLEVEL2_TARGET_WANTS += \
5219         systemd-update-utmp-runlevel.service
5220 RUNLEVEL3_TARGET_WANTS += \
5221         systemd-update-utmp-runlevel.service
5222 RUNLEVEL4_TARGET_WANTS += \
5223         systemd-update-utmp-runlevel.service
5224 RUNLEVEL5_TARGET_WANTS += \
5225         systemd-update-utmp-runlevel.service
5226 endif
5227
5228 SYSINIT_TARGET_WANTS += \
5229         systemd-update-utmp.service \
5230         systemd-update-done.service \
5231         ldconfig.service
5232
5233 LOCAL_FS_TARGET_WANTS += \
5234         systemd-remount-fs.service \
5235         tmp.mount
5236
5237 MULTI_USER_TARGET_WANTS += \
5238         getty.target \
5239         systemd-ask-password-wall.path
5240
5241 SYSINIT_TARGET_WANTS += \
5242         dev-hugepages.mount \
5243         dev-mqueue.mount \
5244         sys-kernel-config.mount \
5245         sys-kernel-debug.mount \
5246         sys-fs-fuse-connections.mount \
5247         systemd-sysctl.service \
5248         systemd-ask-password-console.path
5249
5250 if HAVE_SYSV_COMPAT
5251 SYSTEM_UNIT_ALIASES += \
5252         poweroff.target runlevel0.target \
5253         rescue.target runlevel1.target \
5254         multi-user.target runlevel2.target \
5255         multi-user.target runlevel3.target \
5256         multi-user.target runlevel4.target \
5257         graphical.target runlevel5.target \
5258         reboot.target runlevel6.target
5259 endif
5260
5261 SYSTEM_UNIT_ALIASES += \
5262         graphical.target default.target \
5263         reboot.target ctrl-alt-del.target \
5264         getty@.service autovt@.service
5265
5266 USER_UNIT_ALIASES += \
5267         $(systemunitdir)/shutdown.target shutdown.target \
5268         $(systemunitdir)/sockets.target sockets.target \
5269         $(systemunitdir)/busnames.target busnames.target \
5270         $(systemunitdir)/timers.target timers.target \
5271         $(systemunitdir)/paths.target paths.target \
5272         $(systemunitdir)/bluetooth.target bluetooth.target \
5273         $(systemunitdir)/printer.target printer.target \
5274         $(systemunitdir)/sound.target sound.target \
5275         $(systemunitdir)/smartcard.target smartcard.target
5276
5277 GENERAL_ALIASES += \
5278         $(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
5279         $(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \
5280         $(pkgsysconfdir)/user $(sysconfdir)/xdg/systemd/user \
5281         $(dbussystemservicedir)/org.freedesktop.systemd1.service $(dbussessionservicedir)/org.freedesktop.systemd1.service
5282
5283 if HAVE_SYSV_COMPAT
5284 INSTALL_DIRS += \
5285         $(systemunitdir)/runlevel1.target.wants \
5286         $(systemunitdir)/runlevel2.target.wants \
5287         $(systemunitdir)/runlevel3.target.wants \
5288         $(systemunitdir)/runlevel4.target.wants \
5289         $(systemunitdir)/runlevel5.target.wants
5290 endif
5291
5292 INSTALL_DIRS += \
5293         $(prefix)/lib/modules-load.d \
5294         $(sysconfdir)/modules-load.d \
5295         $(prefix)/lib/systemd/network \
5296         $(sysconfdir)/systemd/network \
5297         $(prefix)/lib/sysctl.d \
5298         $(sysconfdir)/sysctl.d \
5299         $(prefix)/lib/kernel/install.d \
5300         $(sysconfdir)/kernel/install.d \
5301         $(systemshutdowndir) \
5302         $(systemsleepdir) \
5303         $(systemgeneratordir) \
5304         $(usergeneratordir) \
5305         \
5306         $(userunitdir) \
5307         $(pkgsysconfdir)/system \
5308         $(pkgsysconfdir)/system/multi-user.target.wants \
5309         $(pkgsysconfdir)/system/getty.target.wants \
5310         $(pkgsysconfdir)/user \
5311         $(dbussessionservicedir) \
5312         $(sysconfdir)/xdg/systemd
5313
5314 install-exec-hook: $(INSTALL_EXEC_HOOKS)
5315
5316 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
5317
5318 install-data-hook: $(INSTALL_DATA_HOOKS)
5319
5320 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
5321
5322 clean-local: $(CLEAN_LOCAL_HOOKS)
5323         rm -rf $(abs_srcdir)/install-tree
5324         rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
5325               $(abs_srcdir)/hwdb/iab.txt
5326
5327 DISTCHECK_CONFIGURE_FLAGS = \
5328         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
5329         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
5330         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
5331         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
5332         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
5333         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
5334         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
5335         --with-rootprefix=$$dc_install_base \
5336         --disable-split-usr \
5337         --enable-kdbus \
5338         --enable-compat-libs
5339
5340 if HAVE_SYSV_COMPAT
5341 DISTCHECK_CONFIGURE_FLAGS += \
5342         --with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
5343         --with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
5344 else
5345 DISTCHECK_CONFIGURE_FLAGS += \
5346         --with-sysvinit-path= \
5347         --with-sysvrcnd-path=
5348 endif
5349
5350 if ENABLE_GTK_DOC
5351 DISTCHECK_CONFIGURE_FLAGS += \
5352         --enable-gtk-doc
5353 endif
5354
5355 # check "broken" platforms limited toolchains for link breakage before we release
5356 .PHONY: linkcheck
5357 linkcheck:
5358         $(MAKE) CFLAGS='-fno-lto' LDFLAGS='-Wl,-fuse-ld=gold -Wl,--as-needed -Wl,--no-gc-sections' distcheck
5359
5360 .PHONY: hwdb-update
5361 hwdb-update:
5362         ( cd $(top_srcdir)/hwdb && \
5363         wget -N http://www.linux-usb.org/usb.ids \
5364                 http://pci-ids.ucw.cz/v2.2/pci.ids \
5365                 http://standards.ieee.org/develop/regauth/oui/oui.txt \
5366                 http://standards.ieee.org/develop/regauth/iab/iab.txt && \
5367         ./ids-update.pl )
5368
5369 .PHONY: kdbus-update
5370 kdbus-update:
5371         ( cd $(top_srcdir)/src/libsystemd/sd-bus/ && \
5372         wget -N https://d-bus.googlecode.com/git/kdbus.h )
5373
5374 .PHONY: git-tag
5375 git-tag:
5376         git tag -s "v$(VERSION)" -m "systemd $(VERSION)"
5377
5378 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
5379 .PHONY: upload
5380 upload: all check dist
5381         scp systemd-$(VERSION).tar.xz $(www_target)
5382
5383 .PHONY: doc-sync
5384 doc-sync: all destdir-sphinx
5385         gtkdoc-rebase --html-dir=docs/libudev/html --online
5386         rsync -rlv --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
5387         gtkdoc-rebase --html-dir=docs/gudev/html --online
5388         rsync -rlv --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
5389         rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
5390         rsync -rlv --delete --omit-dir-times docs/html/python-systemd/ $(www_target)/python-systemd/
5391
5392 .PHONY: tango
5393 tango: upload
5394         cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
5395         scp man/*.html tango:public/systemd-man/
5396
5397 .PHONY: install-tree
5398 install-tree: all
5399         rm -rf $(abs_srcdir)/install-tree
5400         $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
5401         tree $(abs_srcdir)/install-tree
5402
5403 # Let's run all tests of the test suite, but under valgrind. Let's
5404 # exclude the one perl script we have in there
5405 .PHONY: valgrind-tests
5406 valgrind-tests: $(TESTS)
5407         $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
5408                 if file $$f | grep -q shell; then \
5409                 echo -e "$${x}Skipping non-binary $$f"; else \
5410                 echo -e "$${x}Running $$f"; \
5411                 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
5412                 x="\n\n"; \
5413         done
5414
5415 exported-%: %
5416         $(AM_V_GEN)nm -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
5417
5418 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
5419         $(AM_V_GEN)cat $^ > $@
5420
5421 .PHONY: check-api-docs
5422 check-api-docs: exported man
5423         $(AM_V_GEN)for symbol in `cat exported` ; do \
5424                 if test -f $(builddir)/man/$$symbol.html ; then \
5425                         echo "  Symbol $$symbol() is documented." ; \
5426                 else \
5427                         echo "‣ Symbol $$symbol() lacks documentation." ; \
5428                 fi ; \
5429         done
5430
5431 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
5432 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
5433
5434 undefined defined: $(ALL_OBJECTS)
5435         $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
5436                 nm -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
5437         done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
5438
5439 CLEANFILES += \
5440         defined \
5441         undefined
5442
5443 .PHONY: check-api-unused
5444 check-api-unused: defined undefined exported
5445         ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
5446
5447 .PHONY: check-includes
5448 check-includes: $(top_srcdir)/tools/check-includes.pl
5449         $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
5450                 | xargs $(top_srcdir)/tools/check-includes.pl
5451
5452 EXTRA_DIST += \
5453         $(top_srcdir)/tools/check-includes.pl
5454
5455 # Stupid test that everything purported to be exported really is
5456 define generate-sym-test
5457         $(AM_V_at)$(MKDIR_P) $(dir $@)
5458         $(AM_V_at)printf '#include <stdio.h>\n' > $@
5459         $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
5460         $(AM_V_at)printf 'void* functions[] = {\n' >> $@
5461         $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
5462         $(AM_V_at)printf '};\nint main(void) {\n' >> $@
5463         $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
5464         $(AM_V_at)printf 'return 0; }\n' >> $@
5465 endef
5466
5467 test-libsystemd-sym.c: \
5468                 $(top_builddir)/src/libsystemd/libsystemd.sym \
5469                 src/systemd/sd-journal.h \
5470                 src/systemd/sd-daemon.h \
5471                 src/systemd/sd-login.h \
5472                 src/systemd/sd-bus.h \
5473                 src/systemd/sd-utf8.h \
5474                 src/systemd/sd-resolve.h
5475         $(generate-sym-test)
5476
5477 test-libudev-sym.c: \
5478                 src/libudev/libudev.sym \
5479                 src/udev/udev.h
5480         $(generate-sym-test)
5481
5482 test_libsystemd_sym_SOURCES = \
5483         test-libsystemd-sym.c
5484 test_libsystemd_sym_LDADD = \
5485         libsystemd.la
5486
5487 test_libudev_sym_SOURCES = \
5488         test-libudev-sym.c
5489 test_libudev_sym_CFLAGS = \
5490         $(AM_CFLAGS) \
5491         -Wno-deprecated-declarations
5492 test_libudev_sym_LDADD = \
5493         libudev.la
5494
5495 BUILT_SOURCES += \
5496         $(test_libsystemd_sym_SOURCES) \
5497         $(test_libudev_sym_SOURCES)
5498
5499 tests += \
5500         test-libsystemd-sym \
5501         test-libudev-sym
5502
5503 .PHONY: cppcheck
5504 cppcheck:
5505         cppcheck --enable=all -q $(top_srcdir)
5506
5507 # Used to extract compile flags for YCM.
5508 print-%:
5509         @echo $($*)
5510
5511 git-contrib:
5512         @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u