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