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