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