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