chiark / gitweb /
man/sd_journal_next: fix argument in example
[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 = \
3856         src/binfmt/binfmt.c
3857
3858 systemd_binfmt_LDADD = \
3859         libsystemd-shared.la
3860
3861 rootlibexec_PROGRAMS += \
3862         systemd-binfmt
3863
3864 dist_systemunit_DATA += \
3865         units/proc-sys-fs-binfmt_misc.automount \
3866         units/proc-sys-fs-binfmt_misc.mount
3867
3868 nodist_systemunit_DATA += \
3869         units/systemd-binfmt.service
3870
3871 INSTALL_DIRS += \
3872         $(prefix)/lib/binfmt.d \
3873         $(sysconfdir)/binfmt.d
3874
3875 SYSINIT_TARGET_WANTS += \
3876         systemd-binfmt.service \
3877         proc-sys-fs-binfmt_misc.automount
3878
3879 endif
3880
3881 EXTRA_DIST += \
3882         units/systemd-binfmt.service.in
3883
3884 # ------------------------------------------------------------------------------
3885 if ENABLE_VCONSOLE
3886 systemd_vconsole_setup_SOURCES = \
3887         src/vconsole/vconsole-setup.c
3888
3889 systemd_vconsole_setup_LDADD = \
3890         libsystemd-shared.la
3891
3892 rootlibexec_PROGRAMS += \
3893         systemd-vconsole-setup
3894
3895 nodist_systemunit_DATA += \
3896         units/systemd-vconsole-setup.service
3897
3898 SYSINIT_TARGET_WANTS += \
3899         systemd-vconsole-setup.service
3900 endif
3901
3902 EXTRA_DIST += \
3903         units/systemd-vconsole-setup.service.in
3904
3905 # ------------------------------------------------------------------------------
3906 if ENABLE_READAHEAD
3907 systemd_readahead_SOURCES = \
3908         src/readahead/readahead.c \
3909         src/readahead/readahead-collect.c \
3910         src/readahead/readahead-replay.c \
3911         src/readahead/readahead-analyze.c \
3912         src/readahead/readahead-common.c \
3913         src/readahead/readahead-common.h
3914
3915 systemd_readahead_LDADD = \
3916         libsystemd-internal.la \
3917         libudev-internal.la \
3918         libsystemd-shared.la
3919
3920 dist_doc_DATA += \
3921         src/readahead/sd-readahead.c \
3922         src/systemd/sd-readahead.h
3923
3924 rootlibexec_PROGRAMS += \
3925         systemd-readahead
3926
3927 dist_systemunit_DATA += \
3928         units/systemd-readahead-drop.service \
3929         units/systemd-readahead-done.timer
3930
3931 nodist_systemunit_DATA += \
3932         units/systemd-readahead-collect.service \
3933         units/systemd-readahead-replay.service \
3934         units/systemd-readahead-done.service
3935
3936 manual_tests += \
3937         test-ssd
3938
3939 test_ssd_SOURCES = \
3940         src/readahead/test-ssd.c \
3941         src/readahead/readahead-common.c \
3942         src/readahead/readahead-common.h
3943
3944 test_ssd_LDADD = \
3945         libsystemd-internal.la \
3946         libudev-internal.la \
3947         libsystemd-shared.la
3948
3949 endif
3950
3951 EXTRA_DIST += \
3952         units/systemd-readahead-collect.service.in \
3953         units/systemd-readahead-replay.service.in \
3954         units/systemd-readahead-done.service.in
3955
3956 # ------------------------------------------------------------------------------
3957 if ENABLE_BOOTCHART
3958 systemd_bootchart_SOURCES = \
3959         src/bootchart/bootchart.c \
3960         src/bootchart/bootchart.h \
3961         src/bootchart/store.c \
3962         src/bootchart/store.h \
3963         src/bootchart/svg.c \
3964         src/bootchart/svg.h
3965
3966 systemd_bootchart_LDADD = \
3967         libsystemd-journal-internal.la \
3968         libsystemd-shared.la
3969
3970 rootlibexec_PROGRAMS += \
3971         systemd-bootchart
3972
3973 dist_pkgsysconf_DATA += \
3974         src/bootchart/bootchart.conf
3975 endif
3976
3977 # ------------------------------------------------------------------------------
3978 if ENABLE_QUOTACHECK
3979 rootlibexec_PROGRAMS += \
3980         systemd-quotacheck
3981
3982 nodist_systemunit_DATA += \
3983         units/systemd-quotacheck.service
3984
3985 systemd_quotacheck_SOURCES = \
3986         src/quotacheck/quotacheck.c
3987
3988 systemd_quotacheck_LDADD = \
3989         libsystemd-shared.la
3990 endif
3991
3992 EXTRA_DIST += \
3993         units/systemd-quotacheck.service.in
3994
3995 nodist_systemunit_DATA += \
3996         units/quotaon.service
3997
3998 # ------------------------------------------------------------------------------
3999 if ENABLE_RANDOMSEED
4000 rootlibexec_PROGRAMS += \
4001         systemd-random-seed
4002
4003 nodist_systemunit_DATA += \
4004         units/systemd-random-seed.service
4005
4006 systemd_random_seed_SOURCES = \
4007         src/random-seed/random-seed.c
4008
4009 systemd_random_seed_LDADD = \
4010         libsystemd-label.la \
4011         libsystemd-shared.la
4012
4013 SYSINIT_TARGET_WANTS += \
4014         systemd-random-seed.service
4015
4016 endif
4017
4018 EXTRA_DIST += \
4019         units/systemd-random-seed.service.in
4020
4021 # ------------------------------------------------------------------------------
4022 if ENABLE_BACKLIGHT
4023 rootlibexec_PROGRAMS += \
4024         systemd-backlight
4025
4026 nodist_systemunit_DATA += \
4027         units/systemd-backlight@.service
4028
4029 systemd_backlight_SOURCES = \
4030         src/backlight/backlight.c
4031
4032 systemd_backlight_LDADD = \
4033         libsystemd-label.la \
4034         libudev-internal.la \
4035         libsystemd-shared.la
4036 endif
4037
4038 EXTRA_DIST += \
4039         units/systemd-backlight@.service.in
4040
4041 # ------------------------------------------------------------------------------
4042 if ENABLE_RFKILL
4043 rootlibexec_PROGRAMS += \
4044         systemd-rfkill
4045
4046 nodist_systemunit_DATA += \
4047         units/systemd-rfkill@.service
4048
4049 systemd_rfkill_SOURCES = \
4050         src/rfkill/rfkill.c
4051
4052 systemd_rfkill_LDADD = \
4053         libsystemd-label.la \
4054         libudev-internal.la \
4055         libsystemd-shared.la
4056 endif
4057
4058 EXTRA_DIST += \
4059         units/systemd-rfkill@.service.in
4060
4061 # ------------------------------------------------------------------------------
4062 if HAVE_LIBCRYPTSETUP
4063 rootlibexec_PROGRAMS += \
4064         systemd-cryptsetup
4065
4066 systemgenerator_PROGRAMS += \
4067         systemd-cryptsetup-generator
4068
4069 dist_systemunit_DATA += \
4070         units/cryptsetup.target \
4071         units/cryptsetup-pre.target
4072
4073 systemd_cryptsetup_SOURCES = \
4074         src/cryptsetup/cryptsetup.c
4075
4076 systemd_cryptsetup_CFLAGS = \
4077         $(AM_CFLAGS) \
4078         $(LIBCRYPTSETUP_CFLAGS)
4079
4080 systemd_cryptsetup_LDADD = \
4081         libsystemd-label.la \
4082         libudev-internal.la \
4083         libsystemd-shared.la \
4084         $(LIBCRYPTSETUP_LIBS)
4085
4086 systemd_cryptsetup_generator_SOURCES = \
4087         src/cryptsetup/cryptsetup-generator.c
4088
4089 systemd_cryptsetup_generator_LDADD = \
4090         libsystemd-label.la \
4091         libsystemd-shared.la
4092
4093 SYSINIT_TARGET_WANTS += \
4094         cryptsetup.target
4095
4096 endif
4097
4098 # ------------------------------------------------------------------------------
4099 if ENABLE_HOSTNAMED
4100 systemd_hostnamed_SOURCES = \
4101         src/hostname/hostnamed.c
4102
4103 systemd_hostnamed_LDADD = \
4104         libsystemd-label.la \
4105         libsystemd-internal.la \
4106         libsystemd-shared.la
4107
4108 rootlibexec_PROGRAMS += \
4109         systemd-hostnamed
4110
4111 nodist_systemunit_DATA += \
4112         units/systemd-hostnamed.service
4113
4114 dist_systemunit_DATA += \
4115         units/org.freedesktop.hostname1.busname
4116
4117 dist_dbuspolicy_DATA += \
4118         src/hostname/org.freedesktop.hostname1.conf
4119
4120 dist_dbussystemservice_DATA += \
4121         src/hostname/org.freedesktop.hostname1.service
4122
4123 polkitpolicy_files += \
4124         src/hostname/org.freedesktop.hostname1.policy
4125
4126 SYSTEM_UNIT_ALIASES += \
4127         systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
4128
4129 BUSNAMES_TARGET_WANTS += \
4130         org.freedesktop.hostname1.busname
4131
4132 hostnamectl_SOURCES = \
4133         src/hostname/hostnamectl.c
4134
4135 hostnamectl_LDADD = \
4136         libsystemd-internal.la \
4137         libsystemd-shared.la
4138
4139 bin_PROGRAMS += \
4140         hostnamectl
4141
4142 dist_bashcompletion_DATA += \
4143         shell-completion/bash/hostnamectl
4144
4145 dist_zshcompletion_DATA += \
4146         shell-completion/zsh/_hostnamectl
4147
4148 endif
4149
4150 polkitpolicy_in_files += \
4151         src/hostname/org.freedesktop.hostname1.policy.in
4152
4153 EXTRA_DIST += \
4154         units/systemd-hostnamed.service.in
4155
4156 # ------------------------------------------------------------------------------
4157 if ENABLE_KDBUS
4158 dist_systemunit_DATA += \
4159         units/org.freedesktop.systemd1.busname
4160
4161 BUSNAMES_TARGET_WANTS += \
4162         org.freedesktop.systemd1.busname
4163 endif
4164
4165 # ------------------------------------------------------------------------------
4166 if ENABLE_LOCALED
4167 systemd_localed_SOURCES = \
4168         src/locale/localed.c
4169
4170 systemd_localed_LDADD = \
4171         libsystemd-label.la \
4172         libsystemd-internal.la \
4173         libsystemd-shared.la
4174
4175 nodist_systemunit_DATA += \
4176         units/systemd-localed.service
4177
4178 dist_systemunit_DATA += \
4179         units/org.freedesktop.locale1.busname
4180
4181 rootlibexec_PROGRAMS += \
4182         systemd-localed
4183
4184 dist_dbuspolicy_DATA += \
4185         src/locale/org.freedesktop.locale1.conf
4186
4187 dist_dbussystemservice_DATA += \
4188         src/locale/org.freedesktop.locale1.service
4189
4190 polkitpolicy_files += \
4191         src/locale/org.freedesktop.locale1.policy
4192
4193 SYSTEM_UNIT_ALIASES += \
4194         systemd-localed.service dbus-org.freedesktop.locale1.service
4195
4196 BUSNAMES_TARGET_WANTS += \
4197         org.freedesktop.locale1.busname
4198
4199 dist_pkgdata_DATA += \
4200         src/locale/kbd-model-map
4201
4202 dist_noinst_SCRIPT = \
4203         src/locale/generate-kbd-model-map
4204
4205 update-kbd-model-map: src/locale/generate-kbd-model-map
4206         $PYTHON $< >src/locale/kbd-model-map
4207
4208 localectl_SOURCES = \
4209         src/locale/localectl.c
4210
4211 localectl_LDADD = \
4212         libsystemd-internal.la \
4213         libsystemd-shared.la
4214
4215 bin_PROGRAMS += \
4216         localectl
4217
4218 dist_bashcompletion_DATA += \
4219         shell-completion/bash/localectl
4220
4221 dist_zshcompletion_DATA += \
4222         shell-completion/zsh/_localectl
4223
4224 endif
4225
4226 .PHONY: update-kbd-model-map
4227
4228 polkitpolicy_in_files += \
4229         src/locale/org.freedesktop.locale1.policy.in
4230
4231 EXTRA_DIST += \
4232         units/systemd-localed.service.in
4233
4234 # ------------------------------------------------------------------------------
4235 if ENABLE_TIMEDATED
4236 systemd_timedated_SOURCES = \
4237         src/timedate/timedated.c
4238
4239 systemd_timedated_LDADD = \
4240         libsystemd-label.la \
4241         libsystemd-internal.la \
4242         libsystemd-shared.la
4243
4244 rootlibexec_PROGRAMS += \
4245         systemd-timedated
4246
4247 dist_dbussystemservice_DATA += \
4248         src/timedate/org.freedesktop.timedate1.service
4249
4250 dist_dbuspolicy_DATA += \
4251         src/timedate/org.freedesktop.timedate1.conf
4252
4253 nodist_systemunit_DATA += \
4254         units/systemd-timedated.service
4255
4256 dist_systemunit_DATA += \
4257         units/org.freedesktop.timedate1.busname
4258
4259 polkitpolicy_files += \
4260         src/timedate/org.freedesktop.timedate1.policy
4261
4262 INSTALL_DIRS += \
4263         $(prefix)/lib/systemd/ntp-units.d \
4264         $(sysconfdir)/systemd/ntp-units.d
4265
4266 SYSTEM_UNIT_ALIASES += \
4267         systemd-timedated.service dbus-org.freedesktop.timedate1.service
4268
4269 BUSNAMES_TARGET_WANTS += \
4270         org.freedesktop.timedate1.busname
4271
4272 timedatectl_SOURCES = \
4273         src/timedate/timedatectl.c
4274
4275 timedatectl_LDADD = \
4276         libsystemd-internal.la \
4277         libsystemd-shared.la
4278
4279 bin_PROGRAMS += \
4280         timedatectl
4281
4282 dist_bashcompletion_DATA += \
4283         shell-completion/bash/timedatectl
4284
4285 dist_zshcompletion_DATA += \
4286         shell-completion/zsh/_timedatectl
4287 endif
4288
4289 polkitpolicy_in_files += \
4290         src/timedate/org.freedesktop.timedate1.policy.in
4291
4292 EXTRA_DIST += \
4293         units/systemd-timedated.service.in
4294
4295 # ------------------------------------------------------------------------------
4296 if ENABLE_TIMESYNCD
4297 systemd_timesyncd_SOURCES = \
4298         src/timesync/timesyncd.c \
4299         src/timesync/timesyncd.h
4300
4301 nodist_systemd_timesyncd_SOURCES = \
4302         src/timesync/timesyncd-gperf.c
4303
4304 EXTRA_DIST += \
4305         src/timesync/timesyncd-gperf.gperf
4306
4307 CLEANFILES += \
4308         src/timesync/timesyncd-gperf.c
4309
4310 systemd_timesyncd_LDADD = \
4311         libsystemd-resolve.la \
4312         libsystemd-network.la \
4313         libsystemd-label.la \
4314         libsystemd-capability.la \
4315         libsystemd-internal.la \
4316         libsystemd-shared.la \
4317         -lm
4318
4319 rootlibexec_PROGRAMS += \
4320         systemd-timesyncd
4321
4322 nodist_systemunit_DATA += \
4323         units/systemd-timesyncd.service
4324
4325 GENERAL_ALIASES += \
4326         $(systemunitdir)/systemd-timesyncd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-timesyncd.service
4327
4328 EXTRA_DIST += \
4329         units/systemd-timesyncd.service.in
4330
4331 nodist_pkgsysconf_DATA += \
4332         src/timesync/timesyncd.conf
4333
4334 EXTRA_DIST += \
4335         src/timesync/timesyncd.conf.in
4336
4337 CLEANFILES += \
4338         src/timesync/timesyncd.conf
4339
4340 dist_ntpunits_DATA = \
4341         src/timesync/90-systemd.list
4342
4343 endif
4344
4345 # ------------------------------------------------------------------------------
4346 if HAVE_MYHOSTNAME
4347 libnss_myhostname_la_SOURCES = \
4348         src/nss-myhostname/nss-myhostname.c \
4349         src/nss-myhostname/ifconf.h \
4350         src/nss-myhostname/netlink.c
4351
4352 libnss_myhostname_la_LDFLAGS = \
4353         $(AM_LDFLAGS) \
4354         -module \
4355         -export-dynamic \
4356         -avoid-version \
4357         -shared \
4358         -shrext .so.2
4359
4360 libnss_myhostname_la_LIBADD = \
4361         libsystemd-shared.la \
4362         libsystemd-internal.la
4363
4364 lib_LTLIBRARIES += \
4365         libnss_myhostname.la
4366 endif
4367
4368 # ------------------------------------------------------------------------------
4369 if ENABLE_MACHINED
4370 systemd_machined_SOURCES = \
4371         src/machine/machined.c \
4372         src/machine/machined.h
4373
4374 systemd_machined_LDADD = \
4375         libsystemd-machine-core.la
4376
4377 rootlibexec_PROGRAMS += \
4378         systemd-machined
4379
4380 libsystemd_machine_core_la_SOURCES = \
4381         src/machine/machined-dbus.c \
4382         src/machine/machine.c \
4383         src/machine/machine.h \
4384         src/machine/machine-dbus.c
4385
4386 libsystemd_machine_core_la_LIBADD = \
4387         libsystemd-label.la \
4388         libsystemd-internal.la \
4389         libudev-internal.la \
4390         libsystemd-shared.la
4391
4392 noinst_LTLIBRARIES += \
4393         libsystemd-machine-core.la
4394
4395 machinectl_SOURCES = \
4396         src/machine/machinectl.c
4397
4398 machinectl_LDADD = \
4399         libsystemd-internal.la \
4400         libsystemd-shared.la
4401
4402 rootbin_PROGRAMS += \
4403         machinectl
4404
4405 dist_bashcompletion_DATA += \
4406         shell-completion/bash/machinectl
4407
4408 test_machine_tables_SOURCES = \
4409         src/machine/test-machine-tables.c
4410
4411 test_machine_tables_LDADD = \
4412         libsystemd-machine-core.la
4413
4414 tests += \
4415         test-machine-tables
4416
4417 nodist_systemunit_DATA += \
4418         units/systemd-machined.service
4419
4420 dist_systemunit_DATA += \
4421         units/machine.slice \
4422         units/org.freedesktop.machine1.busname
4423
4424 dist_dbussystemservice_DATA += \
4425         src/machine/org.freedesktop.machine1.service
4426
4427 dist_dbuspolicy_DATA += \
4428         src/machine/org.freedesktop.machine1.conf
4429
4430 dist_zshcompletion_DATA += \
4431         shell-completion/zsh/_machinectl \
4432         shell-completion/zsh/_sd_machines
4433
4434 SYSTEM_UNIT_ALIASES += \
4435         systemd-machined.service dbus-org.freedesktop.machine1.service
4436
4437 BUSNAMES_TARGET_WANTS += \
4438         org.freedesktop.machine1.busname
4439
4440 EXTRA_DIST += \
4441         units/systemd-machined.service.in
4442
4443 endif
4444
4445 # ------------------------------------------------------------------------------
4446 if ENABLE_RESOLVED
4447 systemd_resolved_SOURCES = \
4448         src/resolve/resolved.h \
4449         src/resolve/resolved.c \
4450         src/resolve/resolved-manager.c
4451
4452 systemd_resolved_CFLAGS = \
4453         $(AM_CFLAGS) \
4454         $(KMOD_CFLAGS)
4455
4456 nodist_systemd_resolved_SOURCES = \
4457         src/resolve/resolved-gperf.c
4458
4459 EXTRA_DIST += \
4460         src/resolve/resolved-gperf.gperf
4461
4462 CLEANFILES += \
4463         src/resolve/resolved-gperf.c
4464
4465 systemd_resolved_LDADD = \
4466         libsystemd-capability.la \
4467         libsystemd-network.la \
4468         libsystemd-label.la \
4469         libsystemd-internal.la \
4470         libsystemd-shared.la
4471
4472 rootlibexec_PROGRAMS += \
4473         systemd-resolved
4474
4475 nodist_systemunit_DATA += \
4476         units/systemd-resolved.service
4477
4478 EXTRA_DIST += \
4479         units/systemd-resolved.service.in
4480
4481 GENERAL_ALIASES += \
4482         $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service
4483
4484 nodist_pkgsysconf_DATA += \
4485         src/resolve/resolved.conf
4486
4487 EXTRA_DIST += \
4488         src/resolve/resolved.conf.in
4489
4490 CLEANFILES += \
4491         src/resolve/resolved.conf
4492
4493 endif
4494
4495 # ------------------------------------------------------------------------------
4496 if ENABLE_NETWORKD
4497 rootlibexec_PROGRAMS += \
4498         systemd-networkd
4499
4500 systemd_networkd_SOURCES = \
4501         src/network/networkd.c
4502
4503 systemd_networkd_LDADD = \
4504         libsystemd-networkd-core.la \
4505         libsystemd-capability.la
4506
4507 noinst_LTLIBRARIES += \
4508         libsystemd-networkd-core.la
4509
4510 libsystemd_networkd_core_la_CFLAGS = \
4511         $(AM_CFLAGS)
4512
4513 libsystemd_networkd_core_la_SOURCES = \
4514         src/libsystemd-network/network-internal.h \
4515         src/network/networkd.h \
4516         src/network/networkd-link.c \
4517         src/network/networkd-netdev.c \
4518         src/network/networkd-tunnel.c \
4519         src/network/networkd-veth.c \
4520         src/network/networkd-vxlan.c \
4521         src/network/networkd-network.c \
4522         src/network/networkd-address.c \
4523         src/network/networkd-route.c \
4524         src/network/networkd-manager.c \
4525         src/network/networkd-address-pool.c
4526
4527 nodist_libsystemd_networkd_core_la_SOURCES = \
4528         src/network/networkd-network-gperf.c \
4529         src/network/networkd-netdev-gperf.c
4530
4531 libsystemd_networkd_core_la_LIBADD = \
4532         libudev-internal.la \
4533         libsystemd-internal.la \
4534         libsystemd-network.la \
4535         libsystemd-label.la \
4536         libsystemd-shared.la
4537
4538 rootlibexec_PROGRAMS += \
4539         systemd-networkd-wait-online
4540
4541 systemd_networkd_wait_online_CFLAGS = \
4542         $(AM_CFLAGS)
4543
4544 systemd_networkd_wait_online_SOURCES = \
4545         src/libsystemd-network/network-internal.h \
4546         src/network/networkd-wait-online.c \
4547         src/network/networkd-wait-online.h
4548
4549 systemd_networkd_wait_online_LDADD = \
4550         libsystemd-network.la \
4551         libudev-internal.la \
4552         libsystemd-internal.la \
4553         libsystemd-shared.la
4554
4555 test_network_SOURCES = \
4556         src/network/test-network.c
4557
4558 test_network_CFLAGS = \
4559         $(AM_CFLAGS)
4560
4561 test_network_LDADD = \
4562         libsystemd-networkd-core.la
4563
4564 tests += \
4565         test-network
4566
4567 nodist_systemunit_DATA += \
4568         units/systemd-networkd.service \
4569         units/systemd-networkd-wait-online.service
4570
4571 GENERAL_ALIASES += \
4572         $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \
4573         $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service
4574
4575 EXTRA_DIST += \
4576         src/network/networkd-network-gperf.gperf \
4577         src/network/networkd-netdev-gperf.gperf \
4578         units/systemd-networkd.service.in \
4579         units/systemd-networkd-wait-online.service.in
4580
4581 CLEANFILES += \
4582         src/network/networkd-network-gperf.c \
4583         src/network/networkd-netdev-gperf.c
4584 endif
4585
4586 # ------------------------------------------------------------------------------
4587 if ENABLE_LOGIND
4588 systemd_logind_SOURCES = \
4589         src/login/logind.c \
4590         src/login/logind.h
4591
4592 nodist_systemd_logind_SOURCES = \
4593         src/login/logind-gperf.c
4594
4595 systemd_logind_LDADD = \
4596         libsystemd-logind-core.la
4597
4598 libsystemd_logind_core_la_SOURCES = \
4599         src/login/logind-core.c \
4600         src/login/logind-device.c \
4601         src/login/logind-device.h \
4602         src/login/logind-button.c \
4603         src/login/logind-button.h \
4604         src/login/logind-action.c \
4605         src/login/logind-action.h \
4606         src/login/logind-seat.c \
4607         src/login/logind-seat.h \
4608         src/login/logind-session.c \
4609         src/login/logind-session.h \
4610         src/login/logind-session-device.c \
4611         src/login/logind-session-device.h \
4612         src/login/logind-user.c \
4613         src/login/logind-user.h \
4614         src/login/logind-inhibit.c \
4615         src/login/logind-inhibit.h \
4616         src/login/logind-dbus.c \
4617         src/login/logind-session-dbus.c \
4618         src/login/logind-seat-dbus.c \
4619         src/login/logind-user-dbus.c \
4620         src/login/logind-acl.h
4621
4622 libsystemd_logind_core_la_LIBADD = \
4623         libsystemd-label.la \
4624         libsystemd-capability.la \
4625         libsystemd-internal.la \
4626         libudev-internal.la \
4627         libsystemd-shared.la
4628
4629 if HAVE_ACL
4630 libsystemd_logind_core_la_SOURCES += \
4631         src/login/logind-acl.c
4632
4633 libsystemd_logind_core_la_LIBADD += \
4634         libsystemd-acl.la
4635 endif
4636
4637 noinst_LTLIBRARIES += \
4638         libsystemd-logind-core.la
4639
4640 systemd_user_sessions_SOURCES = \
4641         src/login/user-sessions.c
4642
4643 systemd_user_sessions_LDADD = \
4644         libsystemd-shared.la
4645
4646 rootlibexec_PROGRAMS += \
4647         systemd-logind \
4648         systemd-user-sessions
4649
4650 loginctl_SOURCES = \
4651         src/login/loginctl.c \
4652         src/login/sysfs-show.c
4653
4654 loginctl_LDADD = \
4655         libsystemd-internal.la \
4656         libudev-internal.la \
4657         libsystemd-shared.la
4658
4659 rootbin_PROGRAMS += \
4660         loginctl
4661
4662 dist_bashcompletion_DATA += \
4663         shell-completion/bash/loginctl
4664
4665 dist_zshcompletion_DATA += \
4666         shell-completion/zsh/_loginctl \
4667         shell-completion/zsh/_systemd-inhibit
4668
4669 systemd_inhibit_SOURCES = \
4670         src/login/inhibit.c
4671
4672 systemd_inhibit_LDADD = \
4673         libsystemd-internal.la \
4674         libsystemd-shared.la
4675
4676 rootbin_PROGRAMS += \
4677         systemd-inhibit
4678
4679 test_login_SOURCES = \
4680         src/libsystemd/sd-login/test-login.c
4681
4682 test_login_LDADD = \
4683         libsystemd-internal.la \
4684         libsystemd-shared.la
4685
4686 test_login_shared_SOURCES = \
4687         src/login/test-login-shared.c
4688
4689 test_login_shared_LDADD = \
4690         libsystemd-internal.la \
4691         libsystemd-shared.la
4692
4693 test_inhibit_SOURCES = \
4694         src/login/test-inhibit.c
4695
4696 test_inhibit_LDADD = \
4697         libsystemd-internal.la \
4698         libsystemd-shared.la
4699
4700 test_login_tables_SOURCES = \
4701         src/login/test-login-tables.c
4702
4703 test_login_tables_LDADD = \
4704         libsystemd-logind-core.la
4705
4706 manual_tests += \
4707         test-login \
4708         test-inhibit
4709
4710 tests += \
4711         test-login-tables \
4712         test-login-shared
4713
4714 if HAVE_PAM
4715 pam_systemd_la_SOURCES = \
4716         src/login/pam_systemd.sym \
4717         src/login/pam_systemd.c
4718
4719 pam_systemd_la_CFLAGS = \
4720         $(AM_CFLAGS) \
4721         $(PAM_CFLAGS) \
4722         -fvisibility=hidden
4723
4724 pam_systemd_la_LDFLAGS = \
4725         $(AM_LDFLAGS) \
4726         -module \
4727         -export-dynamic \
4728         -avoid-version \
4729         -shared \
4730         -Wl,--version-script=$(top_srcdir)/src/login/pam_systemd.sym
4731
4732 pam_systemd_la_LIBADD = \
4733         libsystemd-capability.la \
4734         libsystemd-internal.la \
4735         libsystemd-shared.la \
4736         $(PAM_LIBS)
4737
4738 pamlib_LTLIBRARIES = \
4739         pam_systemd.la
4740
4741 dist_pamconf_DATA = \
4742         src/login/systemd-user
4743 endif
4744
4745 nodist_systemunit_DATA += \
4746         units/systemd-logind.service \
4747         units/systemd-user-sessions.service
4748
4749 dist_systemunit_DATA += \
4750         units/user.slice \
4751         units/org.freedesktop.login1.busname
4752
4753 dist_dbussystemservice_DATA += \
4754         src/login/org.freedesktop.login1.service
4755
4756 dist_dbuspolicy_DATA += \
4757         src/login/org.freedesktop.login1.conf
4758
4759 dist_pkgsysconf_DATA += \
4760         src/login/logind.conf
4761
4762 polkitpolicy_files += \
4763         src/login/org.freedesktop.login1.policy
4764
4765 INSTALL_DIRS += \
4766         $(systemdstatedir)
4767
4768 MULTI_USER_TARGET_WANTS += \
4769         systemd-logind.service \
4770         systemd-user-sessions.service
4771
4772 SYSTEM_UNIT_ALIASES += \
4773         systemd-logind.service dbus-org.freedesktop.login1.service
4774
4775 BUSNAMES_TARGET_WANTS += \
4776         org.freedesktop.login1.busname
4777
4778 if ENABLE_MULTI_SEAT_X
4779
4780 systemd_multi_seat_x_SOURCES = \
4781         src/login/multi-seat-x.c
4782
4783 systemd_multi_seat_x_LDADD = \
4784         libsystemd-label.la \
4785         libsystemd-shared.la
4786
4787 rootlibexec_PROGRAMS += \
4788         systemd-multi-seat-x
4789
4790 endif
4791
4792 dist_udevrules_DATA += \
4793         src/login/70-uaccess.rules \
4794         src/login/70-power-switch.rules
4795
4796 nodist_udevrules_DATA += \
4797         src/login/71-seat.rules \
4798         src/login/73-seat-late.rules
4799
4800 CLEANFILES += \
4801         src/login/logind-gperf.c \
4802         src/login/71-seat.rules \
4803         src/login/73-seat-late.rules
4804 endif
4805
4806 polkitpolicy_in_files += \
4807         src/login/org.freedesktop.login1.policy.in
4808
4809 EXTRA_DIST += \
4810         src/login/logind-gperf.gperf \
4811         src/login/71-seat.rules.in \
4812         src/login/73-seat-late.rules.in \
4813         units/systemd-logind.service.in \
4814         units/systemd-user-sessions.service.in
4815
4816 # ------------------------------------------------------------------------------
4817 if HAVE_PYTHON_DEVEL
4818 pkgpyexec_LTLIBRARIES = \
4819         _journal.la \
4820         id128.la \
4821         _daemon.la \
4822         _reader.la \
4823         login.la
4824
4825 _journal_la_SOURCES = \
4826         src/python-systemd/_journal.c
4827
4828 _journal_la_CFLAGS = \
4829         $(AM_CFLAGS) \
4830         -fvisibility=default \
4831         $(PYTHON_DEVEL_CFLAGS)
4832
4833 _journal_la_LDFLAGS = \
4834         $(AM_LDFLAGS) \
4835         -shared \
4836         -module \
4837         -avoid-version
4838
4839 _journal_la_LIBADD = \
4840         $(PYTHON_DEVEL_LIBS) \
4841         libsystemd.la
4842
4843 id128_la_SOURCES = \
4844         src/python-systemd/id128.c \
4845         src/python-systemd/pyutil.c \
4846         src/python-systemd/pyutil.h
4847
4848 nodist_id128_la_SOURCES = \
4849         src/python-systemd/id128-constants.h
4850
4851 id128_la_CFLAGS = \
4852         $(AM_CFLAGS) \
4853         -fvisibility=default \
4854         $(PYTHON_DEVEL_CFLAGS) \
4855         -I$(top_builddir)/src/python-systemd
4856
4857 id128_la_LDFLAGS = \
4858         $(AM_LDFLAGS) \
4859         -shared \
4860         -module \
4861         -avoid-version
4862
4863 id128_la_LIBADD = \
4864         $(PYTHON_DEVEL_LIBS) \
4865         libsystemd-shared.la \
4866         libsystemd.la
4867
4868 _daemon_la_SOURCES = \
4869         src/python-systemd/_daemon.c \
4870         src/python-systemd/pyutil.c \
4871         src/python-systemd/pyutil.h
4872
4873 _daemon_la_CFLAGS = \
4874         $(AM_CFLAGS) \
4875         -fvisibility=default \
4876         $(PYTHON_DEVEL_CFLAGS) \
4877         -I$(top_builddir)/src/python-systemd
4878
4879 _daemon_la_LDFLAGS = \
4880         $(AM_LDFLAGS) \
4881         -shared \
4882         -module \
4883         -avoid-version
4884
4885 _daemon_la_LIBADD = \
4886         $(PYTHON_DEVEL_LIBS) \
4887         libsystemd-shared.la \
4888         libsystemd.la
4889
4890 _reader_la_SOURCES = \
4891         src/python-systemd/_reader.c \
4892         src/python-systemd/pyutil.c \
4893         src/python-systemd/pyutil.h
4894
4895 _reader_la_CFLAGS = \
4896         $(AM_CFLAGS) \
4897         -fvisibility=default \
4898         $(PYTHON_DEVEL_CFLAGS)
4899
4900 _reader_la_LDFLAGS = \
4901         $(AM_LDFLAGS) \
4902         -shared \
4903         -module \
4904         -avoid-version
4905
4906 _reader_la_LIBADD = \
4907         $(PYTHON_DEVEL_LIBS) \
4908         libsystemd-shared.la \
4909         libsystemd.la
4910
4911 login_la_SOURCES = \
4912         src/python-systemd/login.c \
4913         src/python-systemd/pyutil.c \
4914         src/python-systemd/pyutil.h
4915
4916 login_la_CFLAGS = \
4917         $(AM_CFLAGS) \
4918         -fvisibility=default \
4919         $(PYTHON_DEVEL_CFLAGS)
4920
4921 login_la_LDFLAGS = \
4922         $(AM_LDFLAGS) \
4923         -shared \
4924         -module \
4925         -avoid-version
4926
4927 login_la_LIBADD = \
4928         $(PYTHON_DEVEL_LIBS) \
4929         libsystemd-shared.la \
4930         libsystemd.la
4931
4932 dist_pkgpyexec_PYTHON = \
4933         src/python-systemd/journal.py \
4934         src/python-systemd/daemon.py \
4935         src/python-systemd/__init__.py
4936
4937 src/python-systemd/id128-constants.h: src/systemd/sd-messages.h
4938         $(AM_V_at)$(MKDIR_P) $(dir $@)
4939         $(AM_V_GEN)$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
4940
4941 BUILT_SOURCES += \
4942         src/python-systemd/id128-constants.h
4943
4944 SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
4945 sphinx-%:
4946         $(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
4947         $(AM_V_GEN)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(SPHINX_BUILD) -b $* $(SPHINXOPTS) $(top_srcdir)/src/python-systemd/docs $(top_builddir)/docs/html/python-systemd/
4948         $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/html/python-systemd/
4949
4950 python-shell:
4951         $(AM_V_at)echo "Starting python with $(DESTDIR)$(pyexecdir)"
4952         $(AM_V_at)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(PYTHON)
4953
4954 destdir-sphinx: all
4955         dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
4956                 $(MAKE) DESTDIR="$$dir" install && \
4957                 $(MAKE) DESTDIR="$$dir" sphinx-html && \
4958                 rm -rf "$$dir"
4959
4960 endif
4961
4962 CLEAN_LOCAL_HOOKS += clean-sphinx
4963
4964 .PHONY: python-shell destdir-sphinx clean-sphinx clean-python
4965
4966 clean-sphinx:
4967         -rm -rf docs/html/python-systemd/
4968
4969 # Remove Python stuff, e.g. to force rebuilding for a different Python version.
4970 clean-python:
4971         -rm -rf src/python-systemd/.libs src/python-systemd/*.l[ao]
4972         -rm -f _daemon.la id128.la _journal.la login.la _reader.la
4973
4974 # ------------------------------------------------------------------------------
4975 if ENABLE_COMPAT_LIBS
4976 EXTRA_DIST += \
4977         src/compat-libs/linkwarning.h
4978
4979 libsystemd-%.c: src/compat-libs/libsystemd-%.sym
4980         $(AM_V_at)$(MKDIR_P) $(dir $@)
4981         $(AM_V_GEN)sed -r -n 's/^ +(sd_.*);/obsolete_lib(\1,$(notdir $(basename $<)));/p' <$< >$@
4982
4983 BUILT_SOURCES += \
4984         libsystemd-journal.c \
4985         libsystemd-login.c \
4986         libsystemd-id128.c \
4987         libsystemd-daemon.c
4988
4989 libsystemd_journal_la_SOURCES = \
4990         libsystemd-journal.c \
4991         src/compat-libs/libsystemd-journal.sym
4992
4993 libsystemd_journal_la_CPPFLAGS = \
4994         $(AM_CFLAGS) \
4995         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4996
4997 libsystemd_journal_la_LDFLAGS = \
4998         $(AM_LDFLAGS) \
4999         -version-info $(LIBSYSTEMD_JOURNAL_CURRENT):$(LIBSYSTEMD_JOURNAL_REVISION):$(LIBSYSTEMD_JOURNAL_AGE) \
5000         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-journal.sym
5001
5002 libsystemd_journal_la_LIBADD = \
5003         libsystemd-journal-internal.la \
5004         libsystemd-internal.la \
5005         libsystemd-shared.la
5006
5007 libsystemd_login_la_SOURCES = \
5008         libsystemd-login.c \
5009         src/compat-libs/libsystemd-login.sym
5010
5011 libsystemd_login_la_CPPFLAGS = \
5012         $(AM_CFLAGS) \
5013         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
5014
5015 libsystemd_login_la_LDFLAGS = \
5016         $(AM_LDFLAGS) \
5017         -version-info $(LIBSYSTEMD_LOGIN_CURRENT):$(LIBSYSTEMD_LOGIN_REVISION):$(LIBSYSTEMD_LOGIN_AGE) \
5018         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-login.sym
5019
5020 libsystemd_login_la_LIBADD = \
5021         libsystemd-internal.la \
5022         libsystemd-shared.la
5023
5024 libsystemd_id128_la_SOURCES = \
5025         libsystemd-id128.c \
5026         src/compat-libs/libsystemd-id128.sym
5027
5028 libsystemd_id128_la_CPPFLAGS = \
5029         $(AM_CFLAGS) \
5030         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
5031
5032 libsystemd_id128_la_LDFLAGS = \
5033         $(AM_LDFLAGS) \
5034         -version-info $(LIBSYSTEMD_ID128_CURRENT):$(LIBSYSTEMD_ID128_REVISION):$(LIBSYSTEMD_ID128_AGE) \
5035         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-id128.sym
5036
5037 libsystemd_id128_la_LIBADD = \
5038         libsystemd-internal.la \
5039         libsystemd-shared.la
5040
5041 libsystemd_daemon_la_SOURCES = \
5042         libsystemd-daemon.c \
5043         src/compat-libs/libsystemd-daemon.sym
5044
5045 libsystemd_daemon_la_CPPFLAGS = \
5046         $(AM_CFLAGS) \
5047         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
5048
5049 libsystemd_daemon_la_LDFLAGS = \
5050         $(AM_LDFLAGS) \
5051         -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
5052         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-daemon.sym
5053
5054 libsystemd_daemon_la_LIBADD = \
5055         libsystemd-internal.la \
5056         libsystemd-shared.la
5057
5058 lib_LTLIBRARIES += \
5059         libsystemd-journal.la \
5060         libsystemd-login.la \
5061         libsystemd-id128.la \
5062         libsystemd-daemon.la
5063
5064 pkgconfiglib_DATA += \
5065         src/compat-libs/libsystemd-journal.pc \
5066         src/compat-libs/libsystemd-login.pc \
5067         src/compat-libs/libsystemd-id128.pc \
5068         src/compat-libs/libsystemd-daemon.pc
5069
5070 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
5071 compat-lib-install-hook:
5072         libname=libsystemd-login.so && $(move-to-rootlibdir)
5073         libname=libsystemd-journal.so && $(move-to-rootlibdir)
5074         libname=libsystemd-id128.so && $(move-to-rootlibdir)
5075         libname=libsystemd-daemon.so && $(move-to-rootlibdir)
5076
5077 compat-lib-uninstall-hook:
5078         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-login.so*
5079         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so*
5080         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-id128.so*
5081         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so*
5082
5083 INSTALL_EXEC_HOOKS += compat-lib-install-hook
5084 UNINSTALL_EXEC_HOOKS += compat-lib-uninstall-hook
5085 endif
5086
5087 EXTRA_DIST += \
5088         src/compat-libs/libsystemd-journal.pc.in \
5089         src/compat-libs/libsystemd-login.pc.in \
5090         src/compat-libs/libsystemd-id128.pc.in \
5091         src/compat-libs/libsystemd-daemon.pc.in
5092
5093 # ------------------------------------------------------------------------------
5094 substitutions = \
5095        '|rootlibexecdir=$(rootlibexecdir)|' \
5096        '|rootbindir=$(rootbindir)|' \
5097        '|bindir=$(bindir)|' \
5098        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
5099        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
5100        '|pkgsysconfdir=$(pkgsysconfdir)|' \
5101        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
5102        '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
5103        '|pkgdatadir=$(pkgdatadir)|' \
5104        '|systemunitdir=$(systemunitdir)|' \
5105        '|userunitdir=$(userunitdir)|' \
5106        '|systempresetdir=$(systempresetdir)|' \
5107        '|userpresetdir=$(userpresetdir)|' \
5108        '|udevhwdbdir=$(udevhwdbdir)|' \
5109        '|udevrulesdir=$(udevrulesdir)|' \
5110        '|catalogdir=$(catalogdir)|' \
5111        '|tmpfilesdir=$(tmpfilesdir)|' \
5112        '|sysusersdir=$(sysusersdir)|' \
5113        '|sysctldir=$(sysctldir)|' \
5114        '|systemgeneratordir=$(systemgeneratordir)|' \
5115        '|usergeneratordir=$(usergeneratordir)|' \
5116        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
5117        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
5118        '|PACKAGE_URL=$(PACKAGE_URL)|' \
5119        '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
5120        '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
5121        '|prefix=$(prefix)|' \
5122        '|exec_prefix=$(exec_prefix)|' \
5123        '|libdir=$(libdir)|' \
5124        '|includedir=$(includedir)|' \
5125        '|VERSION=$(VERSION)|' \
5126        '|rootprefix=$(rootprefix)|' \
5127        '|udevlibexecdir=$(udevlibexecdir)|' \
5128        '|SUSHELL=$(SUSHELL)|' \
5129        '|DEBUGTTY=$(DEBUGTTY)|' \
5130        '|KILL=$(KILL)|' \
5131        '|KMOD=$(KMOD)|' \
5132        '|MKDIR_P=$(MKDIR_P)|' \
5133        '|QUOTAON=$(QUOTAON)|' \
5134        '|QUOTACHECK=$(QUOTACHECK)|' \
5135        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
5136        '|VARLOGDIR=$(varlogdir)|' \
5137        '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
5138        '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
5139        '|PYTHON=$(PYTHON)|' \
5140        '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
5141        '|NTP_SERVERS=$(NTP_SERVERS)|' \
5142        '|DNS_SERVERS=$(DNS_SERVERS)|' \
5143        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
5144        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
5145        '|TTY_GID=$(TTY_GID)|' \
5146        '|systemsleepdir=$(systemsleepdir)|' \
5147        '|systemshutdowndir=$(systemshutdowndir)|' \
5148        '|binfmtdir=$(binfmtdir)|' \
5149        '|modulesloaddir=$(modulesloaddir)|'
5150
5151 SED_PROCESS = \
5152         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
5153         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
5154                 < $< > $@
5155
5156 units/%: units/%.in
5157         $(SED_PROCESS)
5158
5159 man/%: man/%.in
5160         $(SED_PROCESS)
5161
5162 sysctl.d/%: sysctl.d/%.in
5163         $(SED_PROCESS)
5164
5165 %.pc: %.pc.in
5166         $(SED_PROCESS)
5167
5168 src/core/macros.%: src/core/macros.%.in
5169         $(SED_PROCESS)
5170
5171 src/%.policy.in: src/%.policy.in.in
5172         $(SED_PROCESS)
5173
5174 %.rules: %.rules.in
5175         $(SED_PROCESS)
5176
5177 %.conf: %.conf.in
5178         $(SED_PROCESS)
5179
5180 %.sh: %.sh.in
5181         $(SED_PROCESS)
5182         $(AM_V_GEN)chmod +x $@
5183
5184 src/%.c: src/%.gperf
5185         $(AM_V_at)$(MKDIR_P) $(dir $@)
5186         $(AM_V_GPERF)$(GPERF) < $< > $@
5187
5188 src/%: src/%.m4
5189         $(AM_V_at)$(MKDIR_P) $(dir $@)
5190         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
5191
5192 units/%: units/%.m4
5193         $(AM_V_at)$(MKDIR_P) $(dir $@)
5194         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
5195
5196 units/user/%: units/%.m4
5197         $(AM_V_at)$(MKDIR_P) $(dir $@)
5198         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
5199
5200 if ENABLE_POLKIT
5201 dist_polkitpolicy_DATA = \
5202         $(polkitpolicy_files) \
5203         $(polkitpolicy_in_in_files:.policy.in.in=.policy)
5204 endif
5205
5206 EXTRA_DIST += \
5207         $(polkitpolicy_in_files) \
5208         $(polkitpolicy_in_in_files)
5209
5210 CLEANFILES += \
5211         $(nodist_systemunit_DATA) \
5212         $(nodist_userunit_DATA) \
5213         $(pkgconfigdata_DATA) \
5214         $(pkgconfiglib_DATA) \
5215         $(nodist_polkitpolicy_DATA)
5216
5217 # ------------------------------------------------------------------------------
5218 if ENABLE_MANPAGES
5219 man/custom-entities.ent: configure.ac
5220         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
5221         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
5222          printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
5223          > $@ # '
5224
5225 DISTCLEANFILES += \
5226         man/custom-entities.ent
5227
5228 XSLTPROC_FLAGS = \
5229         --nonet \
5230         --xinclude \
5231         --stringparam man.output.quietly 1 \
5232         --stringparam funcsynopsis.style ansi \
5233         --stringparam man.authors.section.enabled 0 \
5234         --stringparam man.copyright.section.enabled 0 \
5235         --stringparam systemd.version $(VERSION) \
5236         --path '$(builddir)/man:$(srcdir)/man'
5237
5238 XSLTPROC_PROCESS_MAN = \
5239         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
5240
5241 XSLTPROC_PROCESS_HTML = \
5242         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
5243
5244 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
5245         $(XSLTPROC_PROCESS_MAN)
5246
5247 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
5248         $(XSLTPROC_PROCESS_MAN)
5249
5250 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
5251         $(XSLTPROC_PROCESS_MAN)
5252
5253 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
5254         $(XSLTPROC_PROCESS_MAN)
5255
5256 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
5257         $(XSLTPROC_PROCESS_MAN)
5258
5259 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
5260         $(XSLTPROC_PROCESS_HTML)
5261
5262 define html-alias
5263         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
5264 endef
5265
5266 endif
5267
5268 EXTRA_DIST += \
5269         man/custom-html.xsl \
5270         man/custom-man.xsl
5271
5272 # ------------------------------------------------------------------------------
5273 if HAVE_SYSV_COMPAT
5274 sysvinit_DATA = \
5275         docs/sysvinit/README
5276
5277 varlog_DATA = \
5278         docs/var-log/README
5279
5280 docs/sysvinit/README: docs/sysvinit/README.in
5281         $(SED_PROCESS)
5282
5283 docs/var-log/README: docs/var-log/README.in
5284         $(SED_PROCESS)
5285
5286 CLEANFILES += \
5287         docs/sysvinit/README \
5288         docs/var-log/README
5289 endif
5290
5291 EXTRA_DIST += \
5292         docs/sysvinit/README.in \
5293         docs/var-log/README.in
5294
5295 SOCKETS_TARGET_WANTS += \
5296         systemd-initctl.socket \
5297         systemd-shutdownd.socket
5298
5299 if HAVE_SYSV_COMPAT
5300 RUNLEVEL1_TARGET_WANTS += \
5301         systemd-update-utmp-runlevel.service
5302 RUNLEVEL2_TARGET_WANTS += \
5303         systemd-update-utmp-runlevel.service
5304 RUNLEVEL3_TARGET_WANTS += \
5305         systemd-update-utmp-runlevel.service
5306 RUNLEVEL4_TARGET_WANTS += \
5307         systemd-update-utmp-runlevel.service
5308 RUNLEVEL5_TARGET_WANTS += \
5309         systemd-update-utmp-runlevel.service
5310 endif
5311
5312 SYSINIT_TARGET_WANTS += \
5313         systemd-update-utmp.service \
5314         systemd-update-done.service \
5315         ldconfig.service
5316
5317 LOCAL_FS_TARGET_WANTS += \
5318         systemd-remount-fs.service \
5319         tmp.mount
5320
5321 MULTI_USER_TARGET_WANTS += \
5322         getty.target \
5323         systemd-ask-password-wall.path
5324
5325 SYSINIT_TARGET_WANTS += \
5326         dev-hugepages.mount \
5327         dev-mqueue.mount \
5328         sys-kernel-config.mount \
5329         sys-kernel-debug.mount \
5330         sys-fs-fuse-connections.mount \
5331         systemd-sysctl.service \
5332         systemd-ask-password-console.path
5333
5334 if HAVE_SYSV_COMPAT
5335 SYSTEM_UNIT_ALIASES += \
5336         poweroff.target runlevel0.target \
5337         rescue.target runlevel1.target \
5338         multi-user.target runlevel2.target \
5339         multi-user.target runlevel3.target \
5340         multi-user.target runlevel4.target \
5341         graphical.target runlevel5.target \
5342         reboot.target runlevel6.target
5343 endif
5344
5345 SYSTEM_UNIT_ALIASES += \
5346         graphical.target default.target \
5347         reboot.target ctrl-alt-del.target \
5348         getty@.service autovt@.service
5349
5350 USER_UNIT_ALIASES += \
5351         $(systemunitdir)/shutdown.target shutdown.target \
5352         $(systemunitdir)/sockets.target sockets.target \
5353         $(systemunitdir)/busnames.target busnames.target \
5354         $(systemunitdir)/timers.target timers.target \
5355         $(systemunitdir)/paths.target paths.target \
5356         $(systemunitdir)/bluetooth.target bluetooth.target \
5357         $(systemunitdir)/printer.target printer.target \
5358         $(systemunitdir)/sound.target sound.target \
5359         $(systemunitdir)/smartcard.target smartcard.target
5360
5361 GENERAL_ALIASES += \
5362         $(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
5363         $(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \
5364         $(pkgsysconfdir)/user $(sysconfdir)/xdg/systemd/user \
5365         $(dbussystemservicedir)/org.freedesktop.systemd1.service $(dbussessionservicedir)/org.freedesktop.systemd1.service
5366
5367 if HAVE_SYSV_COMPAT
5368 INSTALL_DIRS += \
5369         $(systemunitdir)/runlevel1.target.wants \
5370         $(systemunitdir)/runlevel2.target.wants \
5371         $(systemunitdir)/runlevel3.target.wants \
5372         $(systemunitdir)/runlevel4.target.wants \
5373         $(systemunitdir)/runlevel5.target.wants
5374 endif
5375
5376 INSTALL_DIRS += \
5377         $(prefix)/lib/modules-load.d \
5378         $(sysconfdir)/modules-load.d \
5379         $(prefix)/lib/systemd/network \
5380         $(sysconfdir)/systemd/network \
5381         $(prefix)/lib/sysctl.d \
5382         $(sysconfdir)/sysctl.d \
5383         $(prefix)/lib/kernel/install.d \
5384         $(sysconfdir)/kernel/install.d \
5385         $(systemshutdowndir) \
5386         $(systemsleepdir) \
5387         $(systemgeneratordir) \
5388         $(usergeneratordir) \
5389         \
5390         $(userunitdir) \
5391         $(pkgsysconfdir)/system \
5392         $(pkgsysconfdir)/system/multi-user.target.wants \
5393         $(pkgsysconfdir)/system/getty.target.wants \
5394         $(pkgsysconfdir)/user \
5395         $(dbussessionservicedir) \
5396         $(sysconfdir)/xdg/systemd
5397
5398 install-exec-hook: $(INSTALL_EXEC_HOOKS)
5399
5400 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
5401
5402 install-data-hook: $(INSTALL_DATA_HOOKS)
5403
5404 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
5405
5406 clean-local: $(CLEAN_LOCAL_HOOKS)
5407         rm -rf $(abs_srcdir)/install-tree
5408         rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
5409               $(abs_srcdir)/hwdb/iab.txt
5410
5411 DISTCHECK_CONFIGURE_FLAGS = \
5412         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
5413         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
5414         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
5415         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
5416         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
5417         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
5418         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
5419         --with-rootprefix=$$dc_install_base \
5420         --disable-split-usr \
5421         --enable-kdbus \
5422         --enable-compat-libs
5423
5424 if HAVE_SYSV_COMPAT
5425 DISTCHECK_CONFIGURE_FLAGS += \
5426         --with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
5427         --with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
5428 else
5429 DISTCHECK_CONFIGURE_FLAGS += \
5430         --with-sysvinit-path= \
5431         --with-sysvrcnd-path=
5432 endif
5433
5434 if HAVE_PYTHON
5435 DISTCHECK_CONFIGURE_FLAGS += \
5436         --with-python
5437 endif
5438
5439 if ENABLE_GTK_DOC
5440 DISTCHECK_CONFIGURE_FLAGS += \
5441         --enable-gtk-doc
5442 endif
5443
5444 #
5445 # Require python when making dist
5446 #
5447 .PHONY: dist-check-python
5448 dist-check-python:
5449 if !HAVE_PYTHON
5450         @echo "*** python and python-lxml module must be installed and enabled in order to make dist"
5451         @false
5452 endif
5453
5454 dist-check-compat-libs:
5455 if !ENABLE_COMPAT_LIBS
5456         @echo "*** compat-libs must be enabled in order to make dist"
5457         @false
5458 endif
5459
5460 dist: dist-check-python dist-check-compat-libs
5461
5462 # check "broken" platforms limited toolchains for link breakage before we release
5463 .PHONY: linkcheck
5464 linkcheck:
5465         $(MAKE) CFLAGS='-fno-lto' LDFLAGS='-Wl,-fuse-ld=gold -Wl,--as-needed -Wl,--no-gc-sections' distcheck
5466
5467 .PHONY: hwdb-update
5468 hwdb-update:
5469         ( cd $(top_srcdir)/hwdb && \
5470         wget -N http://www.linux-usb.org/usb.ids \
5471                 http://pci-ids.ucw.cz/v2.2/pci.ids \
5472                 http://standards.ieee.org/develop/regauth/oui/oui.txt \
5473                 http://standards.ieee.org/develop/regauth/iab/iab.txt && \
5474         ./ids-update.pl )
5475
5476 .PHONY: kdbus-update
5477 kdbus-update:
5478         ( cd $(top_srcdir)/src/libsystemd/sd-bus/ && \
5479         wget -N https://d-bus.googlecode.com/git/kdbus.h )
5480
5481 .PHONY: git-tag
5482 git-tag:
5483         git tag -s "v$(VERSION)" -m "systemd $(VERSION)"
5484
5485 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
5486 .PHONY: upload
5487 upload: all check dist
5488         scp systemd-$(VERSION).tar.xz $(www_target)
5489
5490 .PHONY: doc-sync
5491 doc-sync: all destdir-sphinx
5492         gtkdoc-rebase --html-dir=docs/libudev/html --online
5493         rsync -rlv --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
5494         gtkdoc-rebase --html-dir=docs/gudev/html --online
5495         rsync -rlv --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
5496         rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
5497         rsync -rlv --delete --omit-dir-times docs/html/python-systemd/ $(www_target)/python-systemd/
5498
5499 .PHONY: tango
5500 tango: upload
5501         cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
5502         scp man/*.html tango:public/systemd-man/
5503
5504 .PHONY: install-tree
5505 install-tree: all
5506         rm -rf $(abs_srcdir)/install-tree
5507         $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
5508         tree $(abs_srcdir)/install-tree
5509
5510 # Let's run all tests of the test suite, but under valgrind. Let's
5511 # exclude the one perl script we have in there
5512 .PHONY: valgrind-tests
5513 valgrind-tests: $(TESTS)
5514         $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
5515                 if file $$f | grep -q shell; then \
5516                 echo -e "$${x}Skipping non-binary $$f"; else \
5517                 echo -e "$${x}Running $$f"; \
5518                 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
5519                 x="\n\n"; \
5520         done
5521
5522 exported-%: %
5523         $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
5524
5525 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
5526         $(AM_V_GEN)cat $^ > $@
5527
5528 .PHONY: check-api-docs
5529 check-api-docs: exported man
5530         $(AM_V_GEN)for symbol in `cat exported` ; do \
5531                 if test -f $(builddir)/man/$$symbol.html ; then \
5532                         echo "  Symbol $$symbol() is documented." ; \
5533                 else \
5534                         echo "‣ Symbol $$symbol() lacks documentation." ; \
5535                 fi ; \
5536         done
5537
5538 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
5539 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
5540
5541 undefined defined: $(ALL_OBJECTS)
5542         $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
5543                 $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
5544         done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
5545
5546 CLEANFILES += \
5547         defined \
5548         undefined
5549
5550 .PHONY: check-api-unused
5551 check-api-unused: defined undefined exported
5552         ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
5553
5554 .PHONY: check-includes
5555 check-includes: $(top_srcdir)/tools/check-includes.pl
5556         $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
5557                 | xargs $(top_srcdir)/tools/check-includes.pl
5558
5559 EXTRA_DIST += \
5560         $(top_srcdir)/tools/check-includes.pl
5561
5562 # Stupid test that everything purported to be exported really is
5563 define generate-sym-test
5564         $(AM_V_at)$(MKDIR_P) $(dir $@)
5565         $(AM_V_at)printf '#include <stdio.h>\n' > $@
5566         $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
5567         $(AM_V_at)printf 'void* functions[] = {\n' >> $@
5568         $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
5569         $(AM_V_at)printf '};\nint main(void) {\n' >> $@
5570         $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
5571         $(AM_V_at)printf 'return 0; }\n' >> $@
5572 endef
5573
5574 test-libsystemd-sym.c: \
5575                 $(top_builddir)/src/libsystemd/libsystemd.sym \
5576                 src/systemd/sd-journal.h \
5577                 src/systemd/sd-daemon.h \
5578                 src/systemd/sd-login.h \
5579                 src/systemd/sd-bus.h \
5580                 src/systemd/sd-utf8.h \
5581                 src/systemd/sd-resolve.h
5582         $(generate-sym-test)
5583
5584 test-libudev-sym.c: \
5585                 src/libudev/libudev.sym \
5586                 src/udev/udev.h
5587         $(generate-sym-test)
5588
5589 test_libsystemd_sym_SOURCES = \
5590         test-libsystemd-sym.c
5591 test_libsystemd_sym_LDADD = \
5592         libsystemd.la
5593
5594 test_libudev_sym_SOURCES = \
5595         test-libudev-sym.c
5596 test_libudev_sym_CFLAGS = \
5597         $(AM_CFLAGS) \
5598         -Wno-deprecated-declarations
5599 test_libudev_sym_LDADD = \
5600         libudev.la
5601
5602 BUILT_SOURCES += \
5603         $(test_libsystemd_sym_SOURCES) \
5604         $(test_libudev_sym_SOURCES)
5605
5606 tests += \
5607         test-libsystemd-sym \
5608         test-libudev-sym
5609
5610 .PHONY: cppcheck
5611 cppcheck:
5612         cppcheck --enable=all -q $(top_srcdir)
5613
5614 # Used to extract compile flags for YCM.
5615 print-%:
5616         @echo $($*)
5617
5618 git-contrib:
5619         @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u