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