chiark / gitweb /
networkd: link - fix memory leak
[elogind.git] / Makefile.am
1 #  -*- Mode: makefile; indent-tabs-mode: t -*-
2 #
3 #  This file is part of systemd.
4 #
5 #  Copyright 2010-2012 Lennart Poettering
6 #  Copyright 2010-2012 Kay Sievers
7 #  Copyright 2013 Zbigniew JÄ™drzejewski-Szmek
8 #  Copyright 2013 David Strauss
9 #
10 #  systemd is free software; you can redistribute it and/or modify it
11 #  under the terms of the GNU Lesser General Public License as published by
12 #  the Free Software Foundation; either version 2.1 of the License, or
13 #  (at your option) any later version.
14 #
15 #  systemd is distributed in the hope that it will be useful, but
16 #  WITHOUT ANY WARRANTY; without even the implied warranty of
17 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 #  Lesser General Public License for more details.
19 #
20 #  You should have received a copy of the GNU Lesser General Public License
21 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
22
23 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
24 AM_MAKEFLAGS = --no-print-directory
25 AUTOMAKE_OPTIONS = color-tests parallel-tests
26
27 SUBDIRS = . po
28
29 # remove targets if the command fails
30 .DELETE_ON_ERROR:
31
32 # keep intermediate files
33 .SECONDARY:
34
35 # Keep the test-suite.log
36 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
37
38 LIBUDEV_CURRENT=6
39 LIBUDEV_REVISION=0
40 LIBUDEV_AGE=5
41
42 LIBGUDEV_CURRENT=2
43 LIBGUDEV_REVISION=0
44 LIBGUDEV_AGE=2
45
46 LIBSYSTEMD_CURRENT=3
47 LIBSYSTEMD_REVISION=1
48 LIBSYSTEMD_AGE=3
49
50 # The following four libraries only exist for compatibility reasons,
51 # their version info should not be bumped anymore
52 LIBSYSTEMD_LOGIN_CURRENT=9
53 LIBSYSTEMD_LOGIN_REVISION=3
54 LIBSYSTEMD_LOGIN_AGE=9
55
56 LIBSYSTEMD_DAEMON_CURRENT=0
57 LIBSYSTEMD_DAEMON_REVISION=12
58 LIBSYSTEMD_DAEMON_AGE=0
59
60 LIBSYSTEMD_ID128_CURRENT=0
61 LIBSYSTEMD_ID128_REVISION=28
62 LIBSYSTEMD_ID128_AGE=0
63
64 LIBSYSTEMD_JOURNAL_CURRENT=11
65 LIBSYSTEMD_JOURNAL_REVISION=5
66 LIBSYSTEMD_JOURNAL_AGE=11
67
68 # Dirs of external packages
69 dbuspolicydir=@dbuspolicydir@
70 dbussessionservicedir=@dbussessionservicedir@
71 dbussystemservicedir=@dbussystemservicedir@
72 pamlibdir=@pamlibdir@
73 pamconfdir=@pamconfdir@
74 pkgconfigdatadir=$(datadir)/pkgconfig
75 pkgconfiglibdir=$(libdir)/pkgconfig
76 polkitpolicydir=$(datadir)/polkit-1/actions
77 bashcompletiondir=@bashcompletiondir@
78 zshcompletiondir=@zshcompletiondir@
79 rpmmacrosdir=$(prefix)/lib/rpm/macros.d
80 sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
81 sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
82 varlogdir=$(localstatedir)/log
83 systemdstatedir=$(localstatedir)/lib/systemd
84 catalogstatedir=$(systemdstatedir)/catalog
85
86 # Our own, non-special dirs
87 pkgsysconfdir=$(sysconfdir)/systemd
88 userunitdir=$(prefix)/lib/systemd/user
89 userpresetdir=$(prefix)/lib/systemd/user-preset
90 tmpfilesdir=$(prefix)/lib/tmpfiles.d
91 sysusersdir=$(prefix)/lib/sysusers.d
92 sysctldir=$(prefix)/lib/sysctl.d
93 binfmtdir=$(prefix)/lib/binfmt.d
94 modulesloaddir=$(prefix)/lib/modules-load.d
95 networkdir=$(rootprefix)/lib/systemd/network
96 pkgincludedir=$(includedir)/systemd
97 systemgeneratordir=$(rootlibexecdir)/system-generators
98 usergeneratordir=$(prefix)/lib/systemd/user-generators
99 systemshutdowndir=$(rootlibexecdir)/system-shutdown
100 systemsleepdir=$(rootlibexecdir)/system-sleep
101 systemunitdir=$(rootprefix)/lib/systemd/system
102 systempresetdir=$(rootprefix)/lib/systemd/system-preset
103 udevlibexecdir=$(rootprefix)/lib/udev
104 udevhomedir=$(udevlibexecdir)
105 udevrulesdir=$(udevlibexecdir)/rules.d
106 udevhwdbdir=$(udevlibexecdir)/hwdb.d
107 catalogdir=$(prefix)/lib/systemd/catalog
108 kernelinstalldir = $(prefix)/lib/kernel/install.d
109
110 # And these are the special ones for /
111 rootprefix=@rootprefix@
112 rootbindir=$(rootprefix)/bin
113 rootlibexecdir=$(rootprefix)/lib/systemd
114
115 CLEANFILES = $(BUILT_SOURCES)
116 DISTCLEANFILES =
117 EXTRA_DIST =
118 BUILT_SOURCES =
119 INSTALL_EXEC_HOOKS =
120 UNINSTALL_EXEC_HOOKS =
121 INSTALL_DATA_HOOKS =
122 UNINSTALL_DATA_HOOKS =
123 DISTCLEAN_LOCAL_HOOKS =
124 CLEAN_LOCAL_HOOKS =
125 pkginclude_HEADERS =
126 noinst_LTLIBRARIES =
127 lib_LTLIBRARIES =
128 include_HEADERS =
129 noinst_DATA =
130 pkgconfiglib_DATA =
131 polkitpolicy_in_in_files =
132 polkitpolicy_in_files =
133 polkitpolicy_files =
134 dist_udevrules_DATA =
135 nodist_udevrules_DATA =
136 nodist_pkgsysconf_DATA =
137 dist_pkgsysconf_DATA =
138 dist_pkgdata_DATA =
139 dist_dbuspolicy_DATA =
140 dist_dbussystemservice_DATA =
141 check_PROGRAMS =
142 check_DATA =
143 tests=
144 manual_tests =
145 if ENABLE_TESTS
146 noinst_PROGRAMS = $(manual_tests) $(tests)
147 TESTS = $(tests)
148 else
149 noinst_PROGRAMS =
150 TESTS =
151 endif
152 udevlibexec_PROGRAMS =
153
154 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
155         $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
156         $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
157
158 AM_CPPFLAGS = \
159         -include $(top_builddir)/config.h \
160         -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
161         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
162         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
163         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
164         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
165         -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
166         -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
167         -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
168         -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
169         -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
170         -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
171         -DSYSTEMD_SLEEP_BINARY_PATH=\"$(rootlibexecdir)/systemd-sleep\" \
172         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
173         -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(rootbindir)/systemd-tty-ask-password-agent\" \
174         -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
175         -DROOTPREFIX=\"$(rootprefix)\" \
176         -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\" \
177         -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\" \
178         -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
179         -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
180         -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
181         -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
182         -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
183         -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
184         -DX_SERVER=\"$(bindir)/X\" \
185         -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
186         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
187         -DQUOTACHECK=\"$(QUOTACHECK)\" \
188         -DKEXEC=\"$(KEXEC)\" \
189         -DLIBDIR=\"$(libdir)\" \
190         -DROOTLIBDIR=\"$(rootlibdir)\" \
191         -I $(top_srcdir)/src \
192         -I $(top_builddir)/src/shared \
193         -I $(top_srcdir)/src/shared \
194         -I $(top_srcdir)/src/network \
195         -I $(top_srcdir)/src/login \
196         -I $(top_srcdir)/src/journal \
197         -I $(top_srcdir)/src/timedate \
198         -I $(top_srcdir)/src/timesync \
199         -I $(top_srcdir)/src/resolve \
200         -I $(top_srcdir)/src/systemd \
201         -I $(top_builddir)/src/core \
202         -I $(top_srcdir)/src/core \
203         -I $(top_srcdir)/src/libudev \
204         -I $(top_srcdir)/src/udev \
205         -I $(top_srcdir)/src/udev/net \
206         -I $(top_builddir)/src/udev \
207         -I $(top_srcdir)/src/libsystemd/sd-bus \
208         -I $(top_srcdir)/src/libsystemd/sd-event \
209         -I $(top_srcdir)/src/libsystemd/sd-rtnl \
210         -I $(top_srcdir)/src/libsystemd-network \
211         $(OUR_CPPFLAGS)
212
213 AM_CFLAGS = $(OUR_CFLAGS)
214 AM_LDFLAGS = $(OUR_LDFLAGS)
215
216 # ------------------------------------------------------------------------------
217 define move-to-rootlibdir
218         if test "$(libdir)" != "$(rootlibdir)"; then \
219                 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
220                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
221                 rm -f $(DESTDIR)$(libdir)/$$libname && \
222                 $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
223                 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
224         fi
225 endef
226
227 INSTALL_DIRS =
228
229 RUNLEVEL1_TARGET_WANTS =
230 RUNLEVEL2_TARGET_WANTS =
231 RUNLEVEL3_TARGET_WANTS =
232 RUNLEVEL4_TARGET_WANTS =
233 RUNLEVEL5_TARGET_WANTS =
234 SHUTDOWN_TARGET_WANTS =
235 LOCAL_FS_TARGET_WANTS =
236 MULTI_USER_TARGET_WANTS =
237 SYSINIT_TARGET_WANTS =
238 SOCKETS_TARGET_WANTS =
239 BUSNAMES_TARGET_WANTS =
240 TIMERS_TARGET_WANTS =
241 USER_SOCKETS_TARGET_WANTS =
242 USER_BUSNAMES_TARGET_WANTS =
243
244 SYSTEM_UNIT_ALIASES =
245 USER_UNIT_ALIASES =
246 GENERAL_ALIASES =
247
248 install-target-wants-hook:
249         what="$(RUNLEVEL1_TARGET_WANTS)" && wants=runlevel1.target && dir=$(systemunitdir) && $(add-wants)
250         what="$(RUNLEVEL2_TARGET_WANTS)" && wants=runlevel2.target && dir=$(systemunitdir) && $(add-wants)
251         what="$(RUNLEVEL3_TARGET_WANTS)" && wants=runlevel3.target && dir=$(systemunitdir) && $(add-wants)
252         what="$(RUNLEVEL4_TARGET_WANTS)" && wants=runlevel4.target && dir=$(systemunitdir) && $(add-wants)
253         what="$(RUNLEVEL5_TARGET_WANTS)" && wants=runlevel5.target && dir=$(systemunitdir) && $(add-wants)
254         what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && dir=$(systemunitdir) && $(add-wants)
255         what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && dir=$(systemunitdir) && $(add-wants)
256         what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
257         what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && dir=$(systemunitdir) && $(add-wants)
258         what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(systemunitdir) && $(add-wants)
259         what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
260         what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && dir=$(systemunitdir) && $(add-wants)
261         what="$(SLICES_TARGET_WANTS)" && wants=slices.target && dir=$(systemunitdir) && $(add-wants)
262         what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
263         what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
264
265 define add-wants
266         [ -z "$$what" ] || ( \
267           dir=$(DESTDIR)$$dir/$$wants.wants && \
268           $(MKDIR_P) -m 0755 $$dir && \
269           cd $$dir && \
270           rm -f $$what && \
271           for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
272 endef
273
274 install-directories-hook:
275         $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
276
277 install-aliases-hook:
278         set -- $(SYSTEM_UNIT_ALIASES) && \
279                 dir=$(systemunitdir) && $(install-aliases)
280         set -- $(USER_UNIT_ALIASES) && \
281                 dir=$(userunitdir) && $(install-relative-aliases)
282         set -- $(GENERAL_ALIASES) && \
283                 dir= && $(install-relative-aliases)
284
285 define install-aliases
286         while [ -n "$$1" ]; do \
287                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
288                 rm -f $(DESTDIR)$$dir/$$2 && \
289                 $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
290                 shift 2 || exit $$?; \
291         done
292 endef
293
294 define install-relative-aliases
295         while [ -n "$$1" ]; do \
296                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
297                 rm -f $(DESTDIR)$$dir/$$2 && \
298                 $(LN_S) --relative $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
299                 shift 2 || exit $$?; \
300         done
301 endef
302
303 install-touch-usr-hook:
304         touch -c $(DESTDIR)/$(prefix)
305
306 INSTALL_EXEC_HOOKS += \
307         install-target-wants-hook \
308         install-directories-hook \
309         install-aliases-hook \
310         install-touch-usr-hook
311
312 # ------------------------------------------------------------------------------
313 AM_V_M4 = $(AM_V_M4_$(V))
314 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
315 AM_V_M4_0 = @echo "  M4      " $@;
316
317 AM_V_XSLT = $(AM_V_XSLT_$(V))
318 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
319 AM_V_XSLT_0 = @echo "  XSLT    " $@;
320
321 AM_V_GPERF = $(AM_V_GPERF_$(V))
322 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
323 AM_V_GPERF_0 = @echo "  GPERF   " $@;
324
325 AM_V_LN = $(AM_V_LN_$(V))
326 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
327 AM_V_LN_0 = @echo "  LN      " $@;
328
329 AM_V_RM = $(AM_V_RM_$(V))
330 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
331 AM_V_RM_0 = @echo "  RM      " $@;
332
333 # ------------------------------------------------------------------------------
334 rootbin_PROGRAMS = \
335         systemctl \
336         systemd-notify \
337         systemd-ask-password \
338         systemd-tty-ask-password-agent \
339         systemd-machine-id-setup \
340         systemd-escape
341
342 bin_PROGRAMS = \
343         systemd-cgls \
344         systemd-cgtop \
345         systemd-nspawn \
346         systemd-detect-virt \
347         systemd-delta \
348         systemd-analyze \
349         systemd-run \
350         systemd-path
351
352 dist_bin_SCRIPTS = \
353         src/kernel-install/kernel-install
354
355 dist_kernelinstall_SCRIPTS = \
356         src/kernel-install/50-depmod.install \
357         src/kernel-install/90-loaderentry.install
358
359 rootlibexec_PROGRAMS = \
360         systemd \
361         systemd-cgroups-agent \
362         systemd-initctl \
363         systemd-update-utmp \
364         systemd-shutdownd \
365         systemd-shutdown \
366         systemd-remount-fs \
367         systemd-reply-password \
368         systemd-fsck \
369         systemd-ac-power \
370         systemd-sysctl \
371         systemd-sleep \
372         systemd-bus-proxyd \
373         systemd-socket-proxyd \
374         systemd-update-done
375
376 systemgenerator_PROGRAMS = \
377         systemd-getty-generator \
378         systemd-fstab-generator \
379         systemd-system-update-generator \
380         systemd-debug-generator
381
382 dist_bashcompletion_DATA = \
383         shell-completion/bash/busctl \
384         shell-completion/bash/journalctl \
385         shell-completion/bash/systemctl \
386         shell-completion/bash/systemd-analyze \
387         shell-completion/bash/systemd-cat \
388         shell-completion/bash/systemd-cgls \
389         shell-completion/bash/systemd-cgtop \
390         shell-completion/bash/systemd-delta \
391         shell-completion/bash/systemd-detect-virt \
392         shell-completion/bash/systemd-nspawn \
393         shell-completion/bash/systemd-run \
394         shell-completion/bash/udevadm \
395         shell-completion/bash/kernel-install
396
397 dist_zshcompletion_DATA = \
398         shell-completion/zsh/_systemctl \
399         shell-completion/zsh/_journalctl \
400         shell-completion/zsh/_udevadm \
401         shell-completion/zsh/_kernel-install \
402         shell-completion/zsh/_systemd-nspawn \
403         shell-completion/zsh/_systemd-analyze \
404         shell-completion/zsh/_systemd-run \
405         shell-completion/zsh/_sd_hosts_or_user_at_host \
406         shell-completion/zsh/_systemd-delta \
407         shell-completion/zsh/_systemd
408
409 dist_sysctl_DATA = \
410         sysctl.d/50-default.conf
411
412 dist_systemunit_DATA = \
413         units/graphical.target \
414         units/multi-user.target \
415         units/emergency.target \
416         units/sysinit.target \
417         units/basic.target \
418         units/getty.target \
419         units/halt.target \
420         units/kexec.target \
421         units/local-fs.target \
422         units/local-fs-pre.target \
423         units/initrd.target \
424         units/initrd-fs.target \
425         units/initrd-root-fs.target \
426         units/remote-fs.target \
427         units/remote-fs-pre.target \
428         units/network.target \
429         units/network-pre.target \
430         units/network-online.target \
431         units/nss-lookup.target \
432         units/nss-user-lookup.target \
433         units/hibernate.target \
434         units/hybrid-sleep.target \
435         units/poweroff.target \
436         units/reboot.target \
437         units/rescue.target \
438         units/rpcbind.target \
439         units/time-sync.target \
440         units/shutdown.target \
441         units/final.target \
442         units/umount.target \
443         units/sigpwr.target \
444         units/sleep.target \
445         units/sockets.target \
446         units/busnames.target \
447         units/timers.target \
448         units/paths.target \
449         units/suspend.target \
450         units/swap.target \
451         units/slices.target \
452         units/system.slice \
453         units/x-.slice \
454         units/systemd-initctl.socket \
455         units/systemd-shutdownd.socket \
456         units/syslog.socket \
457         units/dev-hugepages.mount \
458         units/dev-mqueue.mount \
459         units/sys-kernel-config.mount \
460         units/sys-kernel-debug.mount \
461         units/sys-fs-fuse-connections.mount \
462         units/tmp.mount \
463         units/printer.target \
464         units/sound.target \
465         units/bluetooth.target \
466         units/smartcard.target \
467         units/systemd-ask-password-wall.path \
468         units/systemd-ask-password-console.path \
469         units/systemd-udevd-control.socket \
470         units/systemd-udevd-kernel.socket \
471         units/system-update.target \
472         units/initrd-switch-root.target \
473         units/ldconfig.service
474
475 nodist_systemunit_DATA = \
476         units/getty@.service \
477         units/serial-getty@.service \
478         units/console-shell.service \
479         units/console-getty.service \
480         units/container-getty@.service \
481         units/systemd-initctl.service \
482         units/systemd-shutdownd.service \
483         units/systemd-remount-fs.service \
484         units/systemd-update-utmp.service \
485         units/systemd-update-utmp-runlevel.service \
486         units/systemd-ask-password-wall.service \
487         units/systemd-ask-password-console.service \
488         units/systemd-sysctl.service \
489         units/emergency.service \
490         units/rescue.service \
491         units/user@.service \
492         units/systemd-hibernate.service \
493         units/systemd-hybrid-sleep.service \
494         units/systemd-suspend.service \
495         units/systemd-halt.service \
496         units/systemd-poweroff.service \
497         units/systemd-reboot.service \
498         units/systemd-kexec.service \
499         units/systemd-fsck@.service \
500         units/systemd-fsck-root.service \
501         units/systemd-udevd.service \
502         units/systemd-udev-trigger.service \
503         units/systemd-udev-settle.service \
504         units/systemd-udev-hwdb-update.service \
505         units/debug-shell.service \
506         units/initrd-parse-etc.service \
507         units/initrd-cleanup.service \
508         units/initrd-udevadm-cleanup-db.service \
509         units/initrd-switch-root.service \
510         units/systemd-nspawn@.service \
511         units/systemd-update-done.service
512
513 dist_userunit_DATA = \
514         units/user/basic.target \
515         units/user/default.target \
516         units/user/exit.target
517
518 nodist_userunit_DATA = \
519         units/user/systemd-exit.service
520
521 dist_systempreset_DATA = \
522         system-preset/90-systemd.preset
523
524 EXTRA_DIST += \
525         units/getty@.service.m4 \
526         units/serial-getty@.service.m4 \
527         units/console-shell.service.m4.in \
528         units/console-getty.service.m4.in \
529         units/container-getty@.service.m4.in \
530         units/rescue.service.m4.in \
531         units/systemd-initctl.service.in \
532         units/systemd-shutdownd.service.in \
533         units/systemd-remount-fs.service.in \
534         units/systemd-update-utmp.service.in \
535         units/systemd-update-utmp-runlevel.service.in \
536         units/systemd-ask-password-wall.service.in \
537         units/systemd-ask-password-console.service.in \
538         units/systemd-sysctl.service.in \
539         units/emergency.service.in \
540         units/systemd-halt.service.in \
541         units/systemd-poweroff.service.in \
542         units/systemd-reboot.service.in \
543         units/systemd-kexec.service.in \
544         units/user/systemd-exit.service.in \
545         units/systemd-fsck@.service.in \
546         units/systemd-fsck-root.service.in \
547         units/user@.service.in \
548         units/debug-shell.service.in \
549         units/systemd-hibernate.service.in \
550         units/systemd-hybrid-sleep.service.in \
551         units/systemd-suspend.service.in \
552         units/quotaon.service.in \
553         units/initrd-parse-etc.service.in \
554         units/initrd-cleanup.service.in \
555         units/initrd-udevadm-cleanup-db.service.in \
556         units/initrd-switch-root.service.in \
557         units/systemd-nspawn@.service.in \
558         units/systemd-update-done.service.in
559
560 CLEANFILES += \
561         units/console-shell.service.m4 \
562         units/console-getty.service.m4 \
563         units/container-getty@.service.m4 \
564         units/rescue.service.m4 \
565         units/user@.service.m4
566
567 if HAVE_SYSV_COMPAT
568 nodist_systemunit_DATA += \
569         units/rc-local.service \
570         units/halt-local.service
571
572 systemgenerator_PROGRAMS += \
573         systemd-sysv-generator \
574         systemd-rc-local-generator
575 endif
576
577 EXTRA_DIST += \
578         units/rc-local.service.in \
579         units/halt-local.service.in
580
581 # automake is broken and can't handle files with a dash in front
582 # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14728#8
583 units-install-hook:
584         mv $(DESTDIR)$(systemunitdir)/x-.slice $(DESTDIR)/$(systemunitdir)/-.slice
585
586 units-uninstall-hook:
587         rm -f $(DESTDIR)/$(systemunitdir)/-.slice
588
589 INSTALL_DATA_HOOKS += units-install-hook
590 UNINSTALL_DATA_HOOKS += units-uninstall-hook
591
592 dist_doc_DATA = \
593         README \
594         NEWS \
595         LICENSE.LGPL2.1 \
596         LICENSE.GPL2 \
597         LICENSE.MIT \
598         DISTRO_PORTING \
599         src/libsystemd/sd-bus/PORTING-DBUS1 \
600         src/libsystemd/sd-bus/DIFFERENCES \
601         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
602
603 @INTLTOOL_POLICY_RULE@
604
605 # ------------------------------------------------------------------------------
606
607 MANPAGES =
608 MANPAGES_ALIAS =
609
610 include Makefile-man.am
611
612 .PHONY: man update-man-list
613 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
614
615 XML_FILES = \
616         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
617 HTML_FILES = \
618         ${XML_FILES:.xml=.html}
619 HTML_ALIAS = \
620         ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
621
622 if ENABLE_MANPAGES
623 man_MANS = \
624         $(MANPAGES) \
625         $(MANPAGES_ALIAS)
626
627 noinst_DATA += \
628         $(HTML_FILES) \
629         $(HTML_ALIAS)
630
631 CLEANFILES += \
632         $(man_MANS) \
633         $(HTML_FILES) \
634         $(HTML_ALIAS)
635
636 docs/html/man:
637         $(AM_V_at)$(MKDIR_P) $(dir $@)
638         $(AM_V_LN)$(LN_S) -f ../../man $@
639
640 noinst_DATA += \
641         docs/html/man
642
643 CLEANFILES += \
644         docs/html/man
645
646 if HAVE_PYTHON
647 man/index.html: man/systemd.index.html
648         $(AM_V_LN)$(LN_S) -f systemd.index.html $@
649
650 noinst_DATA += \
651         man/index.html
652
653 CLEANFILES += \
654         man/index.html
655
656 XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml)
657 NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
658 SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))
659
660 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB)
661         $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
662         $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
663         @echo "Makefile-man.am has been regenerated"
664
665 man/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
666         $(AM_V_at)$(MKDIR_P) $(dir $@)
667         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
668
669 man/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py $(SOURCE_XML_FILES)
670         $(AM_V_at)$(MKDIR_P) $(dir $@)
671         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
672
673 EXTRA_DIST += \
674         man/systemd.index.xml \
675         man/index.html \
676         man/systemd.directives.xml
677
678 CLEANFILES += \
679         man/systemd.index.xml \
680         man/systemd.directives.xml
681
682 endif
683
684 endif
685
686 EXTRA_DIST += \
687         $(XML_FILES) \
688         $(HTML_FILES) \
689         $(HTML_ALIAS) \
690         $(man_MANS) \
691         tools/make-man-index.py \
692         tools/make-directive-index.py \
693         tools/make-man-rules.py \
694         tools/xml_helper.py
695
696 # ------------------------------------------------------------------------------
697 noinst_LTLIBRARIES += \
698         libsystemd-shared.la
699
700 libsystemd_shared_la_SOURCES = \
701         src/shared/linux/auto_dev-ioctl.h \
702         src/shared/linux/fanotify.h \
703         src/shared/ioprio.h \
704         src/shared/missing.h \
705         src/shared/initreq.h \
706         src/shared/securebits.h \
707         src/shared/special.h \
708         src/shared/list.h \
709         src/shared/macro.h \
710         src/shared/def.h \
711         src/shared/sparse-endian.h \
712         src/shared/refcnt.h \
713         src/shared/udev-util.h \
714         src/shared/bus-errors.h \
715         src/shared/device-nodes.c \
716         src/shared/device-nodes.h \
717         src/shared/util.c \
718         src/shared/util.h \
719         src/shared/virt.c \
720         src/shared/virt.h \
721         src/shared/architecture.c \
722         src/shared/architecture.h \
723         src/shared/efivars.c \
724         src/shared/efivars.h \
725         src/shared/path-util.c \
726         src/shared/path-util.h \
727         src/shared/time-util.c \
728         src/shared/time-util.h \
729         src/shared/locale-util.c \
730         src/shared/locale-util.h \
731         src/shared/hashmap.c \
732         src/shared/hashmap.h \
733         src/shared/siphash24.c \
734         src/shared/siphash24.h \
735         src/shared/set.c \
736         src/shared/set.h \
737         src/shared/fdset.c \
738         src/shared/fdset.h \
739         src/shared/prioq.c \
740         src/shared/prioq.h \
741         src/shared/sleep-config.c \
742         src/shared/sleep-config.h \
743         src/shared/strv.c \
744         src/shared/strv.h \
745         src/shared/env-util.c \
746         src/shared/env-util.h \
747         src/shared/strbuf.c \
748         src/shared/strbuf.h \
749         src/shared/strxcpyx.c \
750         src/shared/strxcpyx.h \
751         src/shared/conf-parser.c \
752         src/shared/conf-parser.h \
753         src/shared/log.c \
754         src/shared/log.h \
755         src/shared/ratelimit.h \
756         src/shared/ratelimit.c \
757         src/shared/exit-status.c \
758         src/shared/exit-status.h \
759         src/shared/utf8.c \
760         src/shared/utf8.h \
761         src/shared/gunicode.c \
762         src/shared/gunicode.h \
763         src/shared/pager.c \
764         src/shared/pager.h \
765         src/shared/socket-util.c \
766         src/shared/socket-util.h \
767         src/shared/in-addr-util.c \
768         src/shared/in-addr-util.h \
769         src/shared/conf-files.c \
770         src/shared/conf-files.h \
771         src/shared/cgroup-util.c \
772         src/shared/cgroup-util.h \
773         src/shared/cgroup-show.c \
774         src/shared/cgroup-show.h \
775         src/shared/unit-name.c \
776         src/shared/unit-name.h \
777         src/shared/utmp-wtmp.c \
778         src/shared/utmp-wtmp.h \
779         src/shared/watchdog.c \
780         src/shared/watchdog.h \
781         src/shared/spawn-ask-password-agent.c \
782         src/shared/spawn-ask-password-agent.h \
783         src/shared/replace-var.c \
784         src/shared/replace-var.h \
785         src/shared/spawn-polkit-agent.c \
786         src/shared/spawn-polkit-agent.h \
787         src/shared/clock-util.c \
788         src/shared/clock-util.h \
789         src/shared/time-dst.c \
790         src/shared/time-dst.h \
791         src/shared/calendarspec.c \
792         src/shared/calendarspec.h \
793         src/shared/fileio.c \
794         src/shared/fileio.h \
795         src/shared/output-mode.h \
796         src/shared/MurmurHash2.c \
797         src/shared/MurmurHash2.h \
798         src/shared/acpi-fpdt.h \
799         src/shared/acpi-fpdt.c \
800         src/shared/boot-timestamps.h \
801         src/shared/boot-timestamps.c \
802         src/shared/mkdir.c \
803         src/shared/mkdir.h \
804         src/shared/smack-util.c \
805         src/shared/smack-util.h \
806         src/shared/apparmor-util.c \
807         src/shared/apparmor-util.h \
808         src/shared/ima-util.c \
809         src/shared/ima-util.h \
810         src/shared/ptyfwd.c \
811         src/shared/ptyfwd.h \
812         src/shared/errno-list.c \
813         src/shared/errno-list.h \
814         src/shared/af-list.c \
815         src/shared/af-list.h \
816         src/shared/audit.c \
817         src/shared/audit.h \
818         src/shared/xml.c \
819         src/shared/xml.h \
820         src/shared/condition-util.c \
821         src/shared/condition-util.h \
822         src/shared/bus-label.c \
823         src/shared/bus-label.h \
824         src/shared/gpt.h \
825         src/shared/clean-ipc.h \
826         src/shared/clean-ipc.c \
827         src/shared/login-shared.c \
828         src/shared/login-shared.h \
829         src/shared/ring.c \
830         src/shared/ring.h \
831         src/shared/async.c \
832         src/shared/async.h \
833         src/shared/eventfd-util.c \
834         src/shared/eventfd-util.h \
835         src/shared/copy.c \
836         src/shared/copy.h \
837         src/shared/base-filesystem.c \
838         src/shared/base-filesystem.h \
839         src/shared/nss-util.h
840
841 nodist_libsystemd_shared_la_SOURCES = \
842         src/shared/errno-from-name.h \
843         src/shared/errno-to-name.h \
844         src/shared/af-from-name.h \
845         src/shared/af-to-name.h
846
847 libsystemd_shared_la_CFLAGS = \
848         $(AM_CFLAGS) \
849         $(SECCOMP_CFLAGS) \
850         -pthread
851
852 # ------------------------------------------------------------------------------
853 noinst_LTLIBRARIES += \
854         libsystemd-units.la
855
856 libsystemd_units_la_SOURCES = \
857         src/shared/install.c \
858         src/shared/install.h \
859         src/shared/install-printf.c \
860         src/shared/install-printf.h \
861         src/shared/path-lookup.c \
862         src/shared/path-lookup.h \
863         src/shared/specifier.c \
864         src/shared/specifier.h
865
866 # ------------------------------------------------------------------------------
867 noinst_LTLIBRARIES += \
868         libsystemd-label.la
869
870 libsystemd_label_la_SOURCES = \
871         src/shared/socket-label.c \
872         src/shared/label.c \
873         src/shared/label.h \
874         src/shared/selinux-util.c \
875         src/shared/selinux-util.h \
876         src/shared/mkdir-label.c \
877         src/shared/ask-password-api.c \
878         src/shared/ask-password-api.h \
879         src/shared/fileio-label.c \
880         src/shared/fileio-label.h \
881         src/shared/dev-setup.c \
882         src/shared/dev-setup.h \
883         src/shared/dropin.c \
884         src/shared/dropin.h \
885         src/shared/generator.h \
886         src/shared/generator.c
887
888 libsystemd_label_la_CFLAGS = \
889         $(AM_CFLAGS) \
890         $(SELINUX_CFLAGS)
891
892 libsystemd_label_la_LIBADD = \
893         $(SELINUX_LIBS)
894
895 # ------------------------------------------------------------------------------
896
897 if HAVE_SECCOMP
898 noinst_LTLIBRARIES += \
899         libsystemd-seccomp.la
900
901 libsystemd_seccomp_la_SOURCES = \
902         src/shared/seccomp-util.h \
903         src/shared/seccomp-util.c
904
905 libsystemd_seccomp_la_CFLAGS = \
906         $(AM_CFLAGS) \
907         $(SECCOMP_CFLAGS)
908
909 libsystemd_seccomp_la_LIBADD = \
910         $(SECCOMP_LIBS)
911 endif
912
913 # ------------------------------------------------------------------------------
914 noinst_LTLIBRARIES += \
915         libsystemd-logs.la
916
917 libsystemd_logs_la_SOURCES = \
918         src/shared/logs-show.c \
919         src/shared/logs-show.h
920
921 # ------------------------------------------------------------------------------
922 noinst_LTLIBRARIES += \
923         libsystemd-capability.la
924
925 libsystemd_capability_la_SOURCES = \
926         src/shared/capability.c \
927         src/shared/capability.h
928
929 libsystemd_capability_la_CFLAGS = \
930         $(AM_CFLAGS) \
931         $(CAP_CFLAGS)
932
933 libsystemd_capability_la_LIBADD = \
934         $(CAP_LIBS)
935
936 # ------------------------------------------------------------------------------
937 if HAVE_ACL
938 noinst_LTLIBRARIES += \
939         libsystemd-acl.la
940
941 libsystemd_acl_la_SOURCES = \
942         src/shared/acl-util.c \
943         src/shared/acl-util.h
944
945 libsystemd_acl_la_CFLAGS = \
946         $(AM_CFLAGS) \
947         $(ACL_CFLAGS)
948
949 libsystemd_acl_la_LIBADD = \
950         $(ACL_LIBS)
951 endif
952
953 # ------------------------------------------------------------------------------
954 noinst_LTLIBRARIES += \
955         libsystemd-core.la
956
957 libsystemd_core_la_SOURCES = \
958         src/core/unit.c \
959         src/core/unit.h \
960         src/core/unit-printf.c \
961         src/core/unit-printf.h \
962         src/core/job.c \
963         src/core/job.h \
964         src/core/manager.c \
965         src/core/manager.h \
966         src/core/transaction.c \
967         src/core/transaction.h \
968         src/core/load-fragment.c \
969         src/core/load-fragment.h \
970         src/core/service.c \
971         src/core/service.h \
972         src/core/socket.c \
973         src/core/socket.h \
974         src/core/busname.c \
975         src/core/busname.h \
976         src/core/target.c \
977         src/core/target.h \
978         src/core/snapshot.c \
979         src/core/snapshot.h \
980         src/core/device.c \
981         src/core/device.h \
982         src/core/mount.c \
983         src/core/mount.h \
984         src/core/automount.c \
985         src/core/automount.h \
986         src/core/swap.c \
987         src/core/swap.h \
988         src/core/timer.c \
989         src/core/timer.h \
990         src/core/path.c \
991         src/core/path.h \
992         src/core/slice.c \
993         src/core/slice.h \
994         src/core/scope.c \
995         src/core/scope.h \
996         src/core/load-dropin.c \
997         src/core/load-dropin.h \
998         src/core/execute.c \
999         src/core/execute.h \
1000         src/core/kill.c \
1001         src/core/kill.h \
1002         src/core/dbus.c \
1003         src/core/dbus.h \
1004         src/core/dbus-manager.c \
1005         src/core/dbus-manager.h \
1006         src/core/dbus-unit.c \
1007         src/core/dbus-unit.h \
1008         src/core/dbus-job.c \
1009         src/core/dbus-job.h \
1010         src/core/dbus-service.c \
1011         src/core/dbus-service.h \
1012         src/core/dbus-socket.c \
1013         src/core/dbus-socket.h \
1014         src/core/dbus-busname.c \
1015         src/core/dbus-busname.h \
1016         src/core/dbus-target.c \
1017         src/core/dbus-target.h \
1018         src/core/dbus-snapshot.c \
1019         src/core/dbus-snapshot.h \
1020         src/core/dbus-device.c \
1021         src/core/dbus-device.h \
1022         src/core/dbus-mount.c \
1023         src/core/dbus-mount.h \
1024         src/core/dbus-automount.c \
1025         src/core/dbus-automount.h \
1026         src/core/dbus-swap.c \
1027         src/core/dbus-swap.h \
1028         src/core/dbus-timer.c \
1029         src/core/dbus-timer.h \
1030         src/core/dbus-path.c \
1031         src/core/dbus-path.h \
1032         src/core/dbus-slice.c \
1033         src/core/dbus-slice.h \
1034         src/core/dbus-scope.c \
1035         src/core/dbus-scope.h \
1036         src/core/dbus-execute.c \
1037         src/core/dbus-execute.h \
1038         src/core/dbus-kill.c \
1039         src/core/dbus-kill.h \
1040         src/core/dbus-cgroup.c \
1041         src/core/dbus-cgroup.h \
1042         src/core/cgroup.c \
1043         src/core/cgroup.h \
1044         src/core/selinux-access.c \
1045         src/core/selinux-access.h \
1046         src/core/selinux-setup.c \
1047         src/core/selinux-setup.h \
1048         src/core/smack-setup.c \
1049         src/core/smack-setup.h \
1050         src/core/ima-setup.c \
1051         src/core/ima-setup.h \
1052         src/core/locale-setup.h \
1053         src/core/locale-setup.c \
1054         src/core/hostname-setup.c \
1055         src/core/hostname-setup.h \
1056         src/core/machine-id-setup.c \
1057         src/core/machine-id-setup.h \
1058         src/core/mount-setup.c \
1059         src/core/mount-setup.h \
1060         src/core/loopback-setup.h \
1061         src/core/loopback-setup.c \
1062         src/core/condition.c \
1063         src/core/condition.h \
1064         src/core/namespace.c \
1065         src/core/namespace.h \
1066         src/core/build.h \
1067         src/core/sysfs-show.h \
1068         src/core/switch-root.h \
1069         src/core/switch-root.c \
1070         src/core/killall.h \
1071         src/core/killall.c \
1072         src/core/audit-fd.c \
1073         src/core/audit-fd.h \
1074         src/core/show-status.c \
1075         src/core/show-status.h
1076
1077 if HAVE_KMOD
1078 libsystemd_core_la_SOURCES += \
1079         src/core/kmod-setup.c \
1080         src/core/kmod-setup.h
1081 endif
1082
1083 nodist_libsystemd_core_la_SOURCES = \
1084         src/core/load-fragment-gperf.c \
1085         src/core/load-fragment-gperf-nulstr.c
1086
1087 libsystemd_core_la_CFLAGS = \
1088         $(AM_CFLAGS) \
1089         $(PAM_CFLAGS) \
1090         $(AUDIT_CFLAGS) \
1091         $(CAP_CFLAGS) \
1092         $(KMOD_CFLAGS) \
1093         $(APPARMOR_CFLAGS) \
1094         $(SECCOMP_CFLAGS) \
1095         -pthread
1096
1097 libsystemd_core_la_LIBADD = \
1098         libsystemd-capability.la \
1099         libsystemd-units.la \
1100         libsystemd-label.la \
1101         libudev-internal.la \
1102         libsystemd-shared.la \
1103         libsystemd-internal.la \
1104         $(PAM_LIBS) \
1105         $(AUDIT_LIBS) \
1106         $(CAP_LIBS) \
1107         $(KMOD_LIBS) \
1108         $(APPARMOR_LIBS) \
1109         $(SECCOMP_LIBS)
1110
1111 if HAVE_SECCOMP
1112 libsystemd_core_la_LIBADD += \
1113         libsystemd-seccomp.la
1114 endif
1115
1116 src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
1117         $(AM_V_at)$(MKDIR_P) $(dir $@)
1118         $(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 ";" }' < $< > $@
1119
1120 EXTRA_DIST += \
1121         src/core/load-fragment-gperf.gperf.m4
1122
1123 CLEANFILES += \
1124         src/core/load-fragment-gperf.gperf \
1125         src/core/load-fragment-gperf.c \
1126         src/core/load-fragment-gperf-nulstr.c \
1127         src/shared/errno-list.txt \
1128         src/shared/errno-from-name.gperf \
1129         src/shared/af-list.txt \
1130         src/shared/af-from-name.gperf
1131
1132 BUILT_SOURCES += \
1133         src/shared/errno-from-name.h \
1134         src/shared/errno-to-name.h \
1135         src/shared/af-from-name.h \
1136         src/shared/af-to-name.h
1137
1138 src/shared/errno-list.txt:
1139         $(AM_V_at)$(MKDIR_P) $(dir $@)
1140         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }'  > $@
1141
1142 src/shared/errno-from-name.gperf: src/shared/errno-list.txt
1143         $(AM_V_at)$(MKDIR_P) $(dir $@)
1144         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct errno_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
1145
1146 src/shared/errno-from-name.h: src/shared/errno-from-name.gperf
1147         $(AM_V_at)$(MKDIR_P) $(dir $@)
1148         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_errno -H hash_errno_name -p -C < $< > $@
1149
1150 src/shared/errno-to-name.h: src/shared/errno-list.txt
1151         $(AM_V_at)$(MKDIR_P) $(dir $@)
1152         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
1153
1154 src/shared/af-list.txt:
1155         $(AM_V_at)$(MKDIR_P) $(dir $@)
1156         $(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; }'  > $@
1157
1158 src/shared/af-from-name.gperf: src/shared/af-list.txt
1159         $(AM_V_at)$(MKDIR_P) $(dir $@)
1160         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct af_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
1161
1162 src/shared/af-from-name.h: src/shared/af-from-name.gperf
1163         $(AM_V_at)$(MKDIR_P) $(dir $@)
1164         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_af -H hash_af_name -p -C < $< > $@
1165
1166 src/shared/af-to-name.h: src/shared/af-list.txt
1167         $(AM_V_at)$(MKDIR_P) $(dir $@)
1168         $(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 "};"}' < $< > $@
1169
1170 # ------------------------------------------------------------------------------
1171 systemd_SOURCES = \
1172         src/core/main.c
1173
1174 systemd_CFLAGS = \
1175         $(AM_CFLAGS) \
1176         $(SECCOMP_CFLAGS)
1177
1178 systemd_LDADD = \
1179         libsystemd-core.la \
1180         $(RT_LIBS)
1181
1182 dist_pkgsysconf_DATA += \
1183         src/core/system.conf \
1184         src/core/user.conf
1185
1186 dist_dbuspolicy_DATA += \
1187         src/core/org.freedesktop.systemd1.conf
1188
1189 dist_dbussystemservice_DATA += \
1190         src/core/org.freedesktop.systemd1.service
1191
1192 polkitpolicy_in_in_files += \
1193         src/core/org.freedesktop.systemd1.policy.in.in
1194
1195 pkgconfigdata_DATA = \
1196         src/core/systemd.pc
1197
1198 nodist_rpmmacros_DATA = \
1199         src/core/macros.systemd
1200
1201 EXTRA_DIST += \
1202         src/core/systemd.pc.in \
1203         src/core/macros.systemd.in
1204
1205 CLEANFILES += \
1206         src/core/macros.systemd \
1207         src/core/org.freedesktop.systemd1.policy.in
1208
1209 # ------------------------------------------------------------------------------
1210 manual_tests += \
1211         test-engine \
1212         test-ns \
1213         test-loopback \
1214         test-hostname \
1215         test-daemon \
1216         test-cgroup \
1217         test-cgroup-mask \
1218         test-install \
1219         test-watchdog \
1220         test-log \
1221         test-ipcrm
1222
1223 if HAVE_KMOD
1224 manual_tests += \
1225         test-rtnl-manual
1226 endif
1227
1228 tests += \
1229         test-job-type \
1230         test-env-replace \
1231         test-strbuf \
1232         test-strv \
1233         test-path-util \
1234         test-strxcpyx \
1235         test-unit-name \
1236         test-unit-file \
1237         test-utf8 \
1238         test-ellipsize \
1239         test-util \
1240         test-ring \
1241         test-tmpfiles \
1242         test-namespace \
1243         test-date \
1244         test-sleep \
1245         test-replace-var \
1246         test-sched-prio \
1247         test-calendarspec \
1248         test-strip-tab-ansi \
1249         test-cgroup-util \
1250         test-prioq \
1251         test-fileio \
1252         test-time \
1253         test-hashmap \
1254         test-list \
1255         test-tables \
1256         test-device-nodes \
1257         test-xml \
1258         test-architecture \
1259         test-socket-util \
1260         test-fdset \
1261         test-conf-files \
1262         test-capability \
1263         test-async \
1264         test-ratelimit
1265
1266 EXTRA_DIST += \
1267         test/sched_idle_bad.service \
1268         test/sched_idle_ok.service \
1269         test/sched_rr_bad.service \
1270         test/sched_rr_ok.service \
1271         test/sched_rr_change.service \
1272         test/son.service \
1273         test/daughter.service \
1274         test/parent.slice
1275
1276 EXTRA_DIST += \
1277         src/test/test-helper.h
1278
1279 test_device_nodes_SOURCES = \
1280         src/test/test-device-nodes.c
1281
1282 test_device_nodes_LDADD = \
1283         libsystemd-shared.la
1284
1285 test_engine_SOURCES = \
1286         src/test/test-engine.c
1287
1288 test_engine_CFLAGS = \
1289         $(AM_CFLAGS) \
1290         $(SECCOMP_CFLAGS)
1291
1292 test_engine_LDADD = \
1293         libsystemd-core.la \
1294         $(RT_LIBS)
1295
1296 test_job_type_SOURCES = \
1297         src/test/test-job-type.c
1298
1299 test_job_type_CFLAGS = \
1300         $(AM_CFLAGS) \
1301         $(SECCOMP_CFLAGS)
1302
1303 test_job_type_LDADD = \
1304         libsystemd-core.la \
1305         $(RT_LIBS)
1306
1307 test_ns_SOURCES = \
1308         src/test/test-ns.c
1309
1310 test_ns_CFLAGS = \
1311         $(AM_CFLAGS) \
1312         $(SECCOMP_CFLAGS)
1313
1314 test_ns_LDADD = \
1315         libsystemd-core.la
1316
1317 test_loopback_SOURCES = \
1318         src/test/test-loopback.c
1319
1320 test_loopback_LDADD = \
1321         libsystemd-core.la
1322
1323 test_hostname_SOURCES = \
1324         src/test/test-hostname.c
1325
1326 test_hostname_LDADD = \
1327         libsystemd-core.la
1328
1329 if ENABLE_EFI
1330 manual_tests += \
1331         test-boot-timestamp
1332
1333 test_boot_timestamp_SOURCES = \
1334         src/test/test-boot-timestamps.c
1335
1336 test_boot_timestamp_LDADD = \
1337         libsystemd-shared.la
1338 endif
1339
1340 test_unit_name_SOURCES = \
1341         src/test/test-unit-name.c
1342
1343 test_unit_name_CFLAGS = \
1344         $(AM_CFLAGS) \
1345         $(SECCOMP_CFLAGS)
1346
1347 test_unit_name_LDADD = \
1348         libsystemd-core.la \
1349         $(RT_LIBS)
1350
1351 test_unit_file_SOURCES = \
1352         src/test/test-unit-file.c
1353
1354 test_unit_file_CFLAGS = \
1355         $(AM_CFLAGS) \
1356         $(SECCOMP_CFLAGS)
1357
1358 test_unit_file_LDADD = \
1359         libsystemd-core.la \
1360         $(RT_LIBS)
1361
1362 test_utf8_SOURCES = \
1363         src/test/test-utf8.c
1364
1365 test_utf8_LDADD = \
1366         libsystemd-shared.la
1367
1368 test_capability_SOURCES = \
1369         src/test/test-capability.c
1370
1371 test_capability_LDADD = \
1372         libsystemd-shared.la \
1373         libsystemd-capability.la
1374
1375 test_async_SOURCES = \
1376         src/test/test-async.c
1377
1378 test_async_LDADD = \
1379         libsystemd-shared.la
1380
1381 test_fdset_SOURCES = \
1382         src/test/test-fdset.c
1383
1384 test_fdset_LDADD = \
1385         libsystemd-core.la
1386
1387 test_ratelimit_SOURCES = \
1388         src/test/test-ratelimit.c
1389
1390 test_ratelimit_LDADD = \
1391         libsystemd-shared.la
1392
1393 test_util_SOURCES = \
1394         src/test/test-util.c
1395
1396 test_util_LDADD = \
1397         libsystemd-core.la
1398
1399 test_socket_util_SOURCES = \
1400         src/test/test-socket-util.c
1401
1402 test_socket_util_LDADD = \
1403         libsystemd-core.la
1404
1405 test_ring_SOURCES = \
1406         src/test/test-ring.c
1407
1408 test_ring_LDADD = \
1409         libsystemd-core.la
1410
1411 test_tmpfiles_SOURCES = \
1412         src/test/test-tmpfiles.c
1413
1414 test_tmpfiles_LDADD = \
1415         libsystemd-shared.la
1416
1417 test_namespace_SOURCES = \
1418         src/test/test-namespace.c
1419
1420 test_namespace_LDADD = \
1421         libsystemd-core.la
1422
1423 test_hashmap_SOURCES = \
1424         src/test/test-hashmap.c
1425
1426 test_hashmap_LDADD = \
1427         libsystemd-core.la
1428
1429 test_xml_SOURCES = \
1430         src/test/test-xml.c
1431
1432 test_xml_LDADD = \
1433         libsystemd-shared.la
1434
1435 test_list_SOURCES = \
1436         src/test/test-list.c
1437
1438 test_list_LDADD = \
1439         libsystemd-core.la
1440
1441 test_tables_SOURCES = \
1442         src/test/test-tables.c \
1443         src/shared/test-tables.h
1444
1445 test_tables_CFLAGS = \
1446         $(AM_CFLAGS) \
1447         $(SECCOMP_CFLAGS)
1448
1449 test_tables_LDADD = \
1450         libsystemd-logs.la \
1451         libsystemd-journal-internal.la \
1452         libsystemd-core.la \
1453         $(RT_LIBS)
1454
1455 test_prioq_SOURCES = \
1456         src/test/test-prioq.c
1457
1458 test_prioq_LDADD = \
1459         libsystemd-core.la
1460
1461 test_fileio_SOURCES = \
1462         src/test/test-fileio.c
1463
1464 test_fileio_LDADD = \
1465         libsystemd-core.la
1466
1467 test_time_SOURCES = \
1468         src/test/test-time.c
1469
1470 test_time_LDADD = \
1471         libsystemd-core.la
1472
1473 test_architecture_SOURCES = \
1474         src/test/test-architecture.c
1475
1476 test_architecture_LDADD = \
1477         libsystemd-shared.la
1478
1479 test_log_SOURCES = \
1480         src/test/test-log.c
1481
1482 test_log_LDADD = \
1483         libsystemd-core.la
1484
1485 test_ipcrm_SOURCES = \
1486         src/test/test-ipcrm.c
1487
1488 test_ipcrm_LDADD = \
1489         libsystemd-shared.la \
1490         -lrt
1491
1492 test_rtnl_manual_SOURCES = \
1493         src/test/test-rtnl-manual.c
1494
1495 test_rtnl_manual_CFLAGS = \
1496         $(AM_CFLAGS) \
1497         $(KMOD_CFLAGS)
1498
1499 test_rtnl_manual_LDADD = \
1500         libsystemd-internal.la \
1501         libsystemd-shared.la \
1502         $(KMOD_LIBS)
1503
1504 test_ellipsize_SOURCES = \
1505         src/test/test-ellipsize.c
1506
1507 test_ellipsize_LDADD = \
1508         libsystemd-core.la
1509
1510 test_date_SOURCES = \
1511         src/test/test-date.c
1512
1513 test_date_LDADD = \
1514         libsystemd-core.la
1515
1516 test_sleep_SOURCES = \
1517         src/test/test-sleep.c
1518
1519 test_sleep_LDADD = \
1520         libsystemd-core.la
1521
1522 test_replace_var_SOURCES = \
1523         src/test/test-replace-var.c
1524
1525 test_replace_var_LDADD = \
1526         libsystemd-shared.la
1527
1528 test_calendarspec_SOURCES = \
1529         src/test/test-calendarspec.c
1530
1531 test_calendarspec_LDADD = \
1532         libsystemd-shared.la
1533
1534 test_strip_tab_ansi_SOURCES = \
1535         src/test/test-strip-tab-ansi.c
1536
1537 test_strip_tab_ansi_LDADD = \
1538         libsystemd-shared.la
1539
1540 test_daemon_SOURCES = \
1541         src/test/test-daemon.c
1542
1543 test_daemon_LDADD = \
1544         libsystemd-internal.la \
1545         libsystemd-shared.la
1546
1547 test_cgroup_SOURCES = \
1548         src/test/test-cgroup.c
1549
1550 test_cgroup_LDADD = \
1551         libsystemd-label.la \
1552         libsystemd-shared.la \
1553         libsystemd-internal.la
1554
1555 test_cgroup_mask_SOURCES = \
1556         src/test/test-cgroup-mask.c
1557
1558 test_cgroup_mask_CPPFLAGS = \
1559         $(AM_CPPFLAGS) \
1560         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1561
1562 test_cgroup_mask_CFLAGS = \
1563         $(AM_CFLAGS) \
1564         $(SECCOMP_CFLAGS)
1565
1566 test_cgroup_mask_LDADD = \
1567         libsystemd-core.la \
1568         $(RT_LIBS)
1569
1570 test_cgroup_util_SOURCES = \
1571         src/test/test-cgroup-util.c
1572
1573 test_cgroup_util_LDADD = \
1574         libsystemd-label.la \
1575         libsystemd-internal.la \
1576         libsystemd-shared.la
1577
1578 test_env_replace_SOURCES = \
1579         src/test/test-env-replace.c
1580
1581 test_env_replace_LDADD = \
1582         libsystemd-shared.la
1583
1584 test_strbuf_SOURCES = \
1585         src/test/test-strbuf.c
1586
1587 test_strbuf_LDADD = \
1588         libsystemd-shared.la
1589
1590 test_strv_SOURCES = \
1591         src/test/test-strv.c
1592
1593 test_strv_LDADD = \
1594         libsystemd-units.la \
1595         libsystemd-internal.la \
1596         libsystemd-shared.la
1597
1598 test_path_util_SOURCES = \
1599         src/test/test-path-util.c
1600
1601 test_path_util_LDADD = \
1602         libsystemd-shared.la
1603
1604 test_strxcpyx_SOURCES = \
1605         src/test/test-strxcpyx.c
1606
1607 test_strxcpyx_LDADD = \
1608         libsystemd-shared.la
1609
1610 test_install_SOURCES = \
1611         src/test/test-install.c
1612
1613 test_install_LDADD = \
1614         libsystemd-units.la \
1615         libsystemd-label.la \
1616         libsystemd-shared.la \
1617         libsystemd-internal.la
1618
1619 test_watchdog_SOURCES = \
1620         src/test/test-watchdog.c
1621
1622 test_watchdog_LDADD = \
1623         libsystemd-shared.la
1624
1625 test_sched_prio_SOURCES = \
1626         src/test/test-sched-prio.c
1627
1628 test_sched_prio_CPPFLAGS = \
1629         $(AM_CPPFLAGS) \
1630         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1631
1632 test_sched_prio_CFLAGS = \
1633         $(AM_CFLAGS) \
1634         $(SECCOMP_CFLAGS)
1635
1636 test_sched_prio_LDADD = \
1637         libsystemd-core.la \
1638         $(RT_LIBS)
1639
1640 test_conf_files_SOURCES = \
1641         src/test/test-conf-files.c
1642
1643 test_conf_files_LDADD = \
1644         libsystemd-shared.la
1645
1646 # ------------------------------------------------------------------------------
1647 ## .PHONY so it always rebuilds it
1648 .PHONY: coverage lcov-run lcov-report coverage-sync
1649
1650 # run lcov from scratch, always
1651 coverage: all
1652         $(MAKE) lcov-run
1653         $(MAKE) lcov-report
1654
1655 coverage_dir = coverage
1656 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
1657
1658 if ENABLE_COVERAGE
1659 # reset run coverage tests
1660 lcov-run:
1661         @rm -rf $(coverage_dir)
1662         lcov $(coverage_opts) --zerocounters
1663         -$(MAKE) check
1664
1665 # generate report based on current coverage data
1666 lcov-report:
1667         $(MKDIR_P) $(coverage_dir)
1668         lcov $(coverage_opts) --compat-libtool --capture --no-external \
1669                 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
1670         genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov.info
1671         @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
1672
1673 # lcov doesn't work properly with vpath builds, make sure that bad
1674 # output is not uploaded by mistake.
1675 coverage-sync: coverage
1676         test "$(builddir)" = "$(srcdir)"
1677         rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
1678
1679 else
1680 lcov-run lcov-report:
1681         echo "Need to reconfigure with --enable-coverage"
1682 endif
1683
1684 # ------------------------------------------------------------------------------
1685 systemd_analyze_SOURCES = \
1686         src/analyze/analyze.c
1687
1688 systemd_analyze_LDADD = \
1689         libsystemd-internal.la \
1690         libsystemd-shared.la
1691
1692 # ------------------------------------------------------------------------------
1693 systemd_initctl_SOURCES = \
1694         src/initctl/initctl.c
1695
1696 systemd_initctl_LDADD = \
1697         libsystemd-internal.la \
1698         libsystemd-shared.la
1699
1700 # ------------------------------------------------------------------------------
1701 systemd_update_utmp_SOURCES = \
1702         src/update-utmp/update-utmp.c
1703
1704 systemd_update_utmp_CFLAGS = \
1705         $(AM_CFLAGS) \
1706         $(AUDIT_CFLAGS)
1707
1708 systemd_update_utmp_LDADD = \
1709         libsystemd-internal.la \
1710         libsystemd-shared.la \
1711         $(AUDIT_LIBS)
1712
1713 # ------------------------------------------------------------------------------
1714 systemd_update_done_SOURCES = \
1715         src/update-done/update-done.c
1716
1717 systemd_update_done_LDADD = \
1718         libsystemd-internal.la \
1719         libsystemd-shared.la
1720
1721 # ------------------------------------------------------------------------------
1722 systemd_shutdownd_SOURCES = \
1723         src/shutdownd/shutdownd.c
1724
1725 systemd_shutdownd_LDADD = \
1726         libsystemd-label.la \
1727         libsystemd-internal.la \
1728         libsystemd-shared.la
1729
1730 dist_doc_DATA += \
1731         src/systemd/sd-shutdown.h
1732
1733 # ------------------------------------------------------------------------------
1734 systemd_shutdown_SOURCES = \
1735         src/core/umount.c \
1736         src/core/umount.h \
1737         src/core/shutdown.c \
1738         src/core/mount-setup.c \
1739         src/core/mount-setup.h \
1740         src/core/killall.h \
1741         src/core/killall.c
1742
1743 systemd_shutdown_LDADD = \
1744         libsystemd-label.la \
1745         libudev-internal.la \
1746         libsystemd-shared.la
1747
1748 # ------------------------------------------------------------------------------
1749 if HAVE_KMOD
1750 systemd_modules_load_SOURCES = \
1751         src/modules-load/modules-load.c
1752
1753 systemd_modules_load_CFLAGS = \
1754         $(AM_CFLAGS) \
1755         $(KMOD_CFLAGS)
1756
1757 systemd_modules_load_LDADD = \
1758         libsystemd-shared.la \
1759         $(KMOD_LIBS)
1760
1761 rootlibexec_PROGRAMS += \
1762         systemd-modules-load
1763
1764 nodist_systemunit_DATA += \
1765         units/systemd-modules-load.service
1766
1767 SYSINIT_TARGET_WANTS += \
1768         systemd-modules-load.service
1769
1770 if ENABLE_TMPFILES
1771 nodist_systemunit_DATA += \
1772         units/kmod-static-nodes.service
1773
1774 SYSINIT_TARGET_WANTS += \
1775         kmod-static-nodes.service
1776 endif
1777 endif
1778
1779 EXTRA_DIST += \
1780         units/systemd-modules-load.service.in \
1781         units/kmod-static-nodes.service.in
1782
1783 # ------------------------------------------------------------------------------
1784 if ENABLE_TMPFILES
1785 systemd_tmpfiles_SOURCES = \
1786         src/tmpfiles/tmpfiles.c
1787
1788 systemd_tmpfiles_LDADD = \
1789         libsystemd-units.la \
1790         libsystemd-label.la \
1791         libsystemd-capability.la \
1792         libsystemd-internal.la \
1793         libsystemd-shared.la
1794
1795 rootbin_PROGRAMS += \
1796         systemd-tmpfiles
1797
1798 dist_systemunit_DATA += \
1799         units/systemd-tmpfiles-clean.timer
1800
1801 nodist_systemunit_DATA += \
1802         units/systemd-tmpfiles-setup-dev.service \
1803         units/systemd-tmpfiles-setup.service \
1804         units/systemd-tmpfiles-clean.service
1805
1806 dist_tmpfiles_DATA = \
1807         tmpfiles.d/systemd.conf \
1808         tmpfiles.d/systemd-nologin.conf \
1809         tmpfiles.d/tmp.conf \
1810         tmpfiles.d/x11.conf \
1811         tmpfiles.d/var.conf \
1812         tmpfiles.d/etc.conf
1813
1814 if HAVE_SYSV_COMPAT
1815 dist_tmpfiles_DATA += \
1816         tmpfiles.d/legacy.conf
1817 endif
1818
1819 SYSINIT_TARGET_WANTS += \
1820         systemd-tmpfiles-setup-dev.service \
1821         systemd-tmpfiles-setup.service
1822
1823 dist_zshcompletion_DATA += \
1824         shell-completion/zsh/_systemd-tmpfiles
1825
1826 TIMERS_TARGET_WANTS += \
1827         systemd-tmpfiles-clean.timer
1828
1829 INSTALL_DIRS += \
1830         $(tmpfilesdir) \
1831         $(sysconfdir)/tmpfiles.d
1832 endif
1833
1834 EXTRA_DIST += \
1835         units/systemd-tmpfiles-setup-dev.service.in \
1836         units/systemd-tmpfiles-setup.service.in \
1837         units/systemd-tmpfiles-clean.service.in
1838
1839 # ------------------------------------------------------------------------------
1840 if ENABLE_SYSUSERS
1841 systemd_sysusers_SOURCES = \
1842         src/sysusers/sysusers.c
1843
1844 systemd_sysusers_LDADD = \
1845         libsystemd-units.la \
1846         libsystemd-label.la \
1847         libsystemd-capability.la \
1848         libsystemd-internal.la \
1849         libsystemd-shared.la
1850
1851 rootbin_PROGRAMS += \
1852         systemd-sysusers
1853
1854 nodist_systemunit_DATA += \
1855         units/systemd-sysusers.service
1856
1857 SYSINIT_TARGET_WANTS += \
1858         systemd-sysusers.service
1859
1860 dist_sysusers_DATA = \
1861         sysusers.d/systemd.conf
1862
1863 nodist_sysusers_DATA = \
1864         sysusers.d/basic.conf
1865
1866 EXTRA_DIST += \
1867         units/systemd-sysusers.service.in \
1868         sysusers.d/basic.conf.in
1869
1870 CLEANFILES += \
1871         sysusers.d/basic.conf
1872
1873 INSTALL_DIRS += \
1874         $(sysusersdir)
1875 endif
1876
1877 # ------------------------------------------------------------------------------
1878 if ENABLE_FIRSTBOOT
1879 systemd_firstboot_SOURCES = \
1880         src/firstboot/firstboot.c
1881
1882 systemd_firstboot_LDADD = \
1883         libsystemd-units.la \
1884         libsystemd-label.la \
1885         libsystemd-capability.la \
1886         libsystemd-internal.la \
1887         libsystemd-shared.la \
1888         -lcrypt
1889
1890 rootbin_PROGRAMS += \
1891         systemd-firstboot
1892
1893 nodist_systemunit_DATA += \
1894         units/systemd-firstboot.service
1895
1896 EXTRA_DIST += \
1897         units/systemd-firstboot.service.in
1898
1899 SYSINIT_TARGET_WANTS += \
1900         systemd-firstboot.service
1901
1902 endif
1903
1904 # ------------------------------------------------------------------------------
1905 systemd_machine_id_setup_SOURCES = \
1906         src/machine-id-setup/machine-id-setup-main.c \
1907         src/core/machine-id-setup.c \
1908         src/core/machine-id-setup.h
1909
1910 systemd_machine_id_setup_LDADD = \
1911         libsystemd-label.la \
1912         libsystemd-internal.la \
1913         libsystemd-shared.la
1914
1915 # ------------------------------------------------------------------------------
1916 systemd_sysctl_SOURCES = \
1917         src/sysctl/sysctl.c
1918
1919 systemd_sysctl_LDADD = \
1920         libsystemd-shared.la
1921
1922 # ------------------------------------------------------------------------------
1923 systemd_sleep_SOURCES = \
1924         src/sleep/sleep.c
1925
1926 systemd_sleep_LDADD = \
1927         libsystemd-shared.la
1928
1929 # ------------------------------------------------------------------------------
1930 systemd_fsck_SOURCES = \
1931         src/fsck/fsck.c
1932
1933 systemd_fsck_LDADD = \
1934         libsystemd-internal.la \
1935         libudev-internal.la \
1936         libsystemd-shared.la
1937
1938 # ------------------------------------------------------------------------------
1939 systemd_ac_power_SOURCES = \
1940         src/ac-power/ac-power.c
1941
1942 systemd_ac_power_LDADD = \
1943         libudev-internal.la \
1944         libsystemd-shared.la
1945
1946 # ------------------------------------------------------------------------------
1947 systemd_detect_virt_SOURCES = \
1948         src/detect-virt/detect-virt.c
1949
1950 systemd_detect_virt_LDADD = \
1951         libsystemd-shared.la
1952
1953 INSTALL_EXEC_HOOKS += \
1954         systemd-detect-virt-install-hook
1955
1956 # ------------------------------------------------------------------------------
1957 systemd_delta_SOURCES = \
1958         src/delta/delta.c
1959
1960 systemd_delta_LDADD = \
1961         libsystemd-shared.la
1962
1963 # ------------------------------------------------------------------------------
1964 systemd_getty_generator_SOURCES = \
1965         src/getty-generator/getty-generator.c
1966
1967 systemd_getty_generator_LDADD = \
1968         libsystemd-label.la \
1969         libsystemd-shared.la
1970
1971 # ------------------------------------------------------------------------------
1972 systemd_debug_generator_SOURCES = \
1973         src/debug-generator/debug-generator.c
1974
1975 systemd_debug_generator_LDADD = \
1976         libsystemd-label.la \
1977         libsystemd-shared.la
1978
1979 # ------------------------------------------------------------------------------
1980 systemd_fstab_generator_SOURCES = \
1981         src/fstab-generator/fstab-generator.c \
1982         src/core/mount-setup.c
1983
1984 systemd_fstab_generator_LDADD = \
1985         libsystemd-label.la \
1986         libsystemd-shared.la
1987
1988 # ------------------------------------------------------------------------------
1989 systemd_system_update_generator_SOURCES = \
1990         src/system-update-generator/system-update-generator.c
1991
1992 systemd_system_update_generator_LDADD = \
1993         libsystemd-label.la \
1994         libsystemd-shared.la
1995
1996 if ENABLE_EFI
1997 # ------------------------------------------------------------------------------
1998 systemgenerator_PROGRAMS +=  \
1999         systemd-efi-boot-generator
2000
2001 systemd_efi_boot_generator_SOURCES = \
2002         src/efi-boot-generator/efi-boot-generator.c
2003
2004 systemd_efi_boot_generator_LDADD = \
2005         libsystemd-label.la \
2006         libsystemd-shared.la
2007
2008 # ------------------------------------------------------------------------------
2009 bootctl_SOURCES = \
2010         src/boot/boot.h \
2011         src/boot/boot-loader.h \
2012         src/boot/bootctl.c \
2013         src/boot/boot-loader.c \
2014         src/boot/boot-efi.c
2015
2016 bootctl_LDADD = \
2017         libsystemd-shared.la \
2018         libsystemd-internal.la
2019
2020 bin_PROGRAMS += \
2021         bootctl
2022
2023 dist_bashcompletion_DATA += \
2024         shell-completion/bash/bootctl
2025
2026 dist_zshcompletion_DATA += \
2027         shell-completion/zsh/_bootctl
2028
2029 endif
2030
2031 # ------------------------------------------------------------------------------
2032 if HAVE_BLKID
2033 systemgenerator_PROGRAMS +=  \
2034         systemd-gpt-auto-generator
2035
2036 systemd_gpt_auto_generator_SOURCES = \
2037         src/gpt-auto-generator/gpt-auto-generator.c \
2038         src/shared/blkid-util.h
2039
2040 systemd_gpt_auto_generator_LDADD = \
2041         libsystemd-label.la \
2042         libsystemd-internal.la \
2043         libudev-internal.la \
2044         libsystemd-shared.la \
2045         $(BLKID_LIBS)
2046
2047 systemd_gpt_auto_generator_CFLAGS = \
2048         $(AM_CFLAGS) \
2049         $(BLKID_CFLAGS)
2050 endif
2051
2052 # ------------------------------------------------------------------------------
2053 if ENABLE_KDBUS
2054 systemgenerator_PROGRAMS +=  \
2055         systemd-dbus1-generator
2056
2057 systemd_dbus1_generator_SOURCES = \
2058         src/dbus1-generator/dbus1-generator.c
2059
2060 systemd_dbus1_generator_LDADD = \
2061         libsystemd-label.la \
2062         libsystemd-shared.la \
2063         libsystemd-internal.la
2064
2065 dbus1-generator-install-hook:
2066         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
2067         $(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2068         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2069
2070 dbus1-generator-uninstall-hook:
2071         rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
2072
2073 INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
2074 UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
2075 endif
2076
2077 # ------------------------------------------------------------------------------
2078 systemd_sysv_generator_SOURCES = \
2079         src/sysv-generator/sysv-generator.c
2080
2081 systemd_sysv_generator_LDADD = \
2082         libsystemd-core.la \
2083         libsystemd-label.la \
2084         libsystemd-shared.la
2085
2086 # ------------------------------------------------------------------------------
2087 systemd_rc_local_generator_SOURCES = \
2088         src/rc-local-generator/rc-local-generator.c
2089
2090 systemd_rc_local_generator_LDADD = \
2091         libsystemd-label.la \
2092         libsystemd-shared.la
2093
2094 # ------------------------------------------------------------------------------
2095 systemd_remount_fs_SOURCES = \
2096         src/remount-fs/remount-fs.c \
2097         src/core/mount-setup.c \
2098         src/core/mount-setup.h
2099
2100 systemd_remount_fs_LDADD = \
2101         libsystemd-label.la \
2102         libsystemd-shared.la
2103
2104 # ------------------------------------------------------------------------------
2105 systemd_cgroups_agent_SOURCES = \
2106         src/cgroups-agent/cgroups-agent.c
2107
2108 systemd_cgroups_agent_LDADD = \
2109         libsystemd-internal.la \
2110         libsystemd-shared.la
2111
2112 # ------------------------------------------------------------------------------
2113 systemd_escape_SOURCES = \
2114         src/escape/escape.c
2115
2116 systemd_escape_LDADD = \
2117         libsystemd-shared.la
2118
2119 # -----------------------------------------------------------------------------
2120 systemctl_SOURCES = \
2121         src/systemctl/systemctl.c
2122
2123 systemctl_LDADD = \
2124         libsystemd-units.la \
2125         libsystemd-label.la \
2126         libsystemd-internal.la \
2127         libsystemd-logs.la \
2128         libsystemd-journal-internal.la \
2129         libsystemd-shared.la
2130
2131 # ------------------------------------------------------------------------------
2132 systemd_notify_SOURCES = \
2133         src/notify/notify.c \
2134         src/readahead/sd-readahead.c
2135
2136 systemd_notify_LDADD = \
2137         libsystemd-internal.la \
2138         libsystemd-shared.la
2139
2140 # ------------------------------------------------------------------------------
2141 systemd_path_SOURCES = \
2142         src/path/path.c
2143
2144 systemd_path_LDADD = \
2145         libsystemd-internal.la \
2146         libsystemd-shared.la
2147
2148 # ------------------------------------------------------------------------------
2149 systemd_ask_password_SOURCES = \
2150         src/ask-password/ask-password.c
2151
2152 systemd_ask_password_LDADD = \
2153         libsystemd-label.la \
2154         libsystemd-shared.la
2155
2156 # ------------------------------------------------------------------------------
2157 systemd_reply_password_SOURCES = \
2158         src/reply-password/reply-password.c
2159
2160 systemd_reply_password_LDADD = \
2161         libsystemd-shared.la
2162
2163 # ------------------------------------------------------------------------------
2164 systemd_cgls_SOURCES = \
2165         src/cgls/cgls.c
2166
2167 systemd_cgls_LDADD = \
2168         libsystemd-internal.la \
2169         libsystemd-shared.la
2170
2171 # ------------------------------------------------------------------------------
2172 systemd_cgtop_SOURCES = \
2173         src/cgtop/cgtop.c
2174
2175 systemd_cgtop_LDADD = \
2176         libsystemd-shared.la
2177
2178 # ------------------------------------------------------------------------------
2179 systemd_nspawn_SOURCES = \
2180         src/nspawn/nspawn.c \
2181         src/core/mount-setup.c \
2182         src/core/mount-setup.h \
2183         src/core/loopback-setup.c \
2184         src/core/loopback-setup.h
2185
2186 systemd_nspawn_CFLAGS = \
2187         $(AM_CFLAGS) \
2188         $(SECCOMP_CFLAGS) \
2189         $(BLKID_CFLAGS)
2190
2191 systemd_nspawn_LDADD = \
2192         libsystemd-label.la \
2193         libsystemd-capability.la \
2194         libsystemd-internal.la \
2195         libudev-internal.la \
2196         libsystemd-shared.la \
2197         $(BLKID_LIBS)
2198
2199 if HAVE_SECCOMP
2200 systemd_nspawn_LDADD += \
2201         libsystemd-seccomp.la \
2202         $(SECCOMP_LIBS)
2203 endif
2204
2205 # ------------------------------------------------------------------------------
2206 systemd_run_SOURCES = \
2207         src/run/run.c
2208
2209 systemd_run_LDADD = \
2210         libsystemd-label.la \
2211         libsystemd-capability.la \
2212         libsystemd-internal.la \
2213         libsystemd-shared.la
2214
2215 # ------------------------------------------------------------------------------
2216 systemd_bus_proxyd_SOURCES = \
2217         src/bus-proxyd/bus-proxyd.c \
2218         src/bus-proxyd/bus-policy.c \
2219         src/bus-proxyd/bus-policy.h
2220
2221 systemd_bus_proxyd_LDADD = \
2222         libsystemd-capability.la \
2223         libsystemd-internal.la \
2224         libsystemd-shared.la
2225
2226 bus-proxyd-install-hook:
2227         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
2228         $(AM_V_RM)rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
2229         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
2230
2231 bus-proxyd-uninstall-hook:
2232         rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
2233
2234 INSTALL_EXEC_HOOKS += bus-proxyd-install-hook
2235 UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook
2236
2237 if ENABLE_KDBUS
2238 nodist_systemunit_DATA += \
2239         units/systemd-bus-proxyd@.service
2240
2241 dist_systemunit_DATA += \
2242         units/systemd-bus-proxyd.socket
2243
2244 dist_userunit_DATA += \
2245         units/user/systemd-bus-proxyd.socket \
2246         units/user/systemd-bus-proxyd@.service
2247 endif
2248
2249 EXTRA_DIST += \
2250         units/systemd-bus-proxyd@.service.in
2251
2252 # ------------------------------------------------------------------------------
2253 systemd_tty_ask_password_agent_SOURCES = \
2254         src/tty-ask-password-agent/tty-ask-password-agent.c
2255
2256 systemd_tty_ask_password_agent_LDADD = \
2257         libsystemd-label.la \
2258         libsystemd-shared.la
2259
2260 # ------------------------------------------------------------------------------
2261 libsystemd_internal_la_SOURCES = \
2262         src/systemd/sd-bus.h \
2263         src/systemd/sd-bus-protocol.h \
2264         src/systemd/sd-bus-vtable.h \
2265         src/systemd/sd-memfd.h \
2266         src/systemd/sd-utf8.h \
2267         src/systemd/sd-event.h \
2268         src/systemd/sd-rtnl.h \
2269         src/systemd/sd-resolve.h \
2270         src/systemd/sd-login.h \
2271         src/systemd/sd-id128.h \
2272         src/systemd/sd-daemon.h \
2273         src/systemd/sd-path.h \
2274         src/libsystemd/sd-bus/sd-bus.c \
2275         src/libsystemd/sd-bus/bus-control.c \
2276         src/libsystemd/sd-bus/bus-control.h \
2277         src/libsystemd/sd-bus/bus-error.c \
2278         src/libsystemd/sd-bus/bus-error.h \
2279         src/libsystemd/sd-bus/bus-internal.c \
2280         src/libsystemd/sd-bus/bus-internal.h \
2281         src/libsystemd/sd-bus/bus-socket.c \
2282         src/libsystemd/sd-bus/bus-socket.h \
2283         src/libsystemd/sd-bus/bus-kernel.c \
2284         src/libsystemd/sd-bus/bus-kernel.h \
2285         src/libsystemd/sd-bus/bus-container.c \
2286         src/libsystemd/sd-bus/bus-container.h \
2287         src/libsystemd/sd-bus/bus-message.c \
2288         src/libsystemd/sd-bus/bus-message.h \
2289         src/libsystemd/sd-bus/bus-creds.c \
2290         src/libsystemd/sd-bus/bus-creds.h \
2291         src/libsystemd/sd-bus/bus-signature.c \
2292         src/libsystemd/sd-bus/bus-signature.h \
2293         src/libsystemd/sd-bus/bus-type.c \
2294         src/libsystemd/sd-bus/bus-type.h \
2295         src/libsystemd/sd-bus/bus-match.c \
2296         src/libsystemd/sd-bus/bus-match.h \
2297         src/libsystemd/sd-bus/bus-bloom.c \
2298         src/libsystemd/sd-bus/bus-bloom.h \
2299         src/libsystemd/sd-bus/bus-introspect.c \
2300         src/libsystemd/sd-bus/bus-introspect.h \
2301         src/libsystemd/sd-bus/bus-objects.c \
2302         src/libsystemd/sd-bus/bus-objects.h \
2303         src/libsystemd/sd-bus/bus-gvariant.c \
2304         src/libsystemd/sd-bus/bus-gvariant.h \
2305         src/libsystemd/sd-bus/bus-convenience.c \
2306         src/libsystemd/sd-bus/bus-track.c \
2307         src/libsystemd/sd-bus/bus-track.h \
2308         src/libsystemd/sd-bus/bus-util.c \
2309         src/libsystemd/sd-bus/bus-util.h \
2310         src/libsystemd/sd-bus/bus-slot.c \
2311         src/libsystemd/sd-bus/bus-slot.h \
2312         src/libsystemd/sd-bus/bus-protocol.h \
2313         src/libsystemd/sd-bus/kdbus.h \
2314         src/libsystemd/sd-bus/sd-memfd.c \
2315         src/libsystemd/sd-utf8/sd-utf8.c \
2316         src/libsystemd/sd-event/sd-event.c \
2317         src/libsystemd/sd-event/event-util.h \
2318         src/libsystemd/sd-rtnl/sd-rtnl.c \
2319         src/libsystemd/sd-rtnl/rtnl-internal.h \
2320         src/libsystemd/sd-rtnl/rtnl-message.c \
2321         src/libsystemd/sd-rtnl/rtnl-types.h \
2322         src/libsystemd/sd-rtnl/rtnl-types.c \
2323         src/libsystemd/sd-rtnl/rtnl-util.h \
2324         src/libsystemd/sd-rtnl/rtnl-util.c \
2325         src/libsystemd/sd-rtnl/local-addresses.h \
2326         src/libsystemd/sd-rtnl/local-addresses.c \
2327         src/libsystemd/sd-id128/sd-id128.c \
2328         src/libsystemd/sd-daemon/sd-daemon.c \
2329         src/libsystemd/sd-login/sd-login.c \
2330         src/libsystemd/sd-path/sd-path.c
2331
2332 nodist_libsystemd_internal_la_SOURCES = \
2333         src/libsystemd/libsystemd.sym \
2334         src/libsystemd/sd-bus/bus-error-mapping.c
2335
2336 libsystemd_internal_la_CFLAGS = \
2337         $(AM_CFLAGS) \
2338         -pthread
2339
2340 libsystemd_internal_la_LIBADD = \
2341         $(RT_LIBS)
2342
2343 libsystemd_resolve_la_SOURCES = \
2344         src/libsystemd/sd-resolve/sd-resolve.c \
2345         src/libsystemd/sd-resolve/resolve-util.h
2346
2347 libsystemd_resolve_la_CFLAGS = \
2348         $(AM_CFLAGS) \
2349         -pthread
2350
2351 libsystemd_resolve_la_LIBADD = \
2352         -lresolv
2353
2354 noinst_LTLIBRARIES += \
2355         libsystemd-internal.la \
2356         libsystemd-resolve.la
2357
2358 libsystemd_dump_la_SOURCES = \
2359         src/libsystemd/sd-bus/bus-dump.c \
2360         src/libsystemd/sd-bus/bus-dump.h
2361
2362 libsystemd_dump_la_CFLAGS = \
2363         $(AM_CFLAGS) \
2364         $(CAP_CFLAGS)
2365
2366 noinst_LTLIBRARIES += \
2367         libsystemd-dump.la
2368
2369 EXTRA_DIST += \
2370         src/libsystemd/libsystemd.sym.m4 \
2371         src/libsystemd/libsystemd.pc.in \
2372         src/libsystemd/sd-bus/bus-error-mapping.gperf \
2373         src/libsystemd/sd-bus/DIFFERENCES \
2374         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
2375
2376 CLEANFILES += \
2377         src/libsystemd/libsystemd.sym \
2378         src/libsystemd/sd-bus/bus-error-mapping.c
2379
2380 BUILT_SOURCES += \
2381         src/libsystemd/libsystemd.sym
2382
2383 libsystemd_la_SOURCES = \
2384         $(libsystemd_internal_la_SOURCES) \
2385         $(libsystemd_resolve_la_SOURCES) \
2386         $(libsystemd_journal_internal_la_SOURCES)
2387
2388 nodist_libsystemd_la_SOURCES = \
2389         $(nodist_libsystemd_internal_la_SOURCES)
2390
2391 libsystemd_la_CFLAGS = \
2392         $(libsystemd_internal_la_CFLAGS) \
2393         $(libsystemd_resolve_la_CFLAGS) \
2394         $(libsystemd_journal_internal_la_CFLAGS)
2395
2396 libsystemd_la_LDFLAGS = \
2397         $(AM_LDFLAGS) \
2398         -version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
2399         -Wl,--version-script=$(top_builddir)/src/libsystemd/libsystemd.sym
2400
2401 libsystemd_la_LIBADD = \
2402         libsystemd-shared.la \
2403         $(libsystemd_internal_la_LIBADD) \
2404         $(libsystemd_journal_internal_la_LIBADD) \
2405         $(libsystemd_resolve_la_LIBADD)
2406
2407 libsystemd-install-hook:
2408         libname=libsystemd.so && $(move-to-rootlibdir)
2409
2410 libsystemd-uninstall-hook:
2411         rm -f $(DESTDIR)$(rootlibdir)/libsystemd.so*
2412
2413 INSTALL_EXEC_HOOKS += libsystemd-install-hook
2414 UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook
2415
2416 pkgconfiglib_DATA += \
2417         src/libsystemd/libsystemd.pc
2418
2419 pkginclude_HEADERS += \
2420         src/systemd/sd-login.h \
2421         src/systemd/sd-id128.h \
2422         src/systemd/sd-daemon.h
2423
2424 if ENABLE_KDBUS
2425 pkginclude_HEADERS += \
2426         src/systemd/sd-bus.h \
2427         src/systemd/sd-bus-protocol.h \
2428         src/systemd/sd-bus-vtable.h \
2429         src/systemd/sd-memfd.h \
2430         src/systemd/sd-utf8.h \
2431         src/systemd/sd-event.h \
2432         src/systemd/sd-rtnl.h \
2433         src/systemd/sd-resolve.h \
2434         src/systemd/sd-path.h
2435 endif
2436
2437 lib_LTLIBRARIES += \
2438         libsystemd.la
2439
2440 tests += \
2441         test-bus-marshal \
2442         test-bus-signature \
2443         test-bus-chat \
2444         test-bus-cleanup \
2445         test-bus-server \
2446         test-bus-match \
2447         test-bus-kernel \
2448         test-bus-kernel-bloom \
2449         test-bus-kernel-benchmark \
2450         test-bus-memfd \
2451         test-bus-zero-copy \
2452         test-bus-introspect \
2453         test-bus-objects \
2454         test-bus-error \
2455         test-bus-creds \
2456         test-bus-gvariant \
2457         test-event \
2458         test-rtnl \
2459         test-resolve
2460
2461 bin_PROGRAMS += \
2462         busctl
2463
2464 test_bus_marshal_SOURCES = \
2465         src/libsystemd/sd-bus/test-bus-marshal.c
2466
2467 test_bus_marshal_LDADD = \
2468         libsystemd-internal.la \
2469         libsystemd-shared.la \
2470         libsystemd-dump.la \
2471         libsystemd-capability.la \
2472         $(GLIB_LIBS) \
2473         $(DBUS_LIBS) \
2474         $(CAP_LIBS)
2475
2476 test_bus_marshal_CFLAGS = \
2477         $(AM_CFLAGS) \
2478         $(GLIB_CFLAGS) \
2479         $(DBUS_CFLAGS) \
2480         $(CAP_CFLAGS)
2481
2482 test_bus_signature_SOURCES = \
2483         src/libsystemd/sd-bus/test-bus-signature.c
2484
2485 test_bus_signature_LDADD = \
2486         libsystemd-shared.la \
2487         libsystemd-internal.la
2488
2489 test_bus_chat_SOURCES = \
2490         src/libsystemd/sd-bus/test-bus-chat.c
2491
2492 test_bus_chat_CFLAGS = \
2493         $(AM_CFLAGS) \
2494         -pthread
2495
2496 test_bus_chat_LDADD = \
2497         libsystemd-internal.la \
2498         libsystemd-shared.la
2499
2500 test_bus_cleanup_SOURCES = \
2501         src/libsystemd/sd-bus/test-bus-cleanup.c
2502
2503 test_bus_cleanup_CFLAGS = \
2504         $(AM_CFLAGS) \
2505         $(SECCOMP_CFLAGS)
2506
2507 test_bus_cleanup_LDADD = \
2508         libsystemd-internal.la \
2509         libsystemd-shared.la
2510
2511 test_bus_server_SOURCES = \
2512         src/libsystemd/sd-bus/test-bus-server.c
2513
2514 test_bus_server_CFLAGS = \
2515         $(AM_CFLAGS) \
2516         -pthread
2517
2518 test_bus_server_LDADD = \
2519         libsystemd-internal.la \
2520         libsystemd-shared.la
2521
2522 test_bus_objects_SOURCES = \
2523         src/libsystemd/sd-bus/test-bus-objects.c
2524
2525 test_bus_objects_CFLAGS = \
2526         $(AM_CFLAGS) \
2527         $(CAP_CFLAGS) \
2528         -pthread
2529
2530 test_bus_objects_LDADD = \
2531         libsystemd-internal.la \
2532         libsystemd-shared.la \
2533         libsystemd-dump.la \
2534         libsystemd-capability.la \
2535         $(CAP_LIBS)
2536
2537 test_bus_error_SOURCES = \
2538         src/libsystemd/sd-bus/test-bus-error.c
2539
2540 test_bus_error_LDADD = \
2541         libsystemd-internal.la \
2542         libsystemd-shared.la
2543
2544 test_bus_gvariant_SOURCES = \
2545         src/libsystemd/sd-bus/test-bus-gvariant.c
2546
2547 test_bus_gvariant_LDADD = \
2548         libsystemd-internal.la \
2549         libsystemd-shared.la \
2550         libsystemd-dump.la \
2551         libsystemd-capability.la \
2552         $(GLIB_LIBS) \
2553         $(CAP_LIBS)
2554
2555 test_bus_gvariant_CFLAGS = \
2556         $(AM_CFLAGS) \
2557         $(GLIB_CFLAGS)
2558         $(CAP_CFLAGS)
2559
2560 test_bus_creds_SOURCES = \
2561         src/libsystemd/sd-bus/test-bus-creds.c
2562
2563 test_bus_creds_LDADD = \
2564         libsystemd-internal.la \
2565         libsystemd-shared.la \
2566         libsystemd-dump.la \
2567         libsystemd-capability.la
2568
2569 test_bus_match_SOURCES = \
2570         src/libsystemd/sd-bus/test-bus-match.c
2571
2572 test_bus_match_LDADD = \
2573         libsystemd-internal.la \
2574         libsystemd-shared.la
2575
2576 test_bus_kernel_SOURCES = \
2577         src/libsystemd/sd-bus/test-bus-kernel.c
2578
2579 test_bus_kernel_LDADD = \
2580         libsystemd-internal.la \
2581         libsystemd-shared.la \
2582         libsystemd-dump.la \
2583         libsystemd-capability.la \
2584         $(CAP_LIBS)
2585
2586 test_bus_kernel_CFLAGS = \
2587         $(AM_CFLAGS) \
2588         $(CAP_CFLAGS)
2589
2590 test_bus_kernel_bloom_SOURCES = \
2591         src/libsystemd/sd-bus/test-bus-kernel-bloom.c
2592
2593 test_bus_kernel_bloom_LDADD = \
2594         libsystemd-internal.la \
2595         libsystemd-shared.la
2596
2597 test_bus_kernel_benchmark_SOURCES = \
2598         src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
2599
2600 test_bus_kernel_benchmark_LDADD = \
2601         libsystemd-internal.la \
2602         libsystemd-shared.la
2603
2604 test_bus_memfd_SOURCES = \
2605         src/libsystemd/sd-bus/test-bus-memfd.c
2606
2607 test_bus_memfd_LDADD = \
2608         libsystemd-internal.la \
2609         libsystemd-shared.la
2610
2611 test_bus_zero_copy_SOURCES = \
2612         src/libsystemd/sd-bus/test-bus-zero-copy.c
2613
2614 test_bus_zero_copy_LDADD = \
2615         libsystemd-internal.la \
2616         libsystemd-shared.la \
2617         libsystemd-dump.la \
2618         libsystemd-capability.la \
2619         $(CAP_LIBS)
2620
2621 test_bus_zero_copy_CFLAGS = \
2622         $(AM_CFLAGS) \
2623         $(CAP_CFLAGS)
2624
2625 test_bus_introspect_SOURCES = \
2626         src/libsystemd/sd-bus/test-bus-introspect.c
2627
2628 test_bus_introspect_LDADD = \
2629         libsystemd-internal.la \
2630         libsystemd-shared.la
2631
2632 test_event_SOURCES = \
2633         src/libsystemd/sd-event/test-event.c
2634
2635 test_event_LDADD = \
2636         libsystemd-internal.la \
2637         libsystemd-shared.la
2638
2639 test_rtnl_SOURCES = \
2640         src/libsystemd/sd-rtnl/test-rtnl.c
2641
2642 test_rtnl_LDADD = \
2643         libsystemd-internal.la \
2644         libsystemd-shared.la
2645
2646 test_resolve_SOURCES = \
2647         src/libsystemd/sd-resolve/test-resolve.c
2648
2649 test_resolve_LDADD = \
2650         libsystemd-resolve.la \
2651         libsystemd-internal.la \
2652         libsystemd-shared.la
2653
2654 test_resolve_CFLAGS = \
2655         $(AM_CFLAGS) \
2656         -pthread
2657
2658 busctl_SOURCES = \
2659         src/libsystemd/sd-bus/busctl.c
2660
2661 busctl_LDADD = \
2662         libsystemd-internal.la \
2663         libsystemd-shared.la \
2664         libsystemd-dump.la \
2665         libsystemd-capability.la \
2666         $(CAP_LIBS)
2667
2668 busctl_CFLAGS = \
2669         $(AM_CFLAGS) \
2670         $(CAP_CFLAGS)
2671
2672 # ------------------------------------------------------------------------------
2673 noinst_LTLIBRARIES += \
2674         libsystemd-network.la
2675
2676 libsystemd_network_la_CFLAGS = \
2677         $(AM_CFLAGS) \
2678         $(KMOD_CFLAGS)
2679
2680 libsystemd_network_la_SOURCES = \
2681         src/systemd/sd-network.h \
2682         src/systemd/sd-dhcp-client.h \
2683         src/systemd/sd-dhcp-server.h \
2684         src/systemd/sd-dhcp-lease.h \
2685         src/systemd/sd-ipv4ll.h \
2686         src/network/sd-network.c \
2687         src/network/network-util.h \
2688         src/libsystemd-network/sd-dhcp-client.c \
2689         src/libsystemd-network/sd-dhcp-server.c \
2690         src/libsystemd-network/dhcp-network.c \
2691         src/libsystemd-network/dhcp-option.c \
2692         src/libsystemd-network/dhcp-packet.c \
2693         src/libsystemd-network/dhcp-internal.h \
2694         src/libsystemd-network/dhcp-server-internal.h \
2695         src/libsystemd-network/dhcp-protocol.h \
2696         src/libsystemd-network/dhcp-lease-internal.h \
2697         src/libsystemd-network/sd-dhcp-lease.c \
2698         src/libsystemd-network/sd-ipv4ll.c \
2699         src/libsystemd-network/ipv4ll-network.c \
2700         src/libsystemd-network/ipv4ll-packet.c \
2701         src/libsystemd-network/ipv4ll-internal.h \
2702         src/libsystemd-network/network-internal.c \
2703         src/libsystemd-network/network-internal.h \
2704         src/systemd/sd-icmp6-nd.h \
2705         src/systemd/sd-dhcp6-client.h \
2706         src/systemd/sd-dhcp6-lease.h \
2707         src/libsystemd-network/sd-icmp6-nd.c \
2708         src/libsystemd-network/sd-dhcp6-client.c \
2709         src/libsystemd-network/dhcp6-internal.h \
2710         src/libsystemd-network/dhcp6-protocol.h \
2711         src/libsystemd-network/dhcp6-network.c \
2712         src/libsystemd-network/dhcp6-option.c \
2713         src/libsystemd-network/dhcp6-lease-internal.h \
2714         src/libsystemd-network/sd-dhcp6-lease.c
2715
2716 libsystemd_network_la_LIBADD = \
2717         libudev-internal.la \
2718         libsystemd-label.la \
2719         libsystemd-internal.la \
2720         libsystemd-shared.la \
2721         $(KMOD_LIBS)
2722
2723 test_dhcp_option_SOURCES = \
2724         src/libsystemd-network/dhcp-protocol.h \
2725         src/libsystemd-network/dhcp-internal.h \
2726         src/libsystemd-network/test-dhcp-option.c
2727
2728 test_dhcp_option_LDADD = \
2729         libsystemd-network.la \
2730         libsystemd-internal.la \
2731         libsystemd-shared.la
2732
2733 test_dhcp_client_SOURCES = \
2734         src/systemd/sd-dhcp-client.h \
2735         src/libsystemd-network/dhcp-protocol.h \
2736         src/libsystemd-network/dhcp-internal.h \
2737         src/libsystemd-network/test-dhcp-client.c
2738
2739 test_dhcp_client_LDADD = \
2740         libsystemd-network.la \
2741         libsystemd-label.la \
2742         libsystemd-internal.la \
2743         libsystemd-shared.la
2744
2745 test_dhcp_server_SOURCES = \
2746         src/libsystemd-network/test-dhcp-server.c
2747
2748 test_dhcp_server_LDADD = \
2749         libsystemd-network.la \
2750         libsystemd-internal.la \
2751         libsystemd-shared.la
2752
2753 test_ipv4ll_SOURCES = \
2754         src/systemd/sd-ipv4ll.h \
2755         src/libsystemd-network/ipv4ll-internal.h \
2756         src/libsystemd-network/test-ipv4ll.c
2757
2758 test_ipv4ll_LDADD = \
2759         libsystemd-network.la \
2760         libsystemd-label.la \
2761         libsystemd-internal.la \
2762         libsystemd-shared.la
2763
2764 test_icmp6_rs_SOURCES = \
2765         src/systemd/sd-dhcp6-client.h \
2766         src/systemd/sd-icmp6-nd.h \
2767         src/libsystemd-network/dhcp6-internal.h \
2768         src/libsystemd-network/test-icmp6-rs.c
2769
2770 test_icmp6_rs_LDADD = \
2771         libsystemd-network.la \
2772         libsystemd-internal.la \
2773         libsystemd-shared.la
2774
2775 test_dhcp6_client_SOURCES = \
2776         src/systemd/sd-dhcp6-client.h \
2777         src/libsystemd-network/dhcp6-internal.h \
2778         src/libsystemd-network/test-dhcp6-client.c
2779
2780 test_dhcp6_client_LDADD = \
2781         libsystemd-network.la \
2782         libsystemd-internal.la \
2783         libsystemd-shared.la
2784
2785 tests += \
2786         test-dhcp-option \
2787         test-dhcp-client \
2788         test-dhcp-server \
2789         test-ipv4ll \
2790         test-icmp6-rs \
2791         test-dhcp6-client
2792
2793 # ------------------------------------------------------------------------------
2794 if ENABLE_GTK_DOC
2795 SUBDIRS += \
2796         docs/libudev
2797
2798 noinst_DATA += \
2799         docs/html/libudev \
2800         docs/html/gudev
2801 endif
2802
2803 include_HEADERS += \
2804         src/libudev/libudev.h
2805
2806 lib_LTLIBRARIES += \
2807         libudev.la
2808
2809 libudev_la_SOURCES =\
2810         src/libudev/libudev.sym \
2811         src/libudev/libudev-private.h \
2812         src/libudev/libudev.c \
2813         src/libudev/libudev-list.c \
2814         src/libudev/libudev-util.c \
2815         src/libudev/libudev-device.c \
2816         src/libudev/libudev-enumerate.c \
2817         src/libudev/libudev-monitor.c \
2818         src/libudev/libudev-queue.c \
2819         src/libudev/libudev-hwdb-def.h \
2820         src/libudev/libudev-hwdb.c
2821
2822 libudev_la_CFLAGS = \
2823         $(AM_CFLAGS) \
2824         -fvisibility=hidden
2825
2826 libudev_la_LDFLAGS = \
2827         $(AM_LDFLAGS) \
2828         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
2829         -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
2830
2831 libudev_la_LIBADD = \
2832         libsystemd-internal.la \
2833         libsystemd-shared.la
2834
2835 pkgconfiglib_DATA += \
2836         src/libudev/libudev.pc
2837
2838 EXTRA_DIST += \
2839         src/libudev/libudev.pc.in
2840
2841 CLEANFILES += \
2842         src/libudev/libudev.pc \
2843         docs/html/libudev \
2844         docs/html/gudev
2845
2846 docs/html/libudev:
2847         $(AM_V_at)$(MKDIR_P) $(dir $@)
2848         $(AM_V_LN)$(LN_S) -f ../libudev/html $@
2849
2850 docs/html/gudev:
2851         $(AM_V_at)$(MKDIR_P) $(dir $@)
2852         $(AM_V_LN)$(LN_S) -f ../gudev/html $@
2853
2854 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2855 libudev-install-hook:
2856         libname=libudev.so && $(move-to-rootlibdir)
2857
2858 libudev-uninstall-hook:
2859         rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
2860
2861 INSTALL_EXEC_HOOKS += libudev-install-hook
2862 UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
2863
2864 # ------------------------------------------------------------------------------
2865 noinst_LTLIBRARIES += \
2866         libudev-internal.la
2867
2868 libudev_internal_la_SOURCES =\
2869         $(libudev_la_SOURCES) \
2870         src/libudev/libudev-device-private.c
2871
2872 libudev_internal_la_CFLAGS = \
2873         $(AM_CFLAGS) \
2874         -fvisibility=default
2875
2876 # ------------------------------------------------------------------------------
2877 INSTALL_DIRS += \
2878         $(sysconfdir)/udev/rules.d \
2879         $(sysconfdir)/udev/hwdb.d
2880
2881 dist_network_DATA = \
2882         network/99-default.link \
2883         network/80-container-host0.network \
2884         network/80-container-ve.network
2885
2886 dist_udevrules_DATA += \
2887         rules/42-usb-hid-pm.rules \
2888         rules/50-udev-default.rules \
2889         rules/60-drm.rules \
2890         rules/60-keyboard.rules \
2891         rules/60-persistent-storage-tape.rules \
2892         rules/60-persistent-serial.rules \
2893         rules/60-persistent-input.rules \
2894         rules/60-persistent-alsa.rules \
2895         rules/60-persistent-storage.rules \
2896         rules/64-btrfs.rules \
2897         rules/75-net-description.rules \
2898         rules/75-tty-description.rules \
2899         rules/78-sound-card.rules \
2900         rules/80-net-setup-link.rules \
2901         rules/95-udev-late.rules
2902
2903 nodist_udevrules_DATA += \
2904         rules/99-systemd.rules
2905
2906 dist_udevhwdb_DATA = \
2907         hwdb/20-pci-vendor-model.hwdb \
2908         hwdb/20-pci-classes.hwdb \
2909         hwdb/20-usb-vendor-model.hwdb \
2910         hwdb/20-usb-classes.hwdb \
2911         hwdb/20-sdio-vendor-model.hwdb \
2912         hwdb/20-sdio-classes.hwdb \
2913         hwdb/20-bluetooth-vendor-product.hwdb \
2914         hwdb/20-acpi-vendor.hwdb \
2915         hwdb/20-OUI.hwdb \
2916         hwdb/20-net-ifname.hwdb \
2917         hwdb/60-keyboard.hwdb
2918
2919 udevconfdir = $(sysconfdir)/udev
2920 dist_udevconf_DATA = \
2921         src/udev/udev.conf
2922
2923 sharepkgconfigdir = $(datadir)/pkgconfig
2924 sharepkgconfig_DATA = \
2925         src/udev/udev.pc
2926
2927 EXTRA_DIST += \
2928         rules/99-systemd.rules.in \
2929         src/udev/udev.pc.in
2930
2931 CLEANFILES += \
2932         rules/99-systemd.rules \
2933         src/udev/udev.pc
2934
2935 EXTRA_DIST += \
2936         units/systemd-udevd.service.in \
2937         units/systemd-udev-trigger.service.in \
2938         units/systemd-udev-settle.service.in \
2939         units/systemd-udev-hwdb-update.service.in
2940
2941 CLEANFILES += \
2942         units/systemd-udevd.service \
2943         units/systemd-udev-trigger.service \
2944         units/systemd-udev-settle.service \
2945         units/systemd-udev-hwdb-update.service
2946
2947 SOCKETS_TARGET_WANTS += \
2948         systemd-udevd-control.socket \
2949         systemd-udevd-kernel.socket
2950
2951 SYSINIT_TARGET_WANTS += \
2952         systemd-udevd.service \
2953         systemd-udev-trigger.service \
2954         systemd-udev-hwdb-update.service
2955
2956 rootbin_PROGRAMS += \
2957         udevadm
2958
2959 rootlibexec_PROGRAMS += \
2960         systemd-udevd
2961
2962 noinst_LTLIBRARIES += \
2963         libudev-core.la
2964
2965 src/udev/keyboard-keys.txt:
2966         $(AM_V_at)$(MKDIR_P) $(dir $@)
2967         $(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/' > $@
2968
2969 src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt
2970         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
2971
2972 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
2973         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
2974
2975 src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt
2976         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
2977
2978 libudev_core_la_SOURCES = \
2979         src/udev/udev.h \
2980         src/udev/udev-event.c \
2981         src/udev/udev-watch.c \
2982         src/udev/udev-node.c \
2983         src/udev/udev-rules.c \
2984         src/udev/udev-ctrl.c \
2985         src/udev/udev-builtin.c \
2986         src/udev/udev-builtin-btrfs.c \
2987         src/udev/udev-builtin-hwdb.c \
2988         src/udev/udev-builtin-input_id.c \
2989         src/udev/udev-builtin-keyboard.c \
2990         src/udev/udev-builtin-net_id.c \
2991         src/udev/udev-builtin-net_setup_link.c \
2992         src/udev/udev-builtin-path_id.c \
2993         src/udev/udev-builtin-usb_id.c \
2994         src/udev/net/link-config.h \
2995         src/udev/net/link-config.c \
2996         src/udev/net/ethtool-util.h \
2997         src/udev/net/ethtool-util.c
2998
2999 nodist_libudev_core_la_SOURCES = \
3000         src/udev/keyboard-keys-from-name.h \
3001         src/udev/keyboard-keys-to-name.h \
3002         src/udev/net/link-config-gperf.c
3003
3004 BUILT_SOURCES += \
3005         $(nodist_libudev_core_la_SOURCES)
3006
3007 CLEANFILES += \
3008         src/udev/keyboard-keys-from-name.gperf \
3009         src/udev/keyboard-keys.txt \
3010         src/udev/net/link-config-gperf.c
3011
3012 EXTRA_DIST += \
3013         src/udev/net/link-config-gperf.gperf
3014
3015 libudev_core_la_CFLAGS = \
3016         $(AM_CFLAGS) \
3017         $(BLKID_CFLAGS) \
3018         $(KMOD_CFLAGS)
3019
3020 libudev_core_la_LIBADD = \
3021         libudev-internal.la \
3022         libsystemd-label.la \
3023         libsystemd-internal.la \
3024         libsystemd-network.la \
3025         libsystemd-shared.la \
3026         $(BLKID_LIBS) \
3027         $(KMOD_LIBS)
3028
3029 libudev_core_la_CPPFLAGS = \
3030         $(AM_CPPFLAGS) \
3031         -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
3032
3033 if ENABLE_FIRMWARE
3034 libudev_core_la_SOURCES += \
3035         src/udev/udev-builtin-firmware.c
3036
3037 dist_udevrules_DATA += \
3038         rules/50-firmware.rules
3039 endif
3040
3041 if HAVE_KMOD
3042 libudev_core_la_SOURCES += \
3043         src/udev/udev-builtin-kmod.c
3044
3045 dist_udevrules_DATA += \
3046         rules/80-drivers.rules
3047 endif
3048
3049 if HAVE_BLKID
3050 libudev_core_la_SOURCES += \
3051         src/udev/udev-builtin-blkid.c
3052 endif
3053
3054 if HAVE_ACL
3055 libudev_core_la_SOURCES += \
3056         src/udev/udev-builtin-uaccess.c \
3057         src/login/logind-acl.c \
3058         src/libsystemd/sd-login/sd-login.c \
3059         src/systemd/sd-login.h
3060
3061 libudev_core_la_LIBADD += \
3062         libsystemd-acl.la
3063 endif
3064
3065 systemd_udevd_SOURCES = \
3066         src/udev/udevd.c
3067
3068 systemd_udevd_LDADD = \
3069         libudev-core.la
3070
3071 udevadm_SOURCES = \
3072         src/udev/udevadm.c \
3073         src/udev/udevadm-info.c \
3074         src/udev/udevadm-control.c \
3075         src/udev/udevadm-monitor.c \
3076         src/udev/udevadm-hwdb.c \
3077         src/udev/udevadm-settle.c \
3078         src/udev/udevadm-trigger.c \
3079         src/udev/udevadm-test.c \
3080         src/udev/udevadm-test-builtin.c
3081
3082 udevadm_LDADD = \
3083         libudev-core.la
3084
3085 # Update hwdb on installation. Do not bother if installing
3086 # in DESTDIR, since this is likely for packaging purposes.
3087 hwdb-update-hook:
3088         -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update
3089
3090 INSTALL_DATA_HOOKS += \
3091         hwdb-update-hook
3092
3093 hwdb-remove-hook:
3094         -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
3095
3096 # ------------------------------------------------------------------------------
3097 TESTS += \
3098         test/udev-test.pl \
3099         test/rules-test.sh
3100
3101 manual_tests += \
3102         test-libudev \
3103         test-udev
3104
3105 test_libudev_SOURCES = \
3106         src/test/test-libudev.c
3107
3108 test_libudev_LDADD = \
3109         libsystemd-label.la \
3110         libudev-internal.la \
3111         libsystemd-shared.la
3112
3113 test_udev_SOURCES = \
3114         src/test/test-udev.c
3115
3116 test_udev_LDADD = \
3117         libudev-core.la \
3118         $(BLKID_LIBS) \
3119         $(KMOD_LIBS) \
3120         $(SELINUX_LIBS)
3121
3122 if HAVE_ACL
3123 test_udev_LDADD += \
3124         libsystemd-acl.la
3125 endif
3126
3127 check_DATA += \
3128         test/sys
3129
3130 # packed sysfs test tree
3131 test/sys:
3132         $(AM_V_at)$(MKDIR_P) $(dir $@)
3133         $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
3134
3135 test-sys-distclean:
3136         -rm -rf test/sys
3137 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
3138
3139 EXTRA_DIST += \
3140         test/sys.tar.xz \
3141         test/udev-test.pl \
3142         test/rules-test.sh \
3143         test/rule-syntax-check.py
3144
3145 # ------------------------------------------------------------------------------
3146 ata_id_SOURCES = \
3147         src/udev/ata_id/ata_id.c
3148
3149 ata_id_LDADD = \
3150         libudev-internal.la \
3151         libsystemd-shared.la
3152
3153 udevlibexec_PROGRAMS += \
3154         ata_id
3155
3156 # ------------------------------------------------------------------------------
3157 cdrom_id_SOURCES = \
3158         src/udev/cdrom_id/cdrom_id.c
3159
3160 cdrom_id_LDADD = \
3161         libudev-internal.la \
3162         libsystemd-shared.la
3163
3164 udevlibexec_PROGRAMS += \
3165         cdrom_id
3166
3167 dist_udevrules_DATA += \
3168         rules/60-cdrom_id.rules
3169
3170 # ------------------------------------------------------------------------------
3171 collect_SOURCES = \
3172         src/udev/collect/collect.c
3173
3174 collect_LDADD = \
3175         libudev-internal.la \
3176         libsystemd-shared.la
3177
3178 udevlibexec_PROGRAMS += \
3179         collect
3180
3181 # ------------------------------------------------------------------------------
3182 scsi_id_SOURCES =\
3183         src/udev/scsi_id/scsi_id.c \
3184         src/udev/scsi_id/scsi_serial.c \
3185         src/udev/scsi_id/scsi.h \
3186         src/udev/scsi_id/scsi_id.h
3187
3188 scsi_id_LDADD = \
3189         libudev-internal.la \
3190         libsystemd-shared.la
3191
3192 udevlibexec_PROGRAMS += \
3193         scsi_id
3194
3195 EXTRA_DIST += \
3196         src/udev/scsi_id/README
3197
3198 # ------------------------------------------------------------------------------
3199 v4l_id_SOURCES = \
3200         src/udev/v4l_id/v4l_id.c
3201
3202 v4l_id_LDADD = \
3203         libudev-internal.la
3204
3205 udevlibexec_PROGRAMS += \
3206         v4l_id
3207
3208 dist_udevrules_DATA += \
3209         rules/60-persistent-v4l.rules
3210
3211 # ------------------------------------------------------------------------------
3212 accelerometer_SOURCES = \
3213         src/udev/accelerometer/accelerometer.c
3214
3215 accelerometer_LDADD = \
3216         libudev-internal.la -lm \
3217         libsystemd-shared.la
3218
3219 udevlibexec_PROGRAMS += \
3220         accelerometer
3221
3222 dist_udevrules_DATA += \
3223         rules/61-accelerometer.rules
3224
3225 # ------------------------------------------------------------------------------
3226 if ENABLE_GUDEV
3227 if ENABLE_GTK_DOC
3228 SUBDIRS += \
3229         docs/gudev
3230 endif
3231
3232 libgudev_includedir = \
3233         $(includedir)/gudev-1.0/gudev
3234
3235 libgudev_include_HEADERS = \
3236         src/gudev/gudev.h \
3237         src/gudev/gudevenums.h \
3238         src/gudev/gudevenumtypes.h \
3239         src/gudev/gudevtypes.h \
3240         src/gudev/gudevclient.h \
3241         src/gudev/gudevdevice.h \
3242         src/gudev/gudevenumerator.h
3243
3244 lib_LTLIBRARIES += libgudev-1.0.la
3245
3246 pkgconfiglib_DATA += \
3247         src/gudev/gudev-1.0.pc
3248
3249 CLEANFILES += \
3250         src/gudev/gudev-1.0.pc
3251
3252 libgudev_1_0_la_SOURCES = \
3253         src/gudev/libgudev-1.0.sym \
3254         src/gudev/gudevenums.h \
3255         src/gudev/gudevenumtypes.h \
3256         src/gudev/gudevenumtypes.h\
3257         src/gudev/gudevtypes.h \
3258         src/gudev/gudevclient.h \
3259         src/gudev/gudevclient.c \
3260         src/gudev/gudevdevice.h \
3261         src/gudev/gudevdevice.c \
3262         src/gudev/gudevenumerator.h \
3263         src/gudev/gudevenumerator.c \
3264         src/gudev/gudevprivate.h
3265
3266 nodist_libgudev_1_0_la_SOURCES = \
3267         src/gudev/gudevmarshal.h \
3268         src/gudev/gudevmarshal.c \
3269         src/gudev/gudevenumtypes.h \
3270         src/gudev/gudevenumtypes.c
3271
3272 BUILT_SOURCES += \
3273         $(nodist_libgudev_1_0_la_SOURCES)
3274
3275 libgudev_1_0_la_CPPFLAGS = \
3276         $(AM_CPPFLAGS) \
3277         -I$(top_builddir)/src\
3278         -I$(top_srcdir)/src\
3279         -I$(top_builddir)/src/gudev \
3280         -I$(top_srcdir)/src/gudev \
3281         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
3282         -D_GUDEV_COMPILATION \
3283         -DG_LOG_DOMAIN=\"GUdev\"
3284
3285 libgudev_1_0_la_CFLAGS = \
3286         $(AM_CFLAGS) \
3287         -fvisibility=default \
3288         $(GLIB_CFLAGS)
3289
3290 libgudev_1_0_la_LIBADD = \
3291         libudev.la \
3292         $(GLIB_LIBS)
3293
3294 libgudev_1_0_la_LDFLAGS = \
3295         $(AM_LDFLAGS) \
3296         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
3297         -export-dynamic \
3298         -no-undefined \
3299         -Wl,--version-script=$(top_srcdir)/src/gudev/libgudev-1.0.sym
3300
3301 src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
3302         $(AM_V_at)$(MKDIR_P) $(dir $@)
3303         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
3304
3305 src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
3306         $(AM_V_at)$(MKDIR_P) $(dir $@)
3307         $(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
3308         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
3309
3310 src/gudev/gudevenumtypes.%: src/gudev/gudevenumtypes.%.template src/gudev/gudevenums.h
3311         $(AM_V_at)$(MKDIR_P) $(dir $@)
3312         $(AM_V_GEN)glib-mkenums --template $^ > $@
3313
3314 if HAVE_INTROSPECTION
3315 -include $(INTROSPECTION_MAKEFILE)
3316
3317 src/gudev/GUdev-1.0.gir: libgudev-1.0.la
3318
3319 src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
3320
3321 src_gudev_GUdev_1_0_gir_CFLAGS = \
3322         $(AM_CFLAGS) \
3323         $(INCLUDES) \
3324         -D_GUDEV_COMPILATION \
3325         -D_GUDEV_WORK_AROUND_DEV_T_BUG \
3326         -I$(top_srcdir)/src \
3327         -I$(top_builddir)/src \
3328         -I$(top_srcdir)/src/gudev \
3329         -I$(top_builddir)/src/gudev
3330
3331 src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
3332
3333 src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
3334         --pkg-export=gudev-1.0 \
3335         --warn-all
3336
3337 src_gudev_GUdev_1_0_gir_FILES = \
3338         src/gudev/gudev.h \
3339         src/gudev/gudevtypes.h \
3340         src/gudev/gudevenums.h \
3341         src/gudev/gudevenumtypes.h \
3342         src/gudev/gudevclient.h \
3343         src/gudev/gudevdevice.h \
3344         src/gudev/gudevenumerator.h \
3345         src/gudev/gudevclient.c \
3346         src/gudev/gudevdevice.c \
3347         src/gudev/gudevenumerator.c
3348
3349 INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
3350 INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
3351
3352 girdir = $(datadir)/gir-1.0
3353 gir_DATA = \
3354         src/gudev/GUdev-1.0.gir
3355
3356 typelibsdir = $(libdir)/girepository-1.0
3357 typelibs_DATA = \
3358         src/gudev/GUdev-1.0.typelib
3359
3360 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
3361 endif # HAVE_INTROSPECTION
3362
3363 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
3364 libgudev-install-hook:
3365         libname=libgudev-1.0.so && $(move-to-rootlibdir)
3366
3367 libgudev-uninstall-hook:
3368         rm -f $(DESTDIR)$(rootlibdir)/libgudev-1.0.so*
3369
3370 INSTALL_EXEC_HOOKS += libgudev-install-hook
3371 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-hook
3372 endif
3373
3374 EXTRA_DIST += \
3375         src/gudev/gudev-1.0.pc.in \
3376         src/gudev/gudevmarshal.list \
3377         src/gudev/gudevenumtypes.h.template \
3378         src/gudev/gudevenumtypes.c.template \
3379         src/gudev/gjs-example.js \
3380         src/gudev/seed-example-enum.js \
3381         src/gudev/seed-example.js
3382
3383 # ------------------------------------------------------------------------------
3384 mtd_probe_SOURCES =  \
3385         src/udev/mtd_probe/mtd_probe.c \
3386         src/udev/mtd_probe/mtd_probe.h \
3387         src/udev/mtd_probe/probe_smartmedia.c
3388
3389 dist_udevrules_DATA += \
3390         rules/75-probe_mtd.rules
3391
3392 udevlibexec_PROGRAMS += \
3393         mtd_probe
3394
3395 # ------------------------------------------------------------------------------
3396 test_id128_SOURCES = \
3397         src/test/test-id128.c
3398
3399 test_id128_LDADD = \
3400         libsystemd-internal.la \
3401         libsystemd-shared.la
3402
3403 tests += \
3404         test-id128
3405
3406 # ------------------------------------------------------------------------------
3407
3408 rootlibexec_PROGRAMS += \
3409         systemd-activate
3410
3411 systemd_activate_SOURCES = \
3412         src/activate/activate.c
3413
3414 systemd_activate_LDADD = \
3415         libsystemd-label.la \
3416         libsystemd-internal.la \
3417         libsystemd-shared.la
3418
3419 # ------------------------------------------------------------------------------
3420 systemd_journald_SOURCES = \
3421         src/journal/journald.c \
3422         src/journal/journald-server.h
3423
3424 systemd_journald_LDADD = \
3425         libsystemd-journal-core.la \
3426         libsystemd-internal.la \
3427         libsystemd-shared.la
3428
3429 systemd_cat_SOURCES = \
3430         src/journal/cat.c
3431
3432 systemd_cat_LDADD = \
3433         libsystemd-journal-core.la
3434
3435 if HAVE_MICROHTTPD
3436 rootlibexec_PROGRAMS += \
3437         systemd-journal-remote
3438
3439 systemd_journal_remote_SOURCES = \
3440         src/journal/journal-remote-parse.h \
3441         src/journal/journal-remote-parse.c \
3442         src/journal/journal-remote-write.h \
3443         src/journal/journal-remote-write.c \
3444         src/journal/journal-remote.c
3445
3446 systemd_journal_remote_LDADD = \
3447         libsystemd-internal.la \
3448         libsystemd-journal-core.la
3449
3450 systemd_journal_remote_SOURCES += \
3451         src/journal/microhttpd-util.h \
3452         src/journal/microhttpd-util.c
3453
3454 systemd_journal_remote_CFLAGS = \
3455         $(AM_CFLAGS) \
3456         $(MICROHTTPD_CFLAGS)
3457
3458 systemd_journal_remote_LDADD += \
3459         $(MICROHTTPD_LIBS)
3460
3461 if HAVE_GNUTLS
3462 systemd_journal_remote_LDADD += \
3463         $(GNUTLS_LIBS)
3464 endif
3465 endif
3466
3467 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3468 journalctl_CFLAGS = \
3469         $(AM_CFLAGS)
3470
3471 journalctl_SOURCES = \
3472         src/journal/journalctl.c
3473
3474 journalctl_LDADD = \
3475         libsystemd-journal-internal.la \
3476         libsystemd-internal.la \
3477         libsystemd-logs.la \
3478         libsystemd-shared.la
3479
3480 if HAVE_ACL
3481 journalctl_LDADD += \
3482         libsystemd-acl.la
3483 endif
3484
3485 if HAVE_QRENCODE
3486 journalctl_SOURCES += \
3487         src/journal/journal-qrcode.c \
3488         src/journal/journal-qrcode.h
3489
3490 journalctl_CFLAGS += \
3491         $(QRENCODE_CFLAGS)
3492
3493 journalctl_LDADD += \
3494         $(QRENCODE_LIBS)
3495 endif
3496
3497 test_journal_SOURCES = \
3498         src/journal/test-journal.c
3499
3500 test_journal_LDADD = \
3501         libsystemd-journal-core.la
3502
3503 test_journal_send_SOURCES = \
3504         src/journal/test-journal-send.c
3505
3506 test_journal_send_LDADD = \
3507         libsystemd-journal-core.la
3508
3509 test_journal_syslog_SOURCES = \
3510         src/journal/test-journal-syslog.c
3511
3512 test_journal_syslog_LDADD = \
3513         libsystemd-journal-core.la
3514
3515 test_journal_match_SOURCES = \
3516         src/journal/test-journal-match.c
3517
3518 test_journal_match_LDADD = \
3519         libsystemd-journal-core.la
3520
3521 test_journal_enum_SOURCES = \
3522         src/journal/test-journal-enum.c
3523
3524 test_journal_enum_LDADD = \
3525         libsystemd-journal-core.la
3526
3527 test_journal_stream_SOURCES = \
3528         src/journal/test-journal-stream.c
3529
3530 test_journal_stream_LDADD = \
3531         libsystemd-journal-core.la
3532
3533 test_journal_flush_SOURCES = \
3534         src/journal/test-journal-flush.c
3535
3536 test_journal_flush_LDADD = \
3537         libsystemd-journal-core.la
3538
3539 test_journal_init_SOURCES = \
3540         src/journal/test-journal-init.c
3541
3542 test_journal_init_LDADD = \
3543         libsystemd-journal-core.la
3544
3545 test_journal_verify_SOURCES = \
3546         src/journal/test-journal-verify.c
3547
3548 test_journal_verify_LDADD = \
3549         libsystemd-journal-core.la
3550
3551 test_journal_interleaving_SOURCES = \
3552         src/journal/test-journal-interleaving.c
3553
3554 test_journal_interleaving_LDADD = \
3555         libsystemd-journal-core.la
3556
3557 test_mmap_cache_SOURCES = \
3558         src/journal/test-mmap-cache.c
3559
3560 test_mmap_cache_LDADD = \
3561         libsystemd-journal-core.la
3562
3563 test_catalog_SOURCES = \
3564         src/journal/test-catalog.c
3565
3566 test_catalog_CPPFLAGS = \
3567         $(AM_CPPFLAGS) \
3568         -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
3569
3570 test_catalog_LDADD = \
3571         libsystemd-journal-core.la
3572
3573 test_compress_SOURCES = \
3574         src/journal/test-compress.c
3575
3576 test_compress_LDADD = \
3577         libsystemd-journal-internal.la \
3578         libsystemd-shared.la
3579
3580 test_compress_benchmark_SOURCES = \
3581         src/journal/test-compress-benchmark.c
3582
3583 test_compress_benchmark_LDADD = \
3584         libsystemd-journal-internal.la \
3585         libsystemd-shared.la
3586
3587 libsystemd_journal_core_la_SOURCES = \
3588         src/journal/journald-kmsg.c \
3589         src/journal/journald-kmsg.h \
3590         src/journal/journald-syslog.c \
3591         src/journal/journald-syslog.h \
3592         src/journal/journald-stream.c \
3593         src/journal/journald-stream.h \
3594         src/journal/journald-server.c \
3595         src/journal/journald-server.h \
3596         src/journal/journald-console.c \
3597         src/journal/journald-console.h \
3598         src/journal/journald-wall.c \
3599         src/journal/journald-wall.h \
3600         src/journal/journald-native.c \
3601         src/journal/journald-native.h \
3602         src/journal/journald-rate-limit.c \
3603         src/journal/journald-rate-limit.h \
3604         src/journal/journal-internal.h
3605
3606 nodist_libsystemd_journal_core_la_SOURCES = \
3607         src/journal/journald-gperf.c
3608
3609 libsystemd_journal_core_la_LIBADD = \
3610         libsystemd-journal-internal.la \
3611         libudev-internal.la \
3612         libsystemd-capability.la \
3613         libsystemd-label.la \
3614         libsystemd-internal.la \
3615         libsystemd-shared.la
3616
3617 if HAVE_ACL
3618 libsystemd_journal_core_la_LIBADD += \
3619         libsystemd-acl.la
3620 endif
3621
3622 noinst_LTLIBRARIES += \
3623         libsystemd-journal-core.la
3624
3625 journal-install-hook:
3626         -$(MKDIR_P) $(DESTDIR)/var/log/journal
3627         -chown 0:0 $(DESTDIR)/var/log/journal
3628         -chmod 755 $(DESTDIR)/var/log/journal
3629         -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
3630         -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
3631
3632 journal-uninstall-hook:
3633         -rmdir $(DESTDIR)/var/log/journal/
3634
3635 INSTALL_EXEC_HOOKS += journal-install-hook
3636 UNINSTALL_EXEC_HOOKS += journal-uninstall-hook
3637
3638 # ------------------------------------------------------------------------------
3639 # Update catalog on installation. Do not bother if installing
3640 # in DESTDIR, since this is likely for packaging purposes.
3641 catalog-update-hook:
3642         -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
3643
3644 INSTALL_DATA_HOOKS += \
3645         catalog-update-hook
3646
3647 catalog-remove-hook:
3648         -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
3649
3650 UNINSTALL_DATA_HOOKS += \
3651         catalog-remove-hook
3652
3653 manual_tests += \
3654         test-journal-enum
3655
3656 tests += \
3657         test-journal \
3658         test-journal-send \
3659         test-journal-syslog \
3660         test-journal-match \
3661         test-journal-stream \
3662         test-journal-init \
3663         test-journal-verify \
3664         test-journal-interleaving \
3665         test-journal-flush \
3666         test-mmap-cache \
3667         test-catalog
3668
3669 if HAVE_COMPRESSION
3670 tests += \
3671         test-compress \
3672         test-compress-benchmark
3673 endif
3674
3675 pkginclude_HEADERS += \
3676         src/systemd/sd-journal.h \
3677         src/systemd/sd-messages.h \
3678         src/systemd/_sd-common.h
3679
3680 libsystemd_journal_internal_la_SOURCES = \
3681         src/journal/sd-journal.c \
3682         src/systemd/sd-journal.h \
3683         src/systemd/_sd-common.h \
3684         src/journal/journal-file.c \
3685         src/journal/journal-file.h \
3686         src/journal/journal-vacuum.c \
3687         src/journal/journal-vacuum.h \
3688         src/journal/journal-verify.c \
3689         src/journal/journal-verify.h \
3690         src/journal/lookup3.c \
3691         src/journal/lookup3.h \
3692         src/journal/journal-send.c \
3693         src/journal/journal-def.h \
3694         src/journal/compress.h \
3695         src/journal/catalog.c \
3696         src/journal/catalog.h \
3697         src/journal/mmap-cache.c \
3698         src/journal/mmap-cache.h
3699
3700 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3701 libsystemd_journal_internal_la_CFLAGS = \
3702         $(AM_CFLAGS)
3703
3704 libsystemd_journal_internal_la_LIBADD =
3705
3706 libsystemd_journal_internal_la_SOURCES += \
3707         src/journal/compress.c
3708
3709 if HAVE_XZ
3710 libsystemd_journal_internal_la_CFLAGS += \
3711         $(XZ_CFLAGS)
3712
3713 libsystemd_journal_internal_la_LIBADD += \
3714         $(XZ_LIBS)
3715 endif
3716
3717 if HAVE_LZ4
3718 libsystemd_journal_internal_la_LIBADD += \
3719         -llz4
3720 endif
3721
3722 if HAVE_GCRYPT
3723 libsystemd_journal_internal_la_SOURCES += \
3724         src/journal/journal-authenticate.c \
3725         src/journal/journal-authenticate.h \
3726         src/journal/fsprg.c \
3727         src/journal/fsprg.h
3728
3729 libsystemd_journal_internal_la_LIBADD += \
3730         $(GCRYPT_LIBS)
3731
3732 # fsprg.c is a drop-in file using void pointer arithmetic
3733 libsystemd_journal_internal_la_CFLAGS += \
3734         $(GCRYPT_CFLAGS) \
3735         -Wno-pointer-arith
3736 endif
3737
3738 noinst_LTLIBRARIES += \
3739         libsystemd-journal-internal.la
3740
3741 rootlibexec_PROGRAMS += \
3742         systemd-journald
3743
3744 rootbin_PROGRAMS += \
3745         journalctl
3746
3747 bin_PROGRAMS += \
3748         systemd-cat
3749
3750 dist_systemunit_DATA += \
3751         units/systemd-journald.socket \
3752         units/systemd-journald-dev-log.socket
3753
3754 nodist_systemunit_DATA += \
3755         units/systemd-journald.service \
3756         units/systemd-journal-flush.service \
3757         units/systemd-journal-catalog-update.service
3758
3759 dist_pkgsysconf_DATA += \
3760         src/journal/journald.conf
3761
3762 dist_catalog_DATA = \
3763         catalog/systemd.fr.catalog \
3764         catalog/systemd.ru.catalog \
3765         catalog/systemd.it.catalog \
3766         catalog/systemd.catalog
3767
3768 SOCKETS_TARGET_WANTS += \
3769         systemd-journald.socket \
3770         systemd-journald-dev-log.socket
3771
3772 SYSINIT_TARGET_WANTS += \
3773         systemd-journald.service \
3774         systemd-journal-flush.service \
3775         systemd-journal-catalog-update.service
3776
3777 EXTRA_DIST += \
3778         units/systemd-journald.service.in \
3779         units/systemd-journal-flush.service.in \
3780         units/systemd-journal-catalog-update.service.in \
3781         src/journal/journald-gperf.gperf
3782
3783 CLEANFILES += \
3784         src/journal/journald-gperf.c
3785
3786 # ------------------------------------------------------------------------------
3787 if HAVE_MICROHTTPD
3788 gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
3789
3790 rootlibexec_PROGRAMS += \
3791         systemd-journal-gatewayd
3792
3793 systemd_journal_gatewayd_SOURCES = \
3794         src/journal/journal-gatewayd.c \
3795         src/journal/microhttpd-util.h \
3796         src/journal/microhttpd-util.c
3797
3798 systemd_journal_gatewayd_LDADD = \
3799         libsystemd-logs.la \
3800         libsystemd-journal-internal.la \
3801         libsystemd-internal.la \
3802         libsystemd-shared.la \
3803         $(MICROHTTPD_LIBS)
3804
3805 if HAVE_GNUTLS
3806 systemd_journal_gatewayd_LDADD += \
3807         $(GNUTLS_LIBS)
3808 endif
3809
3810 systemd_journal_gatewayd_CFLAGS = \
3811         $(AM_CFLAGS) \
3812         $(MICROHTTPD_CFLAGS)
3813
3814 systemd_journal_gatewayd_CPPFLAGS = \
3815         $(AM_CPPFLAGS) \
3816         -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
3817
3818 dist_systemunit_DATA += \
3819         units/systemd-journal-gatewayd.socket
3820
3821 nodist_systemunit_DATA += \
3822         units/systemd-journal-gatewayd.service
3823
3824 dist_gatewayddocumentroot_DATA = \
3825         src/journal/browse.html
3826
3827 endif
3828
3829 EXTRA_DIST += \
3830         units/systemd-journal-gatewayd.service.in
3831
3832 # ------------------------------------------------------------------------------
3833
3834 systemd_socket_proxyd_SOURCES = \
3835         src/socket-proxy/socket-proxyd.c
3836
3837 systemd_socket_proxyd_LDADD = \
3838         libsystemd-logs.la \
3839         libsystemd-internal.la \
3840         libsystemd-journal-internal.la \
3841         libsystemd-shared.la \
3842         libsystemd-resolve.la
3843
3844 # ------------------------------------------------------------------------------
3845 if ENABLE_COREDUMP
3846 systemd_coredump_SOURCES = \
3847         src/journal/coredump.c \
3848         src/journal/coredump-vacuum.c \
3849         src/journal/coredump-vacuum.h
3850
3851 systemd_coredump_LDADD = \
3852         libsystemd-journal-internal.la \