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