chiark / gitweb /
7c20e338459b0070deaac51299dadd904e115690
[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 networkdir=$(rootprefix)/lib/systemd/network
94 pkgincludedir=$(includedir)/systemd
95 systemgeneratordir=$(rootlibexecdir)/system-generators
96 usergeneratordir=$(prefix)/lib/systemd/user-generators
97 systemshutdowndir=$(rootlibexecdir)/system-shutdown
98 systemsleepdir=$(rootlibexecdir)/system-sleep
99 systemunitdir=$(rootprefix)/lib/systemd/system
100 systempresetdir=$(rootprefix)/lib/systemd/system-preset
101 udevlibexecdir=$(rootprefix)/lib/udev
102 udevhomedir=$(udevlibexecdir)
103 udevrulesdir=$(udevlibexecdir)/rules.d
104 udevhwdbdir=$(udevlibexecdir)/hwdb.d
105 catalogdir=$(prefix)/lib/systemd/catalog
106 kernelinstalldir = $(prefix)/lib/kernel/install.d
107 ntpunitsdir=$(prefix)/lib/systemd/ntp-units.d
108
109 # And these are the special ones for /
110 rootprefix=@rootprefix@
111 rootbindir=$(rootprefix)/bin
112 rootlibexecdir=$(rootprefix)/lib/systemd
113
114 CLEANFILES = $(BUILT_SOURCES)
115 DISTCLEANFILES =
116 EXTRA_DIST =
117 BUILT_SOURCES =
118 INSTALL_EXEC_HOOKS =
119 UNINSTALL_EXEC_HOOKS =
120 INSTALL_DATA_HOOKS =
121 UNINSTALL_DATA_HOOKS =
122 DISTCLEAN_LOCAL_HOOKS =
123 CLEAN_LOCAL_HOOKS =
124 pkginclude_HEADERS =
125 noinst_LTLIBRARIES =
126 lib_LTLIBRARIES =
127 include_HEADERS =
128 noinst_DATA =
129 pkgconfiglib_DATA =
130 polkitpolicy_in_in_files =
131 polkitpolicy_in_files =
132 polkitpolicy_files =
133 dist_udevrules_DATA =
134 nodist_udevrules_DATA =
135 nodist_pkgsysconf_DATA =
136 dist_pkgsysconf_DATA =
137 dist_pkgdata_DATA =
138 dist_dbuspolicy_DATA =
139 dist_dbussystemservice_DATA =
140 check_PROGRAMS =
141 check_DATA =
142 tests=
143 manual_tests =
144 if ENABLE_TESTS
145 noinst_PROGRAMS = $(manual_tests) $(tests)
146 TESTS = $(tests)
147 else
148 noinst_PROGRAMS =
149 TESTS =
150 endif
151 udevlibexec_PROGRAMS =
152
153 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
154         $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
155         $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
156
157 AM_CPPFLAGS = \
158         -include $(top_builddir)/config.h \
159         -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
160         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
161         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
162         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
163         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
164         -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
165         -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
166         -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
167         -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
168         -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
169         -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
170         -DSYSTEMD_SLEEP_BINARY_PATH=\"$(rootlibexecdir)/systemd-sleep\" \
171         -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
172         -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(rootbindir)/systemd-tty-ask-password-agent\" \
173         -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
174         -DROOTPREFIX=\"$(rootprefix)\" \
175         -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\" \
176         -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\" \
177         -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
178         -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
179         -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
180         -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
181         -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
182         -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
183         -DX_SERVER=\"$(bindir)/X\" \
184         -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
185         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
186         -DQUOTACHECK=\"$(QUOTACHECK)\" \
187         -DKEXEC=\"$(KEXEC)\" \
188         -I $(top_srcdir)/src \
189         -I $(top_builddir)/src/shared \
190         -I $(top_srcdir)/src/shared \
191         -I $(top_srcdir)/src/network \
192         -I $(top_srcdir)/src/login \
193         -I $(top_srcdir)/src/journal \
194         -I $(top_srcdir)/src/timedate \
195         -I $(top_srcdir)/src/timesync \
196         -I $(top_srcdir)/src/resolve \
197         -I $(top_srcdir)/src/systemd \
198         -I $(top_builddir)/src/core \
199         -I $(top_srcdir)/src/core \
200         -I $(top_srcdir)/src/libudev \
201         -I $(top_srcdir)/src/udev \
202         -I $(top_srcdir)/src/udev/net \
203         -I $(top_builddir)/src/udev \
204         -I $(top_srcdir)/src/libsystemd/sd-bus \
205         -I $(top_srcdir)/src/libsystemd/sd-event \
206         -I $(top_srcdir)/src/libsystemd/sd-rtnl \
207         -I $(top_srcdir)/src/libsystemd-network \
208         $(OUR_CPPFLAGS)
209
210 AM_CFLAGS = $(OUR_CFLAGS)
211 AM_LDFLAGS = $(OUR_LDFLAGS)
212
213 # ------------------------------------------------------------------------------
214 define move-to-rootlibdir
215         if test "$(libdir)" != "$(rootlibdir)"; then \
216                 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
217                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
218                 rm -f $(DESTDIR)$(libdir)/$$libname && \
219                 $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
220                 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
221         fi
222 endef
223
224 INSTALL_DIRS =
225
226 RUNLEVEL1_TARGET_WANTS =
227 RUNLEVEL2_TARGET_WANTS =
228 RUNLEVEL3_TARGET_WANTS =
229 RUNLEVEL4_TARGET_WANTS =
230 RUNLEVEL5_TARGET_WANTS =
231 SHUTDOWN_TARGET_WANTS =
232 LOCAL_FS_TARGET_WANTS =
233 MULTI_USER_TARGET_WANTS =
234 SYSINIT_TARGET_WANTS =
235 SOCKETS_TARGET_WANTS =
236 BUSNAMES_TARGET_WANTS =
237 TIMERS_TARGET_WANTS =
238 USER_SOCKETS_TARGET_WANTS =
239 USER_BUSNAMES_TARGET_WANTS =
240
241 SYSTEM_UNIT_ALIASES =
242 USER_UNIT_ALIASES =
243 GENERAL_ALIASES =
244
245 install-target-wants-hook:
246         what="$(RUNLEVEL1_TARGET_WANTS)" && wants=runlevel1.target && dir=$(systemunitdir) && $(add-wants)
247         what="$(RUNLEVEL2_TARGET_WANTS)" && wants=runlevel2.target && dir=$(systemunitdir) && $(add-wants)
248         what="$(RUNLEVEL3_TARGET_WANTS)" && wants=runlevel3.target && dir=$(systemunitdir) && $(add-wants)
249         what="$(RUNLEVEL4_TARGET_WANTS)" && wants=runlevel4.target && dir=$(systemunitdir) && $(add-wants)
250         what="$(RUNLEVEL5_TARGET_WANTS)" && wants=runlevel5.target && dir=$(systemunitdir) && $(add-wants)
251         what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && dir=$(systemunitdir) && $(add-wants)
252         what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && dir=$(systemunitdir) && $(add-wants)
253         what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
254         what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && dir=$(systemunitdir) && $(add-wants)
255         what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(systemunitdir) && $(add-wants)
256         what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
257         what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && dir=$(systemunitdir) && $(add-wants)
258         what="$(SLICES_TARGET_WANTS)" && wants=slices.target && dir=$(systemunitdir) && $(add-wants)
259         what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
260         what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
261
262 define add-wants
263         [ -z "$$what" ] || ( \
264           dir=$(DESTDIR)$$dir/$$wants.wants && \
265           $(MKDIR_P) -m 0755 $$dir && \
266           cd $$dir && \
267           rm -f $$what && \
268           for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
269 endef
270
271 install-directories-hook:
272         $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
273
274 install-aliases-hook:
275         set -- $(SYSTEM_UNIT_ALIASES) && \
276                 dir=$(systemunitdir) && $(install-aliases)
277         set -- $(USER_UNIT_ALIASES) && \
278                 dir=$(userunitdir) && $(install-relative-aliases)
279         set -- $(GENERAL_ALIASES) && \
280                 dir= && $(install-relative-aliases)
281
282 define install-aliases
283         while [ -n "$$1" ]; do \
284                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
285                 rm -f $(DESTDIR)$$dir/$$2 && \
286                 $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
287                 shift 2 || exit $$?; \
288         done
289 endef
290
291 define install-relative-aliases
292         while [ -n "$$1" ]; do \
293                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
294                 rm -f $(DESTDIR)$$dir/$$2 && \
295                 $(LN_S) --relative $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
296                 shift 2 || exit $$?; \
297         done
298 endef
299
300 install-touch-usr-hook:
301         touch -c $(DESTDIR)/$(prefix)
302
303 INSTALL_EXEC_HOOKS += \
304         install-target-wants-hook \
305         install-directories-hook \
306         install-aliases-hook \
307         install-touch-usr-hook
308
309 # ------------------------------------------------------------------------------
310 AM_V_M4 = $(AM_V_M4_$(V))
311 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
312 AM_V_M4_0 = @echo "  M4      " $@;
313
314 AM_V_XSLT = $(AM_V_XSLT_$(V))
315 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
316 AM_V_XSLT_0 = @echo "  XSLT    " $@;
317
318 AM_V_GPERF = $(AM_V_GPERF_$(V))
319 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
320 AM_V_GPERF_0 = @echo "  GPERF   " $@;
321
322 AM_V_LN = $(AM_V_LN_$(V))
323 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
324 AM_V_LN_0 = @echo "  LN      " $@;
325
326 AM_V_RM = $(AM_V_RM_$(V))
327 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
328 AM_V_RM_0 = @echo "  RM      " $@;
329
330 # ------------------------------------------------------------------------------
331 rootbin_PROGRAMS = \
332         systemctl \
333         systemd-notify \
334         systemd-ask-password \
335         systemd-tty-ask-password-agent \
336         systemd-machine-id-setup
337
338 bin_PROGRAMS = \
339         systemd-cgls \
340         systemd-cgtop \
341         systemd-nspawn \
342         systemd-detect-virt \
343         systemd-delta \
344         systemd-analyze \
345         systemd-run
346
347 dist_bin_SCRIPTS = \
348         src/kernel-install/kernel-install
349
350 dist_kernelinstall_SCRIPTS = \
351         src/kernel-install/50-depmod.install \
352         src/kernel-install/90-loaderentry.install
353
354 rootlibexec_PROGRAMS = \
355         systemd \
356         systemd-cgroups-agent \
357         systemd-initctl \
358         systemd-update-utmp \
359         systemd-shutdownd \
360         systemd-shutdown \
361         systemd-remount-fs \
362         systemd-reply-password \
363         systemd-fsck \
364         systemd-ac-power \
365         systemd-sysctl \
366         systemd-sleep \
367         systemd-bus-proxyd \
368         systemd-socket-proxyd \
369         systemd-update-done
370
371 systemgenerator_PROGRAMS = \
372         systemd-getty-generator \
373         systemd-fstab-generator \
374         systemd-system-update-generator
375
376 dist_bashcompletion_DATA = \
377         shell-completion/bash/busctl \
378         shell-completion/bash/journalctl \
379         shell-completion/bash/systemctl \
380         shell-completion/bash/systemd-analyze \
381         shell-completion/bash/systemd-cat \
382         shell-completion/bash/systemd-cgls \
383         shell-completion/bash/systemd-cgtop \
384         shell-completion/bash/systemd-delta \
385         shell-completion/bash/systemd-detect-virt \
386         shell-completion/bash/systemd-nspawn \
387         shell-completion/bash/systemd-run \
388         shell-completion/bash/udevadm \
389         shell-completion/bash/kernel-install
390
391 dist_zshcompletion_DATA = \
392         shell-completion/zsh/_systemctl \
393         shell-completion/zsh/_journalctl \
394         shell-completion/zsh/_udevadm \
395         shell-completion/zsh/_kernel-install \
396         shell-completion/zsh/_systemd-nspawn \
397         shell-completion/zsh/_systemd-analyze \
398         shell-completion/zsh/_systemd-run \
399         shell-completion/zsh/_sd_hosts_or_user_at_host \
400         shell-completion/zsh/_systemd-delta \
401         shell-completion/zsh/_systemd
402
403 dist_sysctl_DATA = \
404         sysctl.d/50-default.conf
405
406 dist_systemunit_DATA = \
407         units/graphical.target \
408         units/multi-user.target \
409         units/emergency.service \
410         units/emergency.target \
411         units/sysinit.target \
412         units/basic.target \
413         units/getty.target \
414         units/halt.target \
415         units/kexec.target \
416         units/local-fs.target \
417         units/local-fs-pre.target \
418         units/initrd.target \
419         units/initrd-fs.target \
420         units/initrd-root-fs.target \
421         units/remote-fs.target \
422         units/remote-fs-pre.target \
423         units/network.target \
424         units/network-pre.target \
425         units/network-online.target \
426         units/nss-lookup.target \
427         units/nss-user-lookup.target \
428         units/hibernate.target \
429         units/hybrid-sleep.target \
430         units/poweroff.target \
431         units/reboot.target \
432         units/rescue.target \
433         units/rpcbind.target \
434         units/time-sync.target \
435         units/shutdown.target \
436         units/final.target \
437         units/umount.target \
438         units/sigpwr.target \
439         units/sleep.target \
440         units/sockets.target \
441         units/busnames.target \
442         units/timers.target \
443         units/paths.target \
444         units/suspend.target \
445         units/swap.target \
446         units/slices.target \
447         units/system.slice \
448         units/x-.slice \
449         units/systemd-initctl.socket \
450         units/systemd-shutdownd.socket \
451         units/syslog.socket \
452         units/dev-hugepages.mount \
453         units/dev-mqueue.mount \
454         units/sys-kernel-config.mount \
455         units/sys-kernel-debug.mount \
456         units/sys-fs-fuse-connections.mount \
457         units/tmp.mount \
458         units/printer.target \
459         units/sound.target \
460         units/bluetooth.target \
461         units/smartcard.target \
462         units/systemd-ask-password-wall.path \
463         units/systemd-ask-password-console.path \
464         units/systemd-udevd-control.socket \
465         units/systemd-udevd-kernel.socket \
466         units/system-update.target \
467         units/initrd-switch-root.target \
468         units/ldconfig.service
469
470 nodist_systemunit_DATA = \
471         units/getty@.service \
472         units/serial-getty@.service \
473         units/console-shell.service \
474         units/console-getty.service \
475         units/container-getty@.service \
476         units/systemd-initctl.service \
477         units/systemd-shutdownd.service \
478         units/systemd-remount-fs.service \
479         units/systemd-update-utmp.service \
480         units/systemd-update-utmp-runlevel.service \
481         units/systemd-ask-password-wall.service \
482         units/systemd-ask-password-console.service \
483         units/systemd-sysctl.service \
484         units/emergency.service \
485         units/rescue.service \
486         units/user@.service \
487         units/systemd-hibernate.service \
488         units/systemd-hybrid-sleep.service \
489         units/systemd-suspend.service \
490         units/systemd-halt.service \
491         units/systemd-poweroff.service \
492         units/systemd-reboot.service \
493         units/systemd-kexec.service \
494         units/systemd-fsck@.service \
495         units/systemd-fsck-root.service \
496         units/systemd-udevd.service \
497         units/systemd-udev-trigger.service \
498         units/systemd-udev-settle.service \
499         units/systemd-udev-hwdb-update.service \
500         units/debug-shell.service \
501         units/initrd-parse-etc.service \
502         units/initrd-cleanup.service \
503         units/initrd-udevadm-cleanup-db.service \
504         units/initrd-switch-root.service \
505         units/systemd-nspawn@.service \
506         units/systemd-update-done.service
507
508 dist_userunit_DATA = \
509         units/user/basic.target \
510         units/user/default.target \
511         units/user/exit.target
512
513 nodist_userunit_DATA = \
514         units/user/systemd-exit.service
515
516 dist_systempreset_DATA = \
517         system-preset/90-systemd.preset
518
519 EXTRA_DIST += \
520         units/getty@.service.m4 \
521         units/serial-getty@.service.m4 \
522         units/console-shell.service.m4.in \
523         units/console-getty.service.m4.in \
524         units/container-getty@.service.m4.in \
525         units/rescue.service.m4.in \
526         units/systemd-initctl.service.in \
527         units/systemd-shutdownd.service.in \
528         units/systemd-remount-fs.service.in \
529         units/systemd-update-utmp.service.in \
530         units/systemd-update-utmp-runlevel.service.in \
531         units/systemd-ask-password-wall.service.in \
532         units/systemd-ask-password-console.service.in \
533         units/systemd-sysctl.service.in \
534         units/emergency.service.in \
535         units/systemd-halt.service.in \
536         units/systemd-poweroff.service.in \
537         units/systemd-reboot.service.in \
538         units/systemd-kexec.service.in \
539         units/user/systemd-exit.service.in \
540         units/systemd-fsck@.service.in \
541         units/systemd-fsck-root.service.in \
542         units/user@.service.in \
543         units/debug-shell.service.in \
544         units/systemd-hibernate.service.in \
545         units/systemd-hybrid-sleep.service.in \
546         units/systemd-suspend.service.in \
547         units/quotaon.service.in \
548         units/initrd-parse-etc.service.in \
549         units/initrd-cleanup.service.in \
550         units/initrd-udevadm-cleanup-db.service.in \
551         units/initrd-switch-root.service.in \
552         units/systemd-nspawn@.service.in \
553         units/systemd-update-done.service.in
554
555 CLEANFILES += \
556         units/console-shell.service.m4 \
557         units/console-getty.service.m4 \
558         units/container-getty@.service.m4 \
559         units/rescue.service.m4 \
560         units/user@.service.m4
561
562 if HAVE_SYSV_COMPAT
563 nodist_systemunit_DATA += \
564         units/rc-local.service \
565         units/halt-local.service
566
567 systemgenerator_PROGRAMS += \
568         systemd-sysv-generator \
569         systemd-rc-local-generator
570 endif
571
572 EXTRA_DIST += \
573         units/rc-local.service.in \
574         units/halt-local.service.in
575
576 # automake is broken and can't handle files with a dash in front
577 # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14728#8
578 units-install-hook:
579         mv $(DESTDIR)$(systemunitdir)/x-.slice $(DESTDIR)/$(systemunitdir)/-.slice
580
581 units-uninstall-hook:
582         rm -f $(DESTDIR)/$(systemunitdir)/-.slice
583
584 INSTALL_DATA_HOOKS += units-install-hook
585 UNINSTALL_DATA_HOOKS += units-uninstall-hook
586
587 dist_doc_DATA = \
588         README \
589         NEWS \
590         LICENSE.LGPL2.1 \
591         LICENSE.GPL2 \
592         LICENSE.MIT \
593         DISTRO_PORTING \
594         src/libsystemd/sd-bus/PORTING-DBUS1 \
595         src/libsystemd/sd-bus/DIFFERENCES \
596         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
597
598 @INTLTOOL_POLICY_RULE@
599
600 # ------------------------------------------------------------------------------
601
602 MANPAGES =
603 MANPAGES_ALIAS =
604
605 include Makefile-man.am
606
607 .PHONY: man update-man-list
608 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
609
610 XML_FILES = \
611         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
612 HTML_FILES = \
613         ${XML_FILES:.xml=.html}
614 HTML_ALIAS = \
615         ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
616
617 if ENABLE_MANPAGES
618 man_MANS = \
619         $(MANPAGES) \
620         $(MANPAGES_ALIAS)
621
622 noinst_DATA += \
623         $(HTML_FILES) \
624         $(HTML_ALIAS)
625
626 CLEANFILES += \
627         $(man_MANS) \
628         $(HTML_FILES) \
629         $(HTML_ALIAS)
630
631 docs/html/man:
632         $(AM_V_at)$(MKDIR_P) $(dir $@)
633         $(AM_V_LN)$(LN_S) -f ../../man $@
634
635 noinst_DATA += \
636         docs/html/man
637
638 CLEANFILES += \
639         docs/html/man
640
641 if HAVE_PYTHON
642 man/index.html: man/systemd.index.html
643         $(AM_V_LN)$(LN_S) -f systemd.index.html $@
644
645 noinst_DATA += \
646         man/index.html
647
648 CLEANFILES += \
649         man/index.html
650
651 XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml $(top_builddir)/man/*.xml)
652 NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
653 SOURCE_XML_FILES = $(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))
654
655 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB)
656         $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
657         $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
658         @echo "Makefile-man.am has been regenerated"
659
660 man/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
661         $(AM_V_at)$(MKDIR_P) $(dir $@)
662         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
663
664 man/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py $(SOURCE_XML_FILES)
665         $(AM_V_at)$(MKDIR_P) $(dir $@)
666         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
667
668 EXTRA_DIST += \
669         man/systemd.index.xml \
670         man/index.html \
671         man/systemd.directives.xml
672
673 CLEANFILES += \
674         man/systemd.index.xml \
675         man/systemd.directives.xml
676
677 endif
678
679 endif
680
681 EXTRA_DIST += \
682         $(XML_FILES) \
683         $(HTML_FILES) \
684         $(HTML_ALIAS) \
685         $(man_MANS) \
686         tools/make-man-index.py \
687         tools/make-directive-index.py \
688         tools/make-man-rules.py \
689         tools/xml_helper.py
690
691 # ------------------------------------------------------------------------------
692 noinst_LTLIBRARIES += \
693         libsystemd-shared.la
694
695 libsystemd_shared_la_SOURCES = \
696         src/shared/linux/auto_dev-ioctl.h \
697         src/shared/linux/fanotify.h \
698         src/shared/ioprio.h \
699         src/shared/missing.h \
700         src/shared/initreq.h \
701         src/shared/securebits.h \
702         src/shared/special.h \
703         src/shared/list.h \
704         src/shared/macro.h \
705         src/shared/def.h \
706         src/shared/sparse-endian.h \
707         src/shared/refcnt.h \
708         src/shared/udev-util.h \
709         src/shared/bus-errors.h \
710         src/shared/device-nodes.c \
711         src/shared/device-nodes.h \
712         src/shared/util.c \
713         src/shared/util.h \
714         src/shared/virt.c \
715         src/shared/virt.h \
716         src/shared/architecture.c \
717         src/shared/architecture.h \
718         src/shared/efivars.c \
719         src/shared/efivars.h \
720         src/shared/path-util.c \
721         src/shared/path-util.h \
722         src/shared/time-util.c \
723         src/shared/time-util.h \
724         src/shared/hashmap.c \
725         src/shared/hashmap.h \
726         src/shared/siphash24.c \
727         src/shared/siphash24.h \
728         src/shared/set.c \
729         src/shared/set.h \
730         src/shared/fdset.c \
731         src/shared/fdset.h \
732         src/shared/prioq.c \
733         src/shared/prioq.h \
734         src/shared/sleep-config.c \
735         src/shared/sleep-config.h \
736         src/shared/strv.c \
737         src/shared/strv.h \
738         src/shared/env-util.c \
739         src/shared/env-util.h \
740         src/shared/strbuf.c \
741         src/shared/strbuf.h \
742         src/shared/strxcpyx.c \
743         src/shared/strxcpyx.h \
744         src/shared/conf-parser.c \
745         src/shared/conf-parser.h \
746         src/shared/log.c \
747         src/shared/log.h \
748         src/shared/ratelimit.h \
749         src/shared/ratelimit.c \
750         src/shared/exit-status.c \
751         src/shared/exit-status.h \
752         src/shared/utf8.c \
753         src/shared/utf8.h \
754         src/shared/gunicode.c \
755         src/shared/gunicode.h \
756         src/shared/pager.c \
757         src/shared/pager.h \
758         src/shared/socket-util.c \
759         src/shared/socket-util.h \
760         src/shared/conf-files.c \
761         src/shared/conf-files.h \
762         src/shared/cgroup-util.c \
763         src/shared/cgroup-util.h \
764         src/shared/cgroup-show.c \
765         src/shared/cgroup-show.h \
766         src/shared/unit-name.c \
767         src/shared/unit-name.h \
768         src/shared/utmp-wtmp.c \
769         src/shared/utmp-wtmp.h \
770         src/shared/watchdog.c \
771         src/shared/watchdog.h \
772         src/shared/spawn-ask-password-agent.c \
773         src/shared/spawn-ask-password-agent.h \
774         src/shared/replace-var.c \
775         src/shared/replace-var.h \
776         src/shared/spawn-polkit-agent.c \
777         src/shared/spawn-polkit-agent.h \
778         src/shared/clock-util.c \
779         src/shared/clock-util.h \
780         src/shared/time-dst.c \
781         src/shared/time-dst.h \
782         src/shared/calendarspec.c \
783         src/shared/calendarspec.h \
784         src/shared/fileio.c \
785         src/shared/fileio.h \
786         src/shared/output-mode.h \
787         src/shared/MurmurHash2.c \
788         src/shared/MurmurHash2.h \
789         src/shared/acpi-fpdt.h \
790         src/shared/acpi-fpdt.c \
791         src/shared/boot-timestamps.h \
792         src/shared/boot-timestamps.c \
793         src/shared/mkdir.c \
794         src/shared/mkdir.h \
795         src/shared/smack-util.c \
796         src/shared/smack-util.h \
797         src/shared/apparmor-util.c \
798         src/shared/apparmor-util.h \
799         src/shared/ima-util.c \
800         src/shared/ima-util.h \
801         src/shared/ptyfwd.c \
802         src/shared/ptyfwd.h \
803         src/shared/errno-list.c \
804         src/shared/errno-list.h \
805         src/shared/af-list.c \
806         src/shared/af-list.h \
807         src/shared/audit.c \
808         src/shared/audit.h \
809         src/shared/xml.c \
810         src/shared/xml.h \
811         src/shared/condition-util.c \
812         src/shared/condition-util.h \
813         src/shared/bus-label.c \
814         src/shared/bus-label.h \
815         src/shared/gpt.h \
816         src/shared/generator.h \
817         src/shared/generator.c \
818         src/shared/clean-ipc.h \
819         src/shared/clean-ipc.c \
820         src/shared/login-shared.c \
821         src/shared/login-shared.h \
822         src/shared/ring.c \
823         src/shared/ring.h \
824         src/shared/async.c \
825         src/shared/async.h \
826         src/shared/eventfd-util.c \
827         src/shared/eventfd-util.h \
828         src/shared/copy.c \
829         src/shared/copy.h
830
831 nodist_libsystemd_shared_la_SOURCES = \
832         src/shared/errno-from-name.h \
833         src/shared/errno-to-name.h \
834         src/shared/af-from-name.h \
835         src/shared/af-to-name.h
836
837 libsystemd_shared_la_CFLAGS = \
838         $(AM_CFLAGS) \
839         $(SECCOMP_CFLAGS)
840
841 # ------------------------------------------------------------------------------
842 noinst_LTLIBRARIES += \
843         libsystemd-units.la
844
845 libsystemd_units_la_SOURCES = \
846         src/shared/install.c \
847         src/shared/install.h \
848         src/shared/install-printf.c \
849         src/shared/install-printf.h \
850         src/shared/path-lookup.c \
851         src/shared/path-lookup.h \
852         src/shared/specifier.c \
853         src/shared/specifier.h
854
855 # ------------------------------------------------------------------------------
856 noinst_LTLIBRARIES += \
857         libsystemd-label.la
858
859 libsystemd_label_la_SOURCES = \
860         src/shared/socket-label.c \
861         src/shared/label.c \
862         src/shared/label.h \
863         src/shared/selinux-util.c \
864         src/shared/selinux-util.h \
865         src/shared/mkdir-label.c \
866         src/shared/ask-password-api.c \
867         src/shared/ask-password-api.h \
868         src/shared/fileio-label.c \
869         src/shared/fileio-label.h \
870         src/shared/dev-setup.c \
871         src/shared/dev-setup.h
872
873 libsystemd_label_la_CFLAGS = \
874         $(AM_CFLAGS) \
875         $(SELINUX_CFLAGS)
876
877 libsystemd_label_la_LIBADD = \
878         $(SELINUX_LIBS)
879
880 # ------------------------------------------------------------------------------
881
882 if HAVE_SECCOMP
883 noinst_LTLIBRARIES += \
884         libsystemd-seccomp.la
885
886 libsystemd_seccomp_la_SOURCES = \
887         src/shared/seccomp-util.h \
888         src/shared/seccomp-util.c
889
890 libsystemd_seccomp_la_CFLAGS = \
891         $(AM_CFLAGS) \
892         $(SECCOMP_CFLAGS)
893
894 libsystemd_seccomp_la_LIBADD = \
895         $(SECCOMP_LIBS)
896 endif
897
898 # ------------------------------------------------------------------------------
899 noinst_LTLIBRARIES += \
900         libsystemd-logs.la
901
902 libsystemd_logs_la_SOURCES = \
903         src/shared/logs-show.c \
904         src/shared/logs-show.h
905
906 # ------------------------------------------------------------------------------
907 noinst_LTLIBRARIES += \
908         libsystemd-capability.la
909
910 libsystemd_capability_la_SOURCES = \
911         src/shared/capability.c \
912         src/shared/capability.h
913
914 libsystemd_capability_la_CFLAGS = \
915         $(AM_CFLAGS) \
916         $(CAP_CFLAGS)
917
918 libsystemd_capability_la_LIBADD = \
919         $(CAP_LIBS)
920
921 # ------------------------------------------------------------------------------
922 if HAVE_ACL
923 noinst_LTLIBRARIES += \
924         libsystemd-acl.la
925
926 libsystemd_acl_la_SOURCES = \
927         src/shared/acl-util.c \
928         src/shared/acl-util.h
929
930 libsystemd_acl_la_CFLAGS = \
931         $(AM_CFLAGS) \
932         $(ACL_CFLAGS)
933
934 libsystemd_acl_la_LIBADD = \
935         $(ACL_LIBS)
936 endif
937
938 # ------------------------------------------------------------------------------
939 noinst_LTLIBRARIES += \
940         libsystemd-core.la
941
942 libsystemd_core_la_SOURCES = \
943         src/core/unit.c \
944         src/core/unit.h \
945         src/core/unit-printf.c \
946         src/core/unit-printf.h \
947         src/core/job.c \
948         src/core/job.h \
949         src/core/manager.c \
950         src/core/manager.h \
951         src/core/transaction.c \
952         src/core/transaction.h \
953         src/core/load-fragment.c \
954         src/core/load-fragment.h \
955         src/core/service.c \
956         src/core/service.h \
957         src/core/socket.c \
958         src/core/socket.h \
959         src/core/busname.c \
960         src/core/busname.h \
961         src/core/target.c \
962         src/core/target.h \
963         src/core/snapshot.c \
964         src/core/snapshot.h \
965         src/core/device.c \
966         src/core/device.h \
967         src/core/mount.c \
968         src/core/mount.h \
969         src/core/automount.c \
970         src/core/automount.h \
971         src/core/swap.c \
972         src/core/swap.h \
973         src/core/timer.c \
974         src/core/timer.h \
975         src/core/path.c \
976         src/core/path.h \
977         src/core/slice.c \
978         src/core/slice.h \
979         src/core/scope.c \
980         src/core/scope.h \
981         src/core/load-dropin.c \
982         src/core/load-dropin.h \
983         src/core/execute.c \
984         src/core/execute.h \
985         src/core/kill.c \
986         src/core/kill.h \
987         src/core/dbus.c \
988         src/core/dbus.h \
989         src/core/dbus-manager.c \
990         src/core/dbus-manager.h \
991         src/core/dbus-unit.c \
992         src/core/dbus-unit.h \
993         src/core/dbus-job.c \
994         src/core/dbus-job.h \
995         src/core/dbus-service.c \
996         src/core/dbus-service.h \
997         src/core/dbus-socket.c \
998         src/core/dbus-socket.h \
999         src/core/dbus-busname.c \
1000         src/core/dbus-busname.h \
1001         src/core/dbus-target.c \
1002         src/core/dbus-target.h \
1003         src/core/dbus-snapshot.c \
1004         src/core/dbus-snapshot.h \
1005         src/core/dbus-device.c \
1006         src/core/dbus-device.h \
1007         src/core/dbus-mount.c \
1008         src/core/dbus-mount.h \
1009         src/core/dbus-automount.c \
1010         src/core/dbus-automount.h \
1011         src/core/dbus-swap.c \
1012         src/core/dbus-swap.h \
1013         src/core/dbus-timer.c \
1014         src/core/dbus-timer.h \
1015         src/core/dbus-path.c \
1016         src/core/dbus-path.h \
1017         src/core/dbus-slice.c \
1018         src/core/dbus-slice.h \
1019         src/core/dbus-scope.c \
1020         src/core/dbus-scope.h \
1021         src/core/dbus-execute.c \
1022         src/core/dbus-execute.h \
1023         src/core/dbus-kill.c \
1024         src/core/dbus-kill.h \
1025         src/core/dbus-cgroup.c \
1026         src/core/dbus-cgroup.h \
1027         src/core/cgroup.c \
1028         src/core/cgroup.h \
1029         src/core/selinux-access.c \
1030         src/core/selinux-access.h \
1031         src/core/selinux-setup.c \
1032         src/core/selinux-setup.h \
1033         src/core/smack-setup.c \
1034         src/core/smack-setup.h \
1035         src/core/ima-setup.c \
1036         src/core/ima-setup.h \
1037         src/core/locale-setup.h \
1038         src/core/locale-setup.c \
1039         src/core/hostname-setup.c \
1040         src/core/hostname-setup.h \
1041         src/core/machine-id-setup.c \
1042         src/core/machine-id-setup.h \
1043         src/core/mount-setup.c \
1044         src/core/mount-setup.h \
1045         src/core/loopback-setup.h \
1046         src/core/loopback-setup.c \
1047         src/core/condition.c \
1048         src/core/condition.h \
1049         src/core/namespace.c \
1050         src/core/namespace.h \
1051         src/core/build.h \
1052         src/core/sysfs-show.h \
1053         src/core/switch-root.h \
1054         src/core/switch-root.c \
1055         src/core/killall.h \
1056         src/core/killall.c \
1057         src/core/audit-fd.c \
1058         src/core/audit-fd.h \
1059         src/core/show-status.c \
1060         src/core/show-status.h
1061
1062 if HAVE_KMOD
1063 libsystemd_core_la_SOURCES += \
1064         src/core/kmod-setup.c \
1065         src/core/kmod-setup.h
1066 endif
1067
1068 nodist_libsystemd_core_la_SOURCES = \
1069         src/core/load-fragment-gperf.c \
1070         src/core/load-fragment-gperf-nulstr.c
1071
1072 libsystemd_core_la_CFLAGS = \
1073         $(AM_CFLAGS) \
1074         $(PAM_CFLAGS) \
1075         $(AUDIT_CFLAGS) \
1076         $(CAP_CFLAGS) \
1077         $(KMOD_CFLAGS) \
1078         $(APPARMOR_CFLAGS) \
1079         $(SECCOMP_CFLAGS) \
1080         -pthread
1081
1082 libsystemd_core_la_LIBADD = \
1083         libsystemd-capability.la \
1084         libsystemd-units.la \
1085         libsystemd-label.la \
1086         libudev-internal.la \
1087         libsystemd-shared.la \
1088         libsystemd-internal.la \
1089         $(PAM_LIBS) \
1090         $(AUDIT_LIBS) \
1091         $(CAP_LIBS) \
1092         $(KMOD_LIBS) \
1093         $(APPARMOR_LIBS) \
1094         $(SECCOMP_LIBS)
1095
1096 if HAVE_SECCOMP
1097 libsystemd_core_la_LIBADD += \
1098         libsystemd-seccomp.la
1099 endif
1100
1101 src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
1102         $(AM_V_at)$(MKDIR_P) $(dir $@)
1103         $(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 ";" }' < $< > $@
1104
1105 EXTRA_DIST += \
1106         src/core/load-fragment-gperf.gperf.m4
1107
1108 CLEANFILES += \
1109         src/core/load-fragment-gperf.gperf \
1110         src/core/load-fragment-gperf.c \
1111         src/core/load-fragment-gperf-nulstr.c \
1112         src/shared/errno-list.txt \
1113         src/shared/errno-from-name.gperf \
1114         src/shared/af-list.txt \
1115         src/shared/af-from-name.gperf
1116
1117 BUILT_SOURCES += \
1118         src/shared/errno-from-name.h \
1119         src/shared/errno-to-name.h \
1120         src/shared/af-from-name.h \
1121         src/shared/af-to-name.h
1122
1123 src/shared/errno-list.txt:
1124         $(AM_V_at)$(MKDIR_P) $(dir $@)
1125         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - < /dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }'  > $@
1126
1127 src/shared/errno-from-name.gperf: src/shared/errno-list.txt
1128         $(AM_V_at)$(MKDIR_P) $(dir $@)
1129         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct errno_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
1130
1131 src/shared/errno-from-name.h: src/shared/errno-from-name.gperf
1132         $(AM_V_at)$(MKDIR_P) $(dir $@)
1133         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_errno -H hash_errno_name -p -C < $< > $@
1134
1135 src/shared/errno-to-name.h: src/shared/errno-list.txt
1136         $(AM_V_at)$(MKDIR_P) $(dir $@)
1137         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' < $< > $@
1138
1139 src/shared/af-list.txt:
1140         $(AM_V_at)$(MKDIR_P) $(dir $@)
1141         $(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; }'  > $@
1142
1143 src/shared/af-from-name.gperf: src/shared/af-list.txt
1144         $(AM_V_at)$(MKDIR_P) $(dir $@)
1145         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct af_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' < $< > $@
1146
1147 src/shared/af-from-name.h: src/shared/af-from-name.gperf
1148         $(AM_V_at)$(MKDIR_P) $(dir $@)
1149         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_af -H hash_af_name -p -C < $< > $@
1150
1151 src/shared/af-to-name.h: src/shared/af-list.txt
1152         $(AM_V_at)$(MKDIR_P) $(dir $@)
1153         $(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 "};"}' < $< > $@
1154
1155 # ------------------------------------------------------------------------------
1156 systemd_SOURCES = \
1157         src/core/main.c
1158
1159 systemd_CFLAGS = \
1160         $(AM_CFLAGS) \
1161         $(SECCOMP_CFLAGS)
1162
1163 systemd_LDADD = \
1164         libsystemd-core.la \
1165         $(RT_LIBS)
1166
1167 dist_pkgsysconf_DATA += \
1168         src/core/system.conf \
1169         src/core/user.conf
1170
1171 dist_dbuspolicy_DATA += \
1172         src/core/org.freedesktop.systemd1.conf
1173
1174 dist_dbussystemservice_DATA += \
1175         src/core/org.freedesktop.systemd1.service
1176
1177 polkitpolicy_in_in_files += \
1178         src/core/org.freedesktop.systemd1.policy.in.in
1179
1180 pkgconfigdata_DATA = \
1181         src/core/systemd.pc
1182
1183 nodist_rpmmacros_DATA = \
1184         src/core/macros.systemd
1185
1186 EXTRA_DIST += \
1187         src/core/systemd.pc.in \
1188         src/core/macros.systemd.in
1189
1190 CLEANFILES += \
1191         src/core/macros.systemd \
1192         src/core/org.freedesktop.systemd1.policy.in
1193
1194 # ------------------------------------------------------------------------------
1195 manual_tests += \
1196         test-engine \
1197         test-ns \
1198         test-loopback \
1199         test-hostname \
1200         test-daemon \
1201         test-cgroup \
1202         test-cgroup-mask \
1203         test-install \
1204         test-watchdog \
1205         test-log \
1206         test-ipcrm
1207
1208 if HAVE_KMOD
1209 manual_tests += \
1210         test-rtnl-manual
1211 endif
1212
1213 tests += \
1214         test-job-type \
1215         test-env-replace \
1216         test-strbuf \
1217         test-strv \
1218         test-path-util \
1219         test-strxcpyx \
1220         test-unit-name \
1221         test-unit-file \
1222         test-utf8 \
1223         test-ellipsize \
1224         test-util \
1225         test-ring \
1226         test-tmpfiles \
1227         test-namespace \
1228         test-date \
1229         test-sleep \
1230         test-replace-var \
1231         test-sched-prio \
1232         test-calendarspec \
1233         test-strip-tab-ansi \
1234         test-cgroup-util \
1235         test-prioq \
1236         test-fileio \
1237         test-time \
1238         test-hashmap \
1239         test-list \
1240         test-tables \
1241         test-device-nodes \
1242         test-xml \
1243         test-architecture \
1244         test-socket-util \
1245         test-fdset
1246
1247 EXTRA_DIST += \
1248         test/sched_idle_bad.service \
1249         test/sched_idle_ok.service \
1250         test/sched_rr_bad.service \
1251         test/sched_rr_ok.service \
1252         test/sched_rr_change.service \
1253         test/son.service \
1254         test/daughter.service \
1255         test/parent.slice
1256
1257 EXTRA_DIST += \
1258         src/test/test-helper.h
1259
1260 test_device_nodes_SOURCES = \
1261         src/test/test-device-nodes.c
1262
1263 test_device_nodes_LDADD = \
1264         libsystemd-shared.la
1265
1266 test_engine_SOURCES = \
1267         src/test/test-engine.c
1268
1269 test_engine_CFLAGS = \
1270         $(AM_CFLAGS) \
1271         $(SECCOMP_CFLAGS)
1272
1273 test_engine_LDADD = \
1274         libsystemd-core.la \
1275         $(RT_LIBS)
1276
1277 test_job_type_SOURCES = \
1278         src/test/test-job-type.c
1279
1280 test_job_type_CFLAGS = \
1281         $(AM_CFLAGS) \
1282         $(SECCOMP_CFLAGS)
1283
1284 test_job_type_LDADD = \
1285         libsystemd-core.la \
1286         $(RT_LIBS)
1287
1288 test_ns_SOURCES = \
1289         src/test/test-ns.c
1290
1291 test_ns_CFLAGS = \
1292         $(AM_CFLAGS) \
1293         $(SECCOMP_CFLAGS)
1294
1295 test_ns_LDADD = \
1296         libsystemd-core.la
1297
1298 test_loopback_SOURCES = \
1299         src/test/test-loopback.c
1300
1301 test_loopback_LDADD = \
1302         libsystemd-core.la
1303
1304 test_hostname_SOURCES = \
1305         src/test/test-hostname.c
1306
1307 test_hostname_LDADD = \
1308         libsystemd-core.la
1309
1310 if ENABLE_EFI
1311 manual_tests += \
1312         test-boot-timestamp
1313
1314 test_boot_timestamp_SOURCES = \
1315         src/test/test-boot-timestamps.c
1316
1317 test_boot_timestamp_LDADD = \
1318         libsystemd-shared.la
1319 endif
1320
1321 test_unit_name_SOURCES = \
1322         src/test/test-unit-name.c
1323
1324 test_unit_name_CFLAGS = \
1325         $(AM_CFLAGS) \
1326         $(SECCOMP_CFLAGS)
1327
1328 test_unit_name_LDADD = \
1329         libsystemd-core.la \
1330         $(RT_LIBS)
1331
1332 test_unit_file_SOURCES = \
1333         src/test/test-unit-file.c
1334
1335 test_unit_file_CFLAGS = \
1336         $(AM_CFLAGS) \
1337         $(SECCOMP_CFLAGS)
1338
1339 test_unit_file_LDADD = \
1340         libsystemd-core.la \
1341         $(RT_LIBS)
1342
1343 test_utf8_SOURCES = \
1344         src/test/test-utf8.c
1345
1346 test_utf8_LDADD = \
1347         libsystemd-shared.la
1348
1349 test_fdset_SOURCES = \
1350         src/test/test-fdset.c
1351
1352 test_fdset_LDADD = \
1353         libsystemd-core.la
1354
1355 test_util_SOURCES = \
1356         src/test/test-util.c
1357
1358 test_util_LDADD = \
1359         libsystemd-core.la
1360
1361 test_socket_util_SOURCES = \
1362         src/test/test-socket-util.c
1363
1364 test_socket_util_LDADD = \
1365         libsystemd-core.la
1366
1367 test_ring_SOURCES = \
1368         src/test/test-ring.c
1369
1370 test_ring_LDADD = \
1371         libsystemd-core.la
1372
1373 test_tmpfiles_SOURCES = \
1374         src/test/test-tmpfiles.c
1375
1376 test_tmpfiles_LDADD = \
1377         libsystemd-shared.la
1378
1379 test_namespace_SOURCES = \
1380         src/test/test-namespace.c
1381
1382 test_namespace_LDADD = \
1383         libsystemd-core.la
1384
1385 test_hashmap_SOURCES = \
1386         src/test/test-hashmap.c
1387
1388 test_hashmap_LDADD = \
1389         libsystemd-core.la
1390
1391 test_xml_SOURCES = \
1392         src/test/test-xml.c
1393
1394 test_xml_LDADD = \
1395         libsystemd-shared.la
1396
1397 test_list_SOURCES = \
1398         src/test/test-list.c
1399
1400 test_list_LDADD = \
1401         libsystemd-core.la
1402
1403 test_tables_SOURCES = \
1404         src/test/test-tables.c \
1405         src/shared/test-tables.h
1406
1407 test_tables_CFLAGS = \
1408         $(AM_CFLAGS) \
1409         $(SECCOMP_CFLAGS)
1410
1411 test_tables_LDADD = \
1412         libsystemd-logs.la \
1413         libsystemd-journal-internal.la \
1414         libsystemd-core.la \
1415         $(RT_LIBS)
1416
1417 test_prioq_SOURCES = \
1418         src/test/test-prioq.c
1419
1420 test_prioq_LDADD = \
1421         libsystemd-core.la
1422
1423 test_fileio_SOURCES = \
1424         src/test/test-fileio.c
1425
1426 test_fileio_LDADD = \
1427         libsystemd-core.la
1428
1429 test_time_SOURCES = \
1430         src/test/test-time.c
1431
1432 test_time_LDADD = \
1433         libsystemd-core.la
1434
1435 test_architecture_SOURCES = \
1436         src/test/test-architecture.c
1437
1438 test_architecture_LDADD = \
1439         libsystemd-shared.la
1440
1441 test_log_SOURCES = \
1442         src/test/test-log.c
1443
1444 test_log_LDADD = \
1445         libsystemd-core.la
1446
1447 test_ipcrm_SOURCES = \
1448         src/test/test-ipcrm.c
1449
1450 test_ipcrm_LDADD = \
1451         libsystemd-shared.la \
1452         -lrt
1453
1454 test_rtnl_manual_SOURCES = \
1455         src/test/test-rtnl-manual.c
1456
1457 test_rtnl_manual_CFLAGS = \
1458         $(AM_CFLAGS) \
1459         $(KMOD_CFLAGS)
1460
1461 test_rtnl_manual_LDADD = \
1462         libsystemd-internal.la \
1463         libsystemd-shared.la \
1464         $(KMOD_LIBS)
1465
1466 test_ellipsize_SOURCES = \
1467         src/test/test-ellipsize.c
1468
1469 test_ellipsize_LDADD = \
1470         libsystemd-core.la
1471
1472 test_date_SOURCES = \
1473         src/test/test-date.c
1474
1475 test_date_LDADD = \
1476         libsystemd-core.la
1477
1478 test_sleep_SOURCES = \
1479         src/test/test-sleep.c
1480
1481 test_sleep_LDADD = \
1482         libsystemd-core.la
1483
1484 test_replace_var_SOURCES = \
1485         src/test/test-replace-var.c
1486
1487 test_replace_var_LDADD = \
1488         libsystemd-shared.la
1489
1490 test_calendarspec_SOURCES = \
1491         src/test/test-calendarspec.c
1492
1493 test_calendarspec_LDADD = \
1494         libsystemd-shared.la
1495
1496 test_strip_tab_ansi_SOURCES = \
1497         src/test/test-strip-tab-ansi.c
1498
1499 test_strip_tab_ansi_LDADD = \
1500         libsystemd-shared.la
1501
1502 test_daemon_SOURCES = \
1503         src/test/test-daemon.c
1504
1505 test_daemon_LDADD = \
1506         libsystemd-internal.la \
1507         libsystemd-shared.la
1508
1509 test_cgroup_SOURCES = \
1510         src/test/test-cgroup.c
1511
1512 test_cgroup_LDADD = \
1513         libsystemd-label.la \
1514         libsystemd-shared.la \
1515         libsystemd-internal.la
1516
1517 test_cgroup_mask_SOURCES = \
1518         src/test/test-cgroup-mask.c
1519
1520 test_cgroup_mask_CPPFLAGS = \
1521         $(AM_CPPFLAGS) \
1522         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1523
1524 test_cgroup_mask_CFLAGS = \
1525         $(AM_CFLAGS) \
1526         $(SECCOMP_CFLAGS)
1527
1528 test_cgroup_mask_LDADD = \
1529         libsystemd-core.la \
1530         $(RT_LIBS)
1531
1532 test_cgroup_util_SOURCES = \
1533         src/test/test-cgroup-util.c
1534
1535 test_cgroup_util_LDADD = \
1536         libsystemd-label.la \
1537         libsystemd-internal.la \
1538         libsystemd-shared.la
1539
1540 test_env_replace_SOURCES = \
1541         src/test/test-env-replace.c
1542
1543 test_env_replace_LDADD = \
1544         libsystemd-shared.la
1545
1546 test_strbuf_SOURCES = \
1547         src/test/test-strbuf.c
1548
1549 test_strbuf_LDADD = \
1550         libsystemd-shared.la
1551
1552 test_strv_SOURCES = \
1553         src/test/test-strv.c
1554
1555 test_strv_LDADD = \
1556         libsystemd-units.la \
1557         libsystemd-internal.la \
1558         libsystemd-shared.la
1559
1560 test_path_util_SOURCES = \
1561         src/test/test-path-util.c
1562
1563 test_path_util_LDADD = \
1564         libsystemd-shared.la
1565
1566 test_strxcpyx_SOURCES = \
1567         src/test/test-strxcpyx.c
1568
1569 test_strxcpyx_LDADD = \
1570         libsystemd-shared.la
1571
1572 test_install_SOURCES = \
1573         src/test/test-install.c
1574
1575 test_install_LDADD = \
1576         libsystemd-units.la \
1577         libsystemd-label.la \
1578         libsystemd-shared.la \
1579         libsystemd-internal.la
1580
1581 test_watchdog_SOURCES = \
1582         src/test/test-watchdog.c
1583
1584 test_watchdog_LDADD = \
1585         libsystemd-shared.la
1586
1587 test_sched_prio_SOURCES = \
1588         src/test/test-sched-prio.c
1589
1590 test_sched_prio_CPPFLAGS = \
1591         $(AM_CPPFLAGS) \
1592         -DTEST_DIR=\"$(abs_top_srcdir)/test\"
1593
1594 test_sched_prio_CFLAGS = \
1595         $(AM_CFLAGS) \
1596         $(SECCOMP_CFLAGS)
1597
1598 test_sched_prio_LDADD = \
1599         libsystemd-core.la \
1600         $(RT_LIBS)
1601
1602 # ------------------------------------------------------------------------------
1603 ## .PHONY so it always rebuilds it
1604 .PHONY: coverage lcov-run lcov-report coverage-sync
1605
1606 # run lcov from scratch, always
1607 coverage:
1608         $(MAKE) lcov-run
1609         $(MAKE) lcov-report
1610
1611 coverage_dir = coverage
1612 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
1613
1614 if ENABLE_COVERAGE
1615 # reset run coverage tests
1616 lcov-run:
1617         @rm -rf $(coverage_dir)
1618         lcov $(coverage_opts) --zerocounters
1619         -$(MAKE) check
1620
1621 # generate report based on current coverage data
1622 lcov-report:
1623         $(MKDIR_P) $(coverage_dir)
1624         lcov $(coverage_opts) --compat-libtool --capture --no-external \
1625                 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
1626         genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov.info
1627         @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
1628
1629 # lcov doesn't work properly with vpath builds, make sure that bad
1630 # output is not uploaded by mistake.
1631 coverage-sync: coverage
1632         test "$(builddir)" = "$(srcdir)"
1633         rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
1634
1635 else
1636 lcov-run lcov-report:
1637         echo "Need to reconfigure with --enable-coverage"
1638 endif
1639
1640 # ------------------------------------------------------------------------------
1641 systemd_analyze_SOURCES = \
1642         src/analyze/analyze.c
1643
1644 systemd_analyze_LDADD = \
1645         libsystemd-internal.la \
1646         libsystemd-shared.la
1647
1648 # ------------------------------------------------------------------------------
1649 systemd_initctl_SOURCES = \
1650         src/initctl/initctl.c
1651
1652 systemd_initctl_LDADD = \
1653         libsystemd-internal.la \
1654         libsystemd-shared.la
1655
1656 # ------------------------------------------------------------------------------
1657 systemd_update_utmp_SOURCES = \
1658         src/update-utmp/update-utmp.c
1659
1660 systemd_update_utmp_CFLAGS = \
1661         $(AM_CFLAGS) \
1662         $(AUDIT_CFLAGS)
1663
1664 systemd_update_utmp_LDADD = \
1665         libsystemd-internal.la \
1666         libsystemd-shared.la \
1667         $(AUDIT_LIBS)
1668
1669 # ------------------------------------------------------------------------------
1670 systemd_update_done_SOURCES = \
1671         src/update-done/update-done.c
1672
1673 systemd_update_done_LDADD = \
1674         libsystemd-internal.la \
1675         libsystemd-shared.la
1676
1677 # ------------------------------------------------------------------------------
1678 systemd_shutdownd_SOURCES = \
1679         src/shutdownd/shutdownd.c
1680
1681 systemd_shutdownd_LDADD = \
1682         libsystemd-label.la \
1683         libsystemd-internal.la \
1684         libsystemd-shared.la
1685
1686 dist_doc_DATA += \
1687         src/systemd/sd-shutdown.h
1688
1689 # ------------------------------------------------------------------------------
1690 systemd_shutdown_SOURCES = \
1691         src/core/umount.c \
1692         src/core/umount.h \
1693         src/core/shutdown.c \
1694         src/core/mount-setup.c \
1695         src/core/mount-setup.h \
1696         src/core/killall.h \
1697         src/core/killall.c
1698
1699 systemd_shutdown_LDADD = \
1700         libsystemd-label.la \
1701         libudev-internal.la \
1702         libsystemd-shared.la
1703
1704 # ------------------------------------------------------------------------------
1705 if HAVE_KMOD
1706 systemd_modules_load_SOURCES = \
1707         src/modules-load/modules-load.c
1708
1709 systemd_modules_load_CFLAGS = \
1710         $(AM_CFLAGS) \
1711         $(KMOD_CFLAGS)
1712
1713 systemd_modules_load_LDADD = \
1714         libsystemd-shared.la \
1715         $(KMOD_LIBS)
1716
1717 rootlibexec_PROGRAMS += \
1718         systemd-modules-load
1719
1720 nodist_systemunit_DATA += \
1721         units/systemd-modules-load.service
1722
1723 SYSINIT_TARGET_WANTS += \
1724         systemd-modules-load.service
1725
1726 if ENABLE_TMPFILES
1727 nodist_systemunit_DATA += \
1728         units/kmod-static-nodes.service
1729
1730 SYSINIT_TARGET_WANTS += \
1731         kmod-static-nodes.service
1732 endif
1733 endif
1734
1735 EXTRA_DIST += \
1736         units/systemd-modules-load.service.in \
1737         units/kmod-static-nodes.service.in
1738
1739 # ------------------------------------------------------------------------------
1740 if ENABLE_TMPFILES
1741 systemd_tmpfiles_SOURCES = \
1742         src/tmpfiles/tmpfiles.c
1743
1744 systemd_tmpfiles_LDADD = \
1745         libsystemd-units.la \
1746         libsystemd-label.la \
1747         libsystemd-capability.la \
1748         libsystemd-internal.la \
1749         libsystemd-shared.la
1750
1751 rootbin_PROGRAMS += \
1752         systemd-tmpfiles
1753
1754 dist_systemunit_DATA += \
1755         units/systemd-tmpfiles-clean.timer
1756
1757 nodist_systemunit_DATA += \
1758         units/systemd-tmpfiles-setup-dev.service \
1759         units/systemd-tmpfiles-setup.service \
1760         units/systemd-tmpfiles-clean.service
1761
1762 dist_tmpfiles_DATA = \
1763         tmpfiles.d/systemd.conf \
1764         tmpfiles.d/systemd-nologin.conf \
1765         tmpfiles.d/tmp.conf \
1766         tmpfiles.d/x11.conf \
1767         tmpfiles.d/var.conf \
1768         tmpfiles.d/etc.conf
1769
1770 if HAVE_SYSV_COMPAT
1771 dist_tmpfiles_DATA += \
1772         tmpfiles.d/legacy.conf
1773 endif
1774
1775 SYSINIT_TARGET_WANTS += \
1776         systemd-tmpfiles-setup-dev.service \
1777         systemd-tmpfiles-setup.service
1778
1779 dist_zshcompletion_DATA += \
1780         shell-completion/zsh/_systemd-tmpfiles
1781
1782 TIMERS_TARGET_WANTS += \
1783         systemd-tmpfiles-clean.timer
1784
1785 INSTALL_DIRS += \
1786         $(tmpfilesdir) \
1787         $(sysconfdir)/tmpfiles.d
1788 endif
1789
1790 EXTRA_DIST += \
1791         units/systemd-tmpfiles-setup-dev.service.in \
1792         units/systemd-tmpfiles-setup.service.in \
1793         units/systemd-tmpfiles-clean.service.in
1794
1795 # ------------------------------------------------------------------------------
1796 if ENABLE_SYSUSERS
1797 systemd_sysusers_SOURCES = \
1798         src/sysusers/sysusers.c
1799
1800 systemd_sysusers_LDADD = \
1801         libsystemd-units.la \
1802         libsystemd-label.la \
1803         libsystemd-capability.la \
1804         libsystemd-internal.la \
1805         libsystemd-shared.la
1806
1807 rootbin_PROGRAMS += \
1808         systemd-sysusers
1809
1810 nodist_systemunit_DATA += \
1811         units/systemd-sysusers.service
1812
1813 SYSINIT_TARGET_WANTS += \
1814         systemd-sysusers.service
1815
1816 nodist_sysusers_DATA = \
1817         sysusers.d/systemd.conf
1818
1819 EXTRA_DIST += \
1820         units/systemd-sysusers.service.in \
1821         sysusers.d/systemd.conf.in
1822
1823 INSTALL_DIRS += \
1824         $(sysusersdir)
1825 endif
1826
1827 # ------------------------------------------------------------------------------
1828 systemd_machine_id_setup_SOURCES = \
1829         src/machine-id-setup/machine-id-setup-main.c \
1830         src/core/machine-id-setup.c \
1831         src/core/machine-id-setup.h
1832
1833 systemd_machine_id_setup_LDADD = \
1834         libsystemd-label.la \
1835         libsystemd-internal.la \
1836         libsystemd-shared.la
1837
1838 # ------------------------------------------------------------------------------
1839 systemd_sysctl_SOURCES = \
1840         src/sysctl/sysctl.c
1841
1842 systemd_sysctl_LDADD = \
1843         libsystemd-shared.la
1844
1845 # ------------------------------------------------------------------------------
1846 systemd_sleep_SOURCES = \
1847         src/sleep/sleep.c
1848
1849 systemd_sleep_LDADD = \
1850         libsystemd-shared.la
1851
1852 # ------------------------------------------------------------------------------
1853 systemd_fsck_SOURCES = \
1854         src/fsck/fsck.c
1855
1856 systemd_fsck_LDADD = \
1857         libsystemd-internal.la \
1858         libudev-internal.la \
1859         libsystemd-shared.la
1860
1861 # ------------------------------------------------------------------------------
1862 systemd_ac_power_SOURCES = \
1863         src/ac-power/ac-power.c
1864
1865 systemd_ac_power_LDADD = \
1866         libudev-internal.la \
1867         libsystemd-shared.la
1868
1869 # ------------------------------------------------------------------------------
1870 systemd_detect_virt_SOURCES = \
1871         src/detect-virt/detect-virt.c
1872
1873 systemd_detect_virt_LDADD = \
1874         libsystemd-shared.la
1875
1876 INSTALL_EXEC_HOOKS += \
1877         systemd-detect-virt-install-hook
1878
1879 # ------------------------------------------------------------------------------
1880 systemd_delta_SOURCES = \
1881         src/delta/delta.c
1882
1883 systemd_delta_LDADD = \
1884         libsystemd-shared.la
1885
1886 # ------------------------------------------------------------------------------
1887 systemd_getty_generator_SOURCES = \
1888         src/getty-generator/getty-generator.c
1889
1890 systemd_getty_generator_LDADD = \
1891         libsystemd-label.la \
1892         libsystemd-shared.la
1893
1894 # ------------------------------------------------------------------------------
1895 systemd_fstab_generator_SOURCES = \
1896         src/fstab-generator/fstab-generator.c \
1897         src/core/mount-setup.c
1898
1899 systemd_fstab_generator_LDADD = \
1900         libsystemd-label.la \
1901         libsystemd-shared.la
1902
1903 # ------------------------------------------------------------------------------
1904 systemd_system_update_generator_SOURCES = \
1905         src/system-update-generator/system-update-generator.c
1906
1907 systemd_system_update_generator_LDADD = \
1908         libsystemd-label.la \
1909         libsystemd-shared.la
1910
1911 if ENABLE_EFI
1912 # ------------------------------------------------------------------------------
1913 systemgenerator_PROGRAMS +=  \
1914         systemd-efi-boot-generator
1915
1916 systemd_efi_boot_generator_SOURCES = \
1917         src/efi-boot-generator/efi-boot-generator.c
1918
1919 systemd_efi_boot_generator_LDADD = \
1920         libsystemd-label.la \
1921         libsystemd-shared.la
1922
1923 # ------------------------------------------------------------------------------
1924 bootctl_SOURCES = \
1925         src/boot/boot.h \
1926         src/boot/boot-loader.h \
1927         src/boot/bootctl.c \
1928         src/boot/boot-loader.c \
1929         src/boot/boot-efi.c
1930
1931 bootctl_LDADD = \
1932         libsystemd-shared.la \
1933         libsystemd-internal.la
1934
1935 bin_PROGRAMS += \
1936         bootctl
1937
1938 dist_bashcompletion_DATA += \
1939         shell-completion/bash/bootctl
1940
1941 dist_zshcompletion_DATA += \
1942         shell-completion/zsh/_bootctl
1943
1944 endif
1945
1946 # ------------------------------------------------------------------------------
1947 if HAVE_BLKID
1948 systemgenerator_PROGRAMS +=  \
1949         systemd-gpt-auto-generator
1950
1951 systemd_gpt_auto_generator_SOURCES = \
1952         src/gpt-auto-generator/gpt-auto-generator.c \
1953         src/shared/blkid-util.h
1954
1955 systemd_gpt_auto_generator_LDADD = \
1956         libsystemd-label.la \
1957         libsystemd-internal.la \
1958         libudev-internal.la \
1959         libsystemd-shared.la \
1960         $(BLKID_LIBS)
1961
1962 systemd_gpt_auto_generator_CFLAGS = \
1963         $(AM_CFLAGS) \
1964         $(BLKID_CFLAGS)
1965 endif
1966
1967 # ------------------------------------------------------------------------------
1968 if ENABLE_KDBUS
1969 systemgenerator_PROGRAMS +=  \
1970         systemd-dbus1-generator
1971
1972 systemd_dbus1_generator_SOURCES = \
1973         src/dbus1-generator/dbus1-generator.c
1974
1975 systemd_dbus1_generator_LDADD = \
1976         libsystemd-label.la \
1977         libsystemd-shared.la \
1978         libsystemd-internal.la
1979
1980 dbus1-generator-install-hook:
1981         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(usergeneratordir)
1982         $(AM_V_RM)rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
1983         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(systemgeneratordir)/systemd-dbus1-generator $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
1984
1985 dbus1-generator-uninstall-hook:
1986         rm -f $(DESTDIR)$(usergeneratordir)/systemd-dbus1-generator
1987
1988 INSTALL_EXEC_HOOKS += dbus1-generator-install-hook
1989 UNINSTALL_EXEC_HOOKS += dbus1-generator-uninstall-hook
1990 endif
1991
1992 # ------------------------------------------------------------------------------
1993 systemd_sysv_generator_SOURCES = \
1994         src/sysv-generator/sysv-generator.c
1995
1996 systemd_sysv_generator_LDADD = \
1997         libsystemd-core.la \
1998         libsystemd-label.la \
1999         libsystemd-shared.la
2000
2001 # ------------------------------------------------------------------------------
2002 systemd_rc_local_generator_SOURCES = \
2003         src/rc-local-generator/rc-local-generator.c
2004
2005 systemd_rc_local_generator_LDADD = \
2006         libsystemd-label.la \
2007         libsystemd-shared.la
2008
2009 # ------------------------------------------------------------------------------
2010 systemd_remount_fs_SOURCES = \
2011         src/remount-fs/remount-fs.c \
2012         src/core/mount-setup.c \
2013         src/core/mount-setup.h
2014
2015 systemd_remount_fs_LDADD = \
2016         libsystemd-label.la \
2017         libsystemd-shared.la
2018
2019 # ------------------------------------------------------------------------------
2020 systemd_cgroups_agent_SOURCES = \
2021         src/cgroups-agent/cgroups-agent.c
2022
2023 systemd_cgroups_agent_LDADD = \
2024         libsystemd-internal.la \
2025         libsystemd-shared.la
2026
2027 # ------------------------------------------------------------------------------
2028 systemctl_SOURCES = \
2029         src/systemctl/systemctl.c
2030
2031 systemctl_LDADD = \
2032         libsystemd-units.la \
2033         libsystemd-label.la \
2034         libsystemd-internal.la \
2035         libsystemd-logs.la \
2036         libsystemd-journal-internal.la \
2037         libsystemd-shared.la
2038
2039 # ------------------------------------------------------------------------------
2040 systemd_notify_SOURCES = \
2041         src/notify/notify.c \
2042         src/readahead/sd-readahead.c
2043
2044 systemd_notify_LDADD = \
2045         libsystemd-internal.la \
2046         libsystemd-shared.la
2047
2048 # ------------------------------------------------------------------------------
2049 systemd_ask_password_SOURCES = \
2050         src/ask-password/ask-password.c
2051
2052 systemd_ask_password_LDADD = \
2053         libsystemd-label.la \
2054         libsystemd-shared.la
2055
2056 # ------------------------------------------------------------------------------
2057 systemd_reply_password_SOURCES = \
2058         src/reply-password/reply-password.c
2059
2060 systemd_reply_password_LDADD = \
2061         libsystemd-shared.la
2062
2063 # ------------------------------------------------------------------------------
2064 systemd_cgls_SOURCES = \
2065         src/cgls/cgls.c
2066
2067 systemd_cgls_LDADD = \
2068         libsystemd-internal.la \
2069         libsystemd-shared.la
2070
2071 # ------------------------------------------------------------------------------
2072 systemd_cgtop_SOURCES = \
2073         src/cgtop/cgtop.c
2074
2075 systemd_cgtop_LDADD = \
2076         libsystemd-shared.la
2077
2078 # ------------------------------------------------------------------------------
2079 systemd_nspawn_SOURCES = \
2080         src/nspawn/nspawn.c \
2081         src/core/mount-setup.c \
2082         src/core/mount-setup.h \
2083         src/core/loopback-setup.c \
2084         src/core/loopback-setup.h
2085
2086 systemd_nspawn_CFLAGS = \
2087         $(AM_CFLAGS) \
2088         $(SECCOMP_CFLAGS) \
2089         $(BLKID_CFLAGS)
2090
2091 systemd_nspawn_LDADD = \
2092         libsystemd-label.la \
2093         libsystemd-capability.la \
2094         libsystemd-internal.la \
2095         libudev-internal.la \
2096         libsystemd-shared.la \
2097         $(BLKID_LIBS)
2098
2099 if HAVE_SECCOMP
2100 systemd_nspawn_LDADD += \
2101         libsystemd-seccomp.la \
2102         $(SECCOMP_LIBS)
2103 endif
2104
2105 # ------------------------------------------------------------------------------
2106 systemd_run_SOURCES = \
2107         src/run/run.c
2108
2109 systemd_run_LDADD = \
2110         libsystemd-label.la \
2111         libsystemd-capability.la \
2112         libsystemd-internal.la \
2113         libsystemd-shared.la
2114
2115 # ------------------------------------------------------------------------------
2116 systemd_bus_proxyd_SOURCES = \
2117         src/bus-proxyd/bus-proxyd.c \
2118         src/bus-proxyd/bus-policy.c \
2119         src/bus-proxyd/bus-policy.h
2120
2121 systemd_bus_proxyd_LDADD = \
2122         libsystemd-capability.la \
2123         libsystemd-internal.la \
2124         libsystemd-shared.la
2125
2126 bus-proxyd-install-hook:
2127         $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir)
2128         $(AM_V_RM)rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
2129         $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(rootlibexecdir)/systemd-bus-proxyd $(DESTDIR)$(bindir)/systemd-stdio-bridge
2130
2131 bus-proxyd-uninstall-hook:
2132         rm -f $(DESTDIR)$(bindir)/systemd-stdio-bridge
2133
2134 INSTALL_EXEC_HOOKS += bus-proxyd-install-hook
2135 UNINSTALL_EXEC_HOOKS += bus-proxyd-uninstall-hook
2136
2137 if ENABLE_KDBUS
2138 nodist_systemunit_DATA += \
2139         units/systemd-bus-proxyd@.service
2140
2141 dist_systemunit_DATA += \
2142         units/systemd-bus-proxyd.socket
2143
2144 dist_userunit_DATA += \
2145         units/user/systemd-bus-proxyd.socket \
2146         units/user/systemd-bus-proxyd@.service
2147 endif
2148
2149 EXTRA_DIST += \
2150         units/systemd-bus-proxyd@.service.in
2151
2152 # ------------------------------------------------------------------------------
2153 systemd_tty_ask_password_agent_SOURCES = \
2154         src/tty-ask-password-agent/tty-ask-password-agent.c
2155
2156 systemd_tty_ask_password_agent_LDADD = \
2157         libsystemd-label.la \
2158         libsystemd-shared.la
2159
2160 # ------------------------------------------------------------------------------
2161 libsystemd_internal_la_SOURCES = \
2162         src/systemd/sd-bus.h \
2163         src/systemd/sd-bus-protocol.h \
2164         src/systemd/sd-bus-vtable.h \
2165         src/systemd/sd-memfd.h \
2166         src/systemd/sd-utf8.h \
2167         src/systemd/sd-event.h \
2168         src/systemd/sd-rtnl.h \
2169         src/systemd/sd-resolve.h \
2170         src/systemd/sd-login.h \
2171         src/systemd/sd-id128.h \
2172         src/systemd/sd-daemon.h \
2173         src/libsystemd/sd-bus/sd-bus.c \
2174         src/libsystemd/sd-bus/bus-control.c \
2175         src/libsystemd/sd-bus/bus-control.h \
2176         src/libsystemd/sd-bus/bus-error.c \
2177         src/libsystemd/sd-bus/bus-error.h \
2178         src/libsystemd/sd-bus/bus-internal.c \
2179         src/libsystemd/sd-bus/bus-internal.h \
2180         src/libsystemd/sd-bus/bus-socket.c \
2181         src/libsystemd/sd-bus/bus-socket.h \
2182         src/libsystemd/sd-bus/bus-kernel.c \
2183         src/libsystemd/sd-bus/bus-kernel.h \
2184         src/libsystemd/sd-bus/bus-container.c \
2185         src/libsystemd/sd-bus/bus-container.h \
2186         src/libsystemd/sd-bus/bus-message.c \
2187         src/libsystemd/sd-bus/bus-message.h \
2188         src/libsystemd/sd-bus/bus-creds.c \
2189         src/libsystemd/sd-bus/bus-creds.h \
2190         src/libsystemd/sd-bus/bus-signature.c \
2191         src/libsystemd/sd-bus/bus-signature.h \
2192         src/libsystemd/sd-bus/bus-type.c \
2193         src/libsystemd/sd-bus/bus-type.h \
2194         src/libsystemd/sd-bus/bus-match.c \
2195         src/libsystemd/sd-bus/bus-match.h \
2196         src/libsystemd/sd-bus/bus-bloom.c \
2197         src/libsystemd/sd-bus/bus-bloom.h \
2198         src/libsystemd/sd-bus/bus-introspect.c \
2199         src/libsystemd/sd-bus/bus-introspect.h \
2200         src/libsystemd/sd-bus/bus-objects.c \
2201         src/libsystemd/sd-bus/bus-objects.h \
2202         src/libsystemd/sd-bus/bus-gvariant.c \
2203         src/libsystemd/sd-bus/bus-gvariant.h \
2204         src/libsystemd/sd-bus/bus-convenience.c \
2205         src/libsystemd/sd-bus/bus-track.c \
2206         src/libsystemd/sd-bus/bus-track.h \
2207         src/libsystemd/sd-bus/bus-util.c \
2208         src/libsystemd/sd-bus/bus-util.h \
2209         src/libsystemd/sd-bus/bus-slot.c \
2210         src/libsystemd/sd-bus/bus-slot.h \
2211         src/libsystemd/sd-bus/bus-protocol.h \
2212         src/libsystemd/sd-bus/kdbus.h \
2213         src/libsystemd/sd-bus/sd-memfd.c \
2214         src/libsystemd/sd-utf8/sd-utf8.c \
2215         src/libsystemd/sd-event/sd-event.c \
2216         src/libsystemd/sd-event/event-util.h \
2217         src/libsystemd/sd-rtnl/sd-rtnl.c \
2218         src/libsystemd/sd-rtnl/rtnl-internal.h \
2219         src/libsystemd/sd-rtnl/rtnl-message.c \
2220         src/libsystemd/sd-rtnl/rtnl-types.h \
2221         src/libsystemd/sd-rtnl/rtnl-types.c \
2222         src/libsystemd/sd-rtnl/rtnl-util.h \
2223         src/libsystemd/sd-rtnl/rtnl-util.c \
2224         src/libsystemd/sd-id128/sd-id128.c \
2225         src/libsystemd/sd-daemon/sd-daemon.c \
2226         src/libsystemd/sd-login/sd-login.c
2227
2228 nodist_libsystemd_internal_la_SOURCES = \
2229         src/libsystemd/libsystemd.sym \
2230         src/libsystemd/sd-bus/bus-error-mapping.c
2231
2232 libsystemd_internal_la_CFLAGS = \
2233         $(AM_CFLAGS) \
2234         -pthread
2235
2236 libsystemd_internal_la_LIBADD = \
2237         $(RT_LIBS)
2238
2239 libsystemd_resolve_la_SOURCES = \
2240         src/libsystemd/sd-resolve/sd-resolve.c \
2241         src/libsystemd/sd-resolve/resolve-util.h
2242
2243 libsystemd_resolve_la_CFLAGS = \
2244         $(AM_CFLAGS) \
2245         -pthread
2246
2247 libsystemd_resolve_la_LIBADD = \
2248         -lresolv
2249
2250 noinst_LTLIBRARIES += \
2251         libsystemd-internal.la \
2252         libsystemd-resolve.la
2253
2254 libsystemd_dump_la_SOURCES = \
2255         src/libsystemd/sd-bus/bus-dump.c \
2256         src/libsystemd/sd-bus/bus-dump.h
2257
2258 libsystemd_dump_la_CFLAGS = \
2259         $(AM_CFLAGS) \
2260         $(CAP_CFLAGS)
2261
2262 noinst_LTLIBRARIES += \
2263         libsystemd-dump.la
2264
2265 EXTRA_DIST += \
2266         src/libsystemd/libsystemd.sym.m4 \
2267         src/libsystemd/libsystemd.pc.in \
2268         src/libsystemd/sd-bus/bus-error-mapping.gperf \
2269         src/libsystemd/sd-bus/DIFFERENCES \
2270         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
2271
2272 CLEANFILES += \
2273         src/libsystemd/libsystemd.sym \
2274         src/libsystemd/sd-bus/bus-error-mapping.c
2275
2276 BUILT_SOURCES += \
2277         src/libsystemd/libsystemd.sym
2278
2279 libsystemd_la_SOURCES = \
2280         $(libsystemd_internal_la_SOURCES) \
2281         $(libsystemd_resolve_la_SOURCES) \
2282         $(libsystemd_journal_internal_la_SOURCES)
2283
2284 nodist_libsystemd_la_SOURCES = \
2285         $(nodist_libsystemd_internal_la_SOURCES)
2286
2287 libsystemd_la_CFLAGS = \
2288         $(libsystemd_internal_la_CFLAGS) \
2289         $(libsystemd_resolve_la_CFLAGS) \
2290         $(libsystemd_journal_internal_la_CFLAGS)
2291
2292 libsystemd_la_LDFLAGS = \
2293         $(AM_LDFLAGS) \
2294         -version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
2295         -Wl,--version-script=$(top_builddir)/src/libsystemd/libsystemd.sym
2296
2297 libsystemd_la_LIBADD = \
2298         libsystemd-shared.la \
2299         $(libsystemd_internal_la_LIBADD) \
2300         $(libsystemd_journal_internal_la_LIBADD) \
2301         $(libsystemd_resolve_la_LIBADD)
2302
2303 libsystemd-install-hook:
2304         libname=libsystemd.so && $(move-to-rootlibdir)
2305
2306 libsystemd-uninstall-hook:
2307         rm -f $(DESTDIR)$(rootlibdir)/libsystemd.so*
2308
2309 INSTALL_EXEC_HOOKS += libsystemd-install-hook
2310 UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook
2311
2312 pkgconfiglib_DATA += \
2313         src/libsystemd/libsystemd.pc
2314
2315 pkginclude_HEADERS += \
2316         src/systemd/sd-login.h \
2317         src/systemd/sd-id128.h \
2318         src/systemd/sd-daemon.h
2319
2320 if ENABLE_KDBUS
2321 pkginclude_HEADERS += \
2322         src/systemd/sd-bus.h \
2323         src/systemd/sd-bus-protocol.h \
2324         src/systemd/sd-bus-vtable.h \
2325         src/systemd/sd-memfd.h \
2326         src/systemd/sd-utf8.h \
2327         src/systemd/sd-event.h \
2328         src/systemd/sd-rtnl.h \
2329         src/systemd/sd-resolve.h
2330 endif
2331
2332 lib_LTLIBRARIES += \
2333         libsystemd.la
2334
2335 tests += \
2336         test-bus-marshal \
2337         test-bus-signature \
2338         test-bus-chat \
2339         test-bus-cleanup \
2340         test-bus-server \
2341         test-bus-match \
2342         test-bus-kernel \
2343         test-bus-kernel-bloom \
2344         test-bus-kernel-benchmark \
2345         test-bus-memfd \
2346         test-bus-zero-copy \
2347         test-bus-introspect \
2348         test-bus-objects \
2349         test-bus-error \
2350         test-bus-creds \
2351         test-bus-gvariant \
2352         test-event \
2353         test-rtnl \
2354         test-resolve
2355
2356 bin_PROGRAMS += \
2357         busctl
2358
2359 test_bus_marshal_SOURCES = \
2360         src/libsystemd/sd-bus/test-bus-marshal.c
2361
2362 test_bus_marshal_LDADD = \
2363         libsystemd-internal.la \
2364         libsystemd-shared.la \
2365         libsystemd-dump.la \
2366         libsystemd-capability.la \
2367         $(GLIB_LIBS) \
2368         $(DBUS_LIBS) \
2369         $(CAP_LIBS)
2370
2371 test_bus_marshal_CFLAGS = \
2372         $(AM_CFLAGS) \
2373         $(GLIB_CFLAGS) \
2374         $(DBUS_CFLAGS) \
2375         $(CAP_CFLAGS)
2376
2377 test_bus_signature_SOURCES = \
2378         src/libsystemd/sd-bus/test-bus-signature.c
2379
2380 test_bus_signature_LDADD = \
2381         libsystemd-shared.la \
2382         libsystemd-internal.la
2383
2384 test_bus_chat_SOURCES = \
2385         src/libsystemd/sd-bus/test-bus-chat.c
2386
2387 test_bus_chat_CFLAGS = \
2388         $(AM_CFLAGS) \
2389         -pthread
2390
2391 test_bus_chat_LDADD = \
2392         libsystemd-internal.la \
2393         libsystemd-shared.la
2394
2395 test_bus_cleanup_SOURCES = \
2396         src/libsystemd/sd-bus/test-bus-cleanup.c
2397
2398 test_bus_cleanup_CFLAGS = \
2399         $(AM_CFLAGS) \
2400         $(SECCOMP_CFLAGS)
2401
2402 test_bus_cleanup_LDADD = \
2403         libsystemd-internal.la \
2404         libsystemd-shared.la
2405
2406 test_bus_server_SOURCES = \
2407         src/libsystemd/sd-bus/test-bus-server.c
2408
2409 test_bus_server_CFLAGS = \
2410         $(AM_CFLAGS) \
2411         -pthread
2412
2413 test_bus_server_LDADD = \
2414         libsystemd-internal.la \
2415         libsystemd-shared.la
2416
2417 test_bus_objects_SOURCES = \
2418         src/libsystemd/sd-bus/test-bus-objects.c
2419
2420 test_bus_objects_CFLAGS = \
2421         $(AM_CFLAGS) \
2422         $(CAP_CFLAGS) \
2423         -pthread
2424
2425 test_bus_objects_LDADD = \
2426         libsystemd-internal.la \
2427         libsystemd-shared.la \
2428         libsystemd-dump.la \
2429         libsystemd-capability.la \
2430         $(CAP_LIBS)
2431
2432 test_bus_error_SOURCES = \
2433         src/libsystemd/sd-bus/test-bus-error.c
2434
2435 test_bus_error_LDADD = \
2436         libsystemd-internal.la \
2437         libsystemd-shared.la
2438
2439 test_bus_gvariant_SOURCES = \
2440         src/libsystemd/sd-bus/test-bus-gvariant.c
2441
2442 test_bus_gvariant_LDADD = \
2443         libsystemd-internal.la \
2444         libsystemd-shared.la \
2445         libsystemd-dump.la \
2446         libsystemd-capability.la \
2447         $(GLIB_LIBS) \
2448         $(CAP_LIBS)
2449
2450 test_bus_gvariant_CFLAGS = \
2451         $(AM_CFLAGS) \
2452         $(GLIB_CFLAGS)
2453         $(CAP_CFLAGS)
2454
2455 test_bus_creds_SOURCES = \
2456         src/libsystemd/sd-bus/test-bus-creds.c
2457
2458 test_bus_creds_LDADD = \
2459         libsystemd-internal.la \
2460         libsystemd-shared.la \
2461         libsystemd-dump.la \
2462         libsystemd-capability.la
2463
2464 test_bus_match_SOURCES = \
2465         src/libsystemd/sd-bus/test-bus-match.c
2466
2467 test_bus_match_LDADD = \
2468         libsystemd-internal.la \
2469         libsystemd-shared.la
2470
2471 test_bus_kernel_SOURCES = \
2472         src/libsystemd/sd-bus/test-bus-kernel.c
2473
2474 test_bus_kernel_LDADD = \
2475         libsystemd-internal.la \
2476         libsystemd-shared.la \
2477         libsystemd-dump.la \
2478         libsystemd-capability.la \
2479         $(CAP_LIBS)
2480
2481 test_bus_kernel_CFLAGS = \
2482         $(AM_CFLAGS) \
2483         $(CAP_CFLAGS)
2484
2485 test_bus_kernel_bloom_SOURCES = \
2486         src/libsystemd/sd-bus/test-bus-kernel-bloom.c
2487
2488 test_bus_kernel_bloom_LDADD = \
2489         libsystemd-internal.la \
2490         libsystemd-shared.la
2491
2492 test_bus_kernel_benchmark_SOURCES = \
2493         src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
2494
2495 test_bus_kernel_benchmark_LDADD = \
2496         libsystemd-internal.la \
2497         libsystemd-shared.la
2498
2499 test_bus_memfd_SOURCES = \
2500         src/libsystemd/sd-bus/test-bus-memfd.c
2501
2502 test_bus_memfd_LDADD = \
2503         libsystemd-internal.la \
2504         libsystemd-shared.la
2505
2506 test_bus_zero_copy_SOURCES = \
2507         src/libsystemd/sd-bus/test-bus-zero-copy.c
2508
2509 test_bus_zero_copy_LDADD = \
2510         libsystemd-internal.la \
2511         libsystemd-shared.la \
2512         libsystemd-dump.la \
2513         libsystemd-capability.la \
2514         $(CAP_LIBS)
2515
2516 test_bus_zero_copy_CFLAGS = \
2517         $(AM_CFLAGS) \
2518         $(CAP_CFLAGS)
2519
2520 test_bus_introspect_SOURCES = \
2521         src/libsystemd/sd-bus/test-bus-introspect.c
2522
2523 test_bus_introspect_LDADD = \
2524         libsystemd-internal.la \
2525         libsystemd-shared.la
2526
2527 test_event_SOURCES = \
2528         src/libsystemd/sd-event/test-event.c
2529
2530 test_event_LDADD = \
2531         libsystemd-internal.la \
2532         libsystemd-shared.la
2533
2534 test_rtnl_SOURCES = \
2535         src/libsystemd/sd-rtnl/test-rtnl.c
2536
2537 test_rtnl_LDADD = \
2538         libsystemd-internal.la \
2539         libsystemd-shared.la
2540
2541 test_resolve_SOURCES = \
2542         src/libsystemd/sd-resolve/test-resolve.c
2543
2544 test_resolve_LDADD = \
2545         libsystemd-resolve.la \
2546         libsystemd-internal.la \
2547         libsystemd-shared.la
2548
2549 test_resolve_CFLAGS = \
2550         $(AM_CFLAGS) \
2551         -pthread
2552
2553 busctl_SOURCES = \
2554         src/libsystemd/sd-bus/busctl.c
2555
2556 busctl_LDADD = \
2557         libsystemd-internal.la \
2558         libsystemd-shared.la \
2559         libsystemd-dump.la \
2560         libsystemd-capability.la \
2561         $(CAP_LIBS)
2562
2563 busctl_CFLAGS = \
2564         $(AM_CFLAGS) \
2565         $(CAP_CFLAGS)
2566
2567 # ------------------------------------------------------------------------------
2568 noinst_LTLIBRARIES += \
2569         libsystemd-network.la
2570
2571 libsystemd_network_la_CFLAGS = \
2572         $(AM_CFLAGS) \
2573         $(KMOD_CFLAGS)
2574
2575 libsystemd_network_la_SOURCES = \
2576         src/systemd/sd-network.h \
2577         src/systemd/sd-dhcp-client.h \
2578         src/systemd/sd-dhcp-server.h \
2579         src/systemd/sd-dhcp-lease.h \
2580         src/systemd/sd-ipv4ll.h \
2581         src/network/sd-network.c \
2582         src/network/network-util.h \
2583         src/libsystemd-network/sd-dhcp-client.c \
2584         src/libsystemd-network/sd-dhcp-server.c \
2585         src/libsystemd-network/dhcp-network.c \
2586         src/libsystemd-network/dhcp-option.c \
2587         src/libsystemd-network/dhcp-packet.c \
2588         src/libsystemd-network/dhcp-internal.h \
2589         src/libsystemd-network/dhcp-server-internal.h \
2590         src/libsystemd-network/dhcp-protocol.h \
2591         src/libsystemd-network/dhcp-lease-internal.h \
2592         src/libsystemd-network/sd-dhcp-lease.c \
2593         src/libsystemd-network/sd-ipv4ll.c \
2594         src/libsystemd-network/ipv4ll-network.c \
2595         src/libsystemd-network/ipv4ll-packet.c \
2596         src/libsystemd-network/ipv4ll-internal.h \
2597         src/libsystemd-network/network-internal.c \
2598         src/libsystemd-network/network-internal.h
2599
2600 libsystemd_network_la_LIBADD = \
2601         libudev-internal.la \
2602         libsystemd-label.la \
2603         libsystemd-internal.la \
2604         libsystemd-shared.la \
2605         $(KMOD_LIBS)
2606
2607 test_dhcp_option_SOURCES = \
2608         src/libsystemd-network/dhcp-protocol.h \
2609         src/libsystemd-network/dhcp-internal.h \
2610         src/libsystemd-network/test-dhcp-option.c
2611
2612 test_dhcp_option_LDADD = \
2613         libsystemd-network.la \
2614         libsystemd-internal.la \
2615         libsystemd-shared.la
2616
2617 test_dhcp_client_SOURCES = \
2618         src/systemd/sd-dhcp-client.h \
2619         src/libsystemd-network/dhcp-protocol.h \
2620         src/libsystemd-network/dhcp-internal.h \
2621         src/libsystemd-network/test-dhcp-client.c
2622
2623 test_dhcp_client_LDADD = \
2624         libsystemd-network.la \
2625         libsystemd-label.la \
2626         libsystemd-internal.la \
2627         libsystemd-shared.la
2628
2629 test_dhcp_server_SOURCES = \
2630         src/libsystemd-network/test-dhcp-server.c
2631
2632 test_dhcp_server_LDADD = \
2633         libsystemd-network.la \
2634         libsystemd-internal.la \
2635         libsystemd-shared.la
2636
2637 test_ipv4ll_SOURCES = \
2638         src/systemd/sd-ipv4ll.h \
2639         src/libsystemd-network/ipv4ll-internal.h \
2640         src/libsystemd-network/test-ipv4ll.c
2641
2642 test_ipv4ll_LDADD = \
2643         libsystemd-network.la \
2644         libsystemd-label.la \
2645         libsystemd-internal.la \
2646         libsystemd-shared.la
2647
2648 tests += \
2649         test-dhcp-option \
2650         test-dhcp-client \
2651         test-dhcp-server \
2652         test-ipv4ll
2653
2654 # ------------------------------------------------------------------------------
2655 if ENABLE_GTK_DOC
2656 SUBDIRS += \
2657         docs/libudev
2658
2659 noinst_DATA += \
2660         docs/html/libudev \
2661         docs/html/gudev
2662 endif
2663
2664 include_HEADERS += \
2665         src/libudev/libudev.h
2666
2667 lib_LTLIBRARIES += \
2668         libudev.la
2669
2670 libudev_la_SOURCES =\
2671         src/libudev/libudev.sym \
2672         src/libudev/libudev-private.h \
2673         src/libudev/libudev.c \
2674         src/libudev/libudev-list.c \
2675         src/libudev/libudev-util.c \
2676         src/libudev/libudev-device.c \
2677         src/libudev/libudev-enumerate.c \
2678         src/libudev/libudev-monitor.c \
2679         src/libudev/libudev-queue.c \
2680         src/libudev/libudev-hwdb-def.h \
2681         src/libudev/libudev-hwdb.c
2682
2683 libudev_la_CFLAGS = \
2684         $(AM_CFLAGS) \
2685         -fvisibility=hidden
2686
2687 libudev_la_LDFLAGS = \
2688         $(AM_LDFLAGS) \
2689         -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
2690         -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
2691
2692 libudev_la_LIBADD = \
2693         libsystemd-internal.la \
2694         libsystemd-shared.la
2695
2696 pkgconfiglib_DATA += \
2697         src/libudev/libudev.pc
2698
2699 EXTRA_DIST += \
2700         src/libudev/libudev.pc.in
2701
2702 CLEANFILES += \
2703         src/libudev/libudev.pc \
2704         docs/html/libudev \
2705         docs/html/gudev
2706
2707 docs/html/libudev:
2708         $(AM_V_at)$(MKDIR_P) $(dir $@)
2709         $(AM_V_LN)$(LN_S) -f ../libudev/html $@
2710
2711 docs/html/gudev:
2712         $(AM_V_at)$(MKDIR_P) $(dir $@)
2713         $(AM_V_LN)$(LN_S) -f ../gudev/html $@
2714
2715 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
2716 libudev-install-hook:
2717         libname=libudev.so && $(move-to-rootlibdir)
2718
2719 libudev-uninstall-hook:
2720         rm -f $(DESTDIR)$(rootlibdir)/libudev.so*
2721
2722 INSTALL_EXEC_HOOKS += libudev-install-hook
2723 UNINSTALL_EXEC_HOOKS += libudev-uninstall-hook
2724
2725 # ------------------------------------------------------------------------------
2726 noinst_LTLIBRARIES += \
2727         libudev-internal.la
2728
2729 libudev_internal_la_SOURCES =\
2730         $(libudev_la_SOURCES) \
2731         src/libudev/libudev-device-private.c
2732
2733 libudev_internal_la_CFLAGS = \
2734         $(AM_CFLAGS) \
2735         -fvisibility=default
2736
2737 # ------------------------------------------------------------------------------
2738 INSTALL_DIRS += \
2739         $(sysconfdir)/udev/rules.d \
2740         $(sysconfdir)/udev/hwdb.d
2741
2742 dist_network_DATA = \
2743         network/99-default.link \
2744         network/80-container-host0.network \
2745         network/80-container-ve.network
2746
2747 dist_udevrules_DATA += \
2748         rules/42-usb-hid-pm.rules \
2749         rules/50-udev-default.rules \
2750         rules/60-drm.rules \
2751         rules/60-keyboard.rules \
2752         rules/60-persistent-storage-tape.rules \
2753         rules/60-persistent-serial.rules \
2754         rules/60-persistent-input.rules \
2755         rules/60-persistent-alsa.rules \
2756         rules/60-persistent-storage.rules \
2757         rules/64-btrfs.rules \
2758         rules/75-net-description.rules \
2759         rules/75-tty-description.rules \
2760         rules/78-sound-card.rules \
2761         rules/80-net-setup-link.rules \
2762         rules/95-udev-late.rules
2763
2764 nodist_udevrules_DATA += \
2765         rules/99-systemd.rules
2766
2767 dist_udevhwdb_DATA = \
2768         hwdb/20-pci-vendor-model.hwdb \
2769         hwdb/20-pci-classes.hwdb \
2770         hwdb/20-usb-vendor-model.hwdb \
2771         hwdb/20-usb-classes.hwdb \
2772         hwdb/20-sdio-vendor-model.hwdb \
2773         hwdb/20-sdio-classes.hwdb \
2774         hwdb/20-bluetooth-vendor-product.hwdb \
2775         hwdb/20-acpi-vendor.hwdb \
2776         hwdb/20-OUI.hwdb \
2777         hwdb/20-net-ifname.hwdb \
2778         hwdb/60-keyboard.hwdb
2779
2780 udevconfdir = $(sysconfdir)/udev
2781 dist_udevconf_DATA = \
2782         src/udev/udev.conf
2783
2784 sharepkgconfigdir = $(datadir)/pkgconfig
2785 sharepkgconfig_DATA = \
2786         src/udev/udev.pc
2787
2788 EXTRA_DIST += \
2789         rules/99-systemd.rules.in \
2790         src/udev/udev.pc.in
2791
2792 CLEANFILES += \
2793         rules/99-systemd.rules \
2794         src/udev/udev.pc
2795
2796 EXTRA_DIST += \
2797         units/systemd-udevd.service.in \
2798         units/systemd-udev-trigger.service.in \
2799         units/systemd-udev-settle.service.in \
2800         units/systemd-udev-hwdb-update.service.in
2801
2802 CLEANFILES += \
2803         units/systemd-udevd.service \
2804         units/systemd-udev-trigger.service \
2805         units/systemd-udev-settle.service \
2806         units/systemd-udev-hwdb-update.service
2807
2808 SOCKETS_TARGET_WANTS += \
2809         systemd-udevd-control.socket \
2810         systemd-udevd-kernel.socket
2811
2812 SYSINIT_TARGET_WANTS += \
2813         systemd-udevd.service \
2814         systemd-udev-trigger.service \
2815         systemd-udev-hwdb-update.service
2816
2817 rootbin_PROGRAMS += \
2818         udevadm
2819
2820 rootlibexec_PROGRAMS += \
2821         systemd-udevd
2822
2823 noinst_LTLIBRARIES += \
2824         libudev-core.la
2825
2826 src/udev/keyboard-keys.txt:
2827         $(AM_V_at)$(MKDIR_P) $(dir $@)
2828         $(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/' > $@
2829
2830 src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt
2831         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@
2832
2833 src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
2834         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
2835
2836 src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt
2837         $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@
2838
2839 libudev_core_la_SOURCES = \
2840         src/udev/udev.h \
2841         src/udev/udev-event.c \
2842         src/udev/udev-watch.c \
2843         src/udev/udev-node.c \
2844         src/udev/udev-rules.c \
2845         src/udev/udev-ctrl.c \
2846         src/udev/udev-builtin.c \
2847         src/udev/udev-builtin-btrfs.c \
2848         src/udev/udev-builtin-hwdb.c \
2849         src/udev/udev-builtin-input_id.c \
2850         src/udev/udev-builtin-keyboard.c \
2851         src/udev/udev-builtin-net_id.c \
2852         src/udev/udev-builtin-net_setup_link.c \
2853         src/udev/udev-builtin-path_id.c \
2854         src/udev/udev-builtin-usb_id.c \
2855         src/udev/net/link-config.h \
2856         src/udev/net/link-config.c \
2857         src/udev/net/ethtool-util.h \
2858         src/udev/net/ethtool-util.c
2859
2860 nodist_libudev_core_la_SOURCES = \
2861         src/udev/keyboard-keys-from-name.h \
2862         src/udev/keyboard-keys-to-name.h \
2863         src/udev/net/link-config-gperf.c
2864
2865 BUILT_SOURCES += \
2866         $(nodist_libudev_core_la_SOURCES)
2867
2868 CLEANFILES += \
2869         src/udev/keyboard-keys-from-name.gperf \
2870         src/udev/keyboard-keys.txt \
2871         src/udev/net/link-config-gperf.c
2872
2873 EXTRA_DIST += \
2874         src/udev/net/link-config-gperf.gperf
2875
2876 libudev_core_la_CFLAGS = \
2877         $(AM_CFLAGS) \
2878         $(BLKID_CFLAGS) \
2879         $(KMOD_CFLAGS)
2880
2881 libudev_core_la_LIBADD = \
2882         libudev-internal.la \
2883         libsystemd-label.la \
2884         libsystemd-internal.la \
2885         libsystemd-network.la \
2886         libsystemd-shared.la \
2887         $(BLKID_LIBS) \
2888         $(KMOD_LIBS)
2889
2890 libudev_core_la_CPPFLAGS = \
2891         $(AM_CPPFLAGS) \
2892         -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
2893
2894 if ENABLE_FIRMWARE
2895 libudev_core_la_SOURCES += \
2896         src/udev/udev-builtin-firmware.c
2897
2898 dist_udevrules_DATA += \
2899         rules/50-firmware.rules
2900 endif
2901
2902 if HAVE_KMOD
2903 libudev_core_la_SOURCES += \
2904         src/udev/udev-builtin-kmod.c
2905
2906 dist_udevrules_DATA += \
2907         rules/80-drivers.rules
2908 endif
2909
2910 if HAVE_BLKID
2911 libudev_core_la_SOURCES += \
2912         src/udev/udev-builtin-blkid.c
2913 endif
2914
2915 if HAVE_ACL
2916 libudev_core_la_SOURCES += \
2917         src/udev/udev-builtin-uaccess.c \
2918         src/login/logind-acl.c \
2919         src/libsystemd/sd-login/sd-login.c \
2920         src/systemd/sd-login.h
2921
2922 libudev_core_la_LIBADD += \
2923         libsystemd-acl.la
2924 endif
2925
2926 systemd_udevd_SOURCES = \
2927         src/udev/udevd.c
2928
2929 systemd_udevd_LDADD = \
2930         libudev-core.la
2931
2932 udevadm_SOURCES = \
2933         src/udev/udevadm.c \
2934         src/udev/udevadm-info.c \
2935         src/udev/udevadm-control.c \
2936         src/udev/udevadm-monitor.c \
2937         src/udev/udevadm-hwdb.c \
2938         src/udev/udevadm-settle.c \
2939         src/udev/udevadm-trigger.c \
2940         src/udev/udevadm-test.c \
2941         src/udev/udevadm-test-builtin.c
2942
2943 udevadm_LDADD = \
2944         libudev-core.la
2945
2946 # Update hwdb on installation. Do not bother if installing
2947 # in DESTDIR, since this is likely for packaging purposes.
2948 hwdb-update-hook:
2949         -test -n "$(DESTDIR)" || $(rootbindir)/udevadm hwdb --update
2950
2951 INSTALL_DATA_HOOKS += \
2952         hwdb-update-hook
2953
2954 hwdb-remove-hook:
2955         -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
2956
2957 # ------------------------------------------------------------------------------
2958 TESTS += \
2959         test/udev-test.pl \
2960         test/rules-test.sh
2961
2962 manual_tests += \
2963         test-libudev \
2964         test-udev
2965
2966 test_libudev_SOURCES = \
2967         src/test/test-libudev.c
2968
2969 test_libudev_LDADD = \
2970         libsystemd-label.la \
2971         libudev-internal.la \
2972         libsystemd-shared.la
2973
2974 test_udev_SOURCES = \
2975         src/test/test-udev.c
2976
2977 test_udev_LDADD = \
2978         libudev-core.la \
2979         $(BLKID_LIBS) \
2980         $(KMOD_LIBS) \
2981         $(SELINUX_LIBS)
2982
2983 if HAVE_ACL
2984 test_udev_LDADD += \
2985         libsystemd-acl.la
2986 endif
2987
2988 check_DATA += \
2989         test/sys
2990
2991 # packed sysfs test tree
2992 test/sys:
2993         $(AM_V_at)$(MKDIR_P) $(dir $@)
2994         $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
2995
2996 test-sys-distclean:
2997         -rm -rf test/sys
2998 DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
2999
3000 EXTRA_DIST += \
3001         test/sys.tar.xz \
3002         test/udev-test.pl \
3003         test/rules-test.sh \
3004         test/rule-syntax-check.py
3005
3006 # ------------------------------------------------------------------------------
3007 ata_id_SOURCES = \
3008         src/udev/ata_id/ata_id.c
3009
3010 ata_id_LDADD = \
3011         libudev-internal.la \
3012         libsystemd-shared.la
3013
3014 udevlibexec_PROGRAMS += \
3015         ata_id
3016
3017 # ------------------------------------------------------------------------------
3018 cdrom_id_SOURCES = \
3019         src/udev/cdrom_id/cdrom_id.c
3020
3021 cdrom_id_LDADD = \
3022         libudev-internal.la \
3023         libsystemd-shared.la
3024
3025 udevlibexec_PROGRAMS += \
3026         cdrom_id
3027
3028 dist_udevrules_DATA += \
3029         rules/60-cdrom_id.rules
3030
3031 # ------------------------------------------------------------------------------
3032 collect_SOURCES = \
3033         src/udev/collect/collect.c
3034
3035 collect_LDADD = \
3036         libudev-internal.la \
3037         libsystemd-shared.la
3038
3039 udevlibexec_PROGRAMS += \
3040         collect
3041
3042 # ------------------------------------------------------------------------------
3043 scsi_id_SOURCES =\
3044         src/udev/scsi_id/scsi_id.c \
3045         src/udev/scsi_id/scsi_serial.c \
3046         src/udev/scsi_id/scsi.h \
3047         src/udev/scsi_id/scsi_id.h
3048
3049 scsi_id_LDADD = \
3050         libudev-internal.la \
3051         libsystemd-shared.la
3052
3053 udevlibexec_PROGRAMS += \
3054         scsi_id
3055
3056 EXTRA_DIST += \
3057         src/udev/scsi_id/README
3058
3059 # ------------------------------------------------------------------------------
3060 v4l_id_SOURCES = \
3061         src/udev/v4l_id/v4l_id.c
3062
3063 v4l_id_LDADD = \
3064         libudev-internal.la
3065
3066 udevlibexec_PROGRAMS += \
3067         v4l_id
3068
3069 dist_udevrules_DATA += \
3070         rules/60-persistent-v4l.rules
3071
3072 # ------------------------------------------------------------------------------
3073 accelerometer_SOURCES = \
3074         src/udev/accelerometer/accelerometer.c
3075
3076 accelerometer_LDADD = \
3077         libudev-internal.la -lm \
3078         libsystemd-shared.la
3079
3080 udevlibexec_PROGRAMS += \
3081         accelerometer
3082
3083 dist_udevrules_DATA += \
3084         rules/61-accelerometer.rules
3085
3086 # ------------------------------------------------------------------------------
3087 if ENABLE_GUDEV
3088 if ENABLE_GTK_DOC
3089 SUBDIRS += \
3090         docs/gudev
3091 endif
3092
3093 libgudev_includedir = \
3094         $(includedir)/gudev-1.0/gudev
3095
3096 libgudev_include_HEADERS = \
3097         src/gudev/gudev.h \
3098         src/gudev/gudevenums.h \
3099         src/gudev/gudevenumtypes.h \
3100         src/gudev/gudevtypes.h \
3101         src/gudev/gudevclient.h \
3102         src/gudev/gudevdevice.h \
3103         src/gudev/gudevenumerator.h
3104
3105 lib_LTLIBRARIES += libgudev-1.0.la
3106
3107 pkgconfiglib_DATA += \
3108         src/gudev/gudev-1.0.pc
3109
3110 CLEANFILES += \
3111         src/gudev/gudev-1.0.pc
3112
3113 libgudev_1_0_la_SOURCES = \
3114         src/gudev/gudevenums.h \
3115         src/gudev/gudevenumtypes.h \
3116         src/gudev/gudevenumtypes.h\
3117         src/gudev/gudevtypes.h \
3118         src/gudev/gudevclient.h \
3119         src/gudev/gudevclient.c \
3120         src/gudev/gudevdevice.h \
3121         src/gudev/gudevdevice.c \
3122         src/gudev/gudevenumerator.h \
3123         src/gudev/gudevenumerator.c \
3124         src/gudev/gudevprivate.h
3125
3126 nodist_libgudev_1_0_la_SOURCES = \
3127         src/gudev/gudevmarshal.h \
3128         src/gudev/gudevmarshal.c \
3129         src/gudev/gudevenumtypes.h \
3130         src/gudev/gudevenumtypes.c
3131
3132 BUILT_SOURCES += \
3133         $(nodist_libgudev_1_0_la_SOURCES)
3134
3135 libgudev_1_0_la_CPPFLAGS = \
3136         $(AM_CPPFLAGS) \
3137         -I$(top_builddir)/src\
3138         -I$(top_srcdir)/src\
3139         -I$(top_builddir)/src/gudev \
3140         -I$(top_srcdir)/src/gudev \
3141         -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
3142         -D_GUDEV_COMPILATION \
3143         -DG_LOG_DOMAIN=\"GUdev\"
3144
3145 libgudev_1_0_la_CFLAGS = \
3146         $(AM_CFLAGS) \
3147         -fvisibility=default \
3148         $(GLIB_CFLAGS)
3149
3150 libgudev_1_0_la_LIBADD = \
3151         libudev.la \
3152         $(GLIB_LIBS)
3153
3154 libgudev_1_0_la_LDFLAGS = \
3155         $(AM_LDFLAGS) \
3156         -version-info $(LIBGUDEV_CURRENT):$(LIBGUDEV_REVISION):$(LIBGUDEV_AGE) \
3157         -export-dynamic -no-undefined \
3158         -export-symbols-regex '^g_udev_.*'
3159
3160 src/gudev/gudevmarshal.h: src/gudev/gudevmarshal.list
3161         $(AM_V_at)$(MKDIR_P) $(dir $@)
3162         $(AM_V_GEN)glib-genmarshal $< --prefix=g_udev_marshal --header > $@
3163
3164 src/gudev/gudevmarshal.c: src/gudev/gudevmarshal.list
3165         $(AM_V_at)$(MKDIR_P) $(dir $@)
3166         $(AM_V_GEN)echo '#include "gudevmarshal.h"' > $@ && \
3167         glib-genmarshal $< --prefix=g_udev_marshal --body >> $@
3168
3169 src/gudev/gudevenumtypes.%: src/gudev/gudevenumtypes.%.template src/gudev/gudevenums.h
3170         $(AM_V_at)$(MKDIR_P) $(dir $@)
3171         $(AM_V_GEN)glib-mkenums --template $^ > $@
3172
3173 if HAVE_INTROSPECTION
3174 -include $(INTROSPECTION_MAKEFILE)
3175
3176 src/gudev/GUdev-1.0.gir: libgudev-1.0.la
3177
3178 src_gudev_GUdev_1_0_gir_INCLUDES = GObject-2.0
3179
3180 src_gudev_GUdev_1_0_gir_CFLAGS = \
3181         $(AM_CFLAGS) \
3182         $(INCLUDES) \
3183         -D_GUDEV_COMPILATION \
3184         -D_GUDEV_WORK_AROUND_DEV_T_BUG \
3185         -I$(top_srcdir)/src \
3186         -I$(top_builddir)/src \
3187         -I$(top_srcdir)/src/gudev \
3188         -I$(top_builddir)/src/gudev
3189
3190 src_gudev_GUdev_1_0_gir_LIBS = libgudev-1.0.la
3191
3192 src_gudev_GUdev_1_0_gir_SCANNERFLAGS = \
3193         --pkg-export=gudev-1.0 \
3194         --warn-all
3195
3196 src_gudev_GUdev_1_0_gir_FILES = \
3197         src/gudev/gudev.h \
3198         src/gudev/gudevtypes.h \
3199         src/gudev/gudevenums.h \
3200         src/gudev/gudevenumtypes.h \
3201         src/gudev/gudevclient.h \
3202         src/gudev/gudevdevice.h \
3203         src/gudev/gudevenumerator.h \
3204         src/gudev/gudevclient.c \
3205         src/gudev/gudevdevice.c \
3206         src/gudev/gudevenumerator.c
3207
3208 INTROSPECTION_GIRS = src/gudev/GUdev-1.0.gir
3209 INTROSPECTION_SCANNER_ARGS = --c-include=gudev/gudev.h
3210
3211 girdir = $(datadir)/gir-1.0
3212 gir_DATA = \
3213         src/gudev/GUdev-1.0.gir
3214
3215 typelibsdir = $(libdir)/girepository-1.0
3216 typelibs_DATA = \
3217         src/gudev/GUdev-1.0.typelib
3218
3219 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
3220 endif # HAVE_INTROSPECTION
3221
3222 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
3223 libgudev-install-hook:
3224         libname=libgudev-1.0.so && $(move-to-rootlibdir)
3225
3226 libgudev-uninstall-hook:
3227         rm -f $(DESTDIR)$(rootlibdir)/libgudev-1.0.so*
3228
3229 INSTALL_EXEC_HOOKS += libgudev-install-hook
3230 UNINSTALL_EXEC_HOOKS += libgudev-uninstall-hook
3231 endif
3232
3233 EXTRA_DIST += \
3234         src/gudev/gudev-1.0.pc.in \
3235         src/gudev/gudevmarshal.list \
3236         src/gudev/gudevenumtypes.h.template \
3237         src/gudev/gudevenumtypes.c.template \
3238         src/gudev/gjs-example.js \
3239         src/gudev/seed-example-enum.js \
3240         src/gudev/seed-example.js
3241
3242 # ------------------------------------------------------------------------------
3243 mtd_probe_SOURCES =  \
3244         src/udev/mtd_probe/mtd_probe.c \
3245         src/udev/mtd_probe/mtd_probe.h \
3246         src/udev/mtd_probe/probe_smartmedia.c
3247
3248 dist_udevrules_DATA += \
3249         rules/75-probe_mtd.rules
3250
3251 udevlibexec_PROGRAMS += \
3252         mtd_probe
3253
3254 # ------------------------------------------------------------------------------
3255 test_id128_SOURCES = \
3256         src/test/test-id128.c
3257
3258 test_id128_LDADD = \
3259         libsystemd-internal.la \
3260         libsystemd-shared.la
3261
3262 tests += \
3263         test-id128
3264
3265 # ------------------------------------------------------------------------------
3266
3267 rootlibexec_PROGRAMS += \
3268         systemd-activate
3269
3270 systemd_activate_SOURCES = \
3271         src/activate/activate.c
3272
3273 systemd_activate_LDADD = \
3274         libsystemd-label.la \
3275         libsystemd-internal.la \
3276         libsystemd-shared.la
3277
3278 # ------------------------------------------------------------------------------
3279 systemd_journald_SOURCES = \
3280         src/journal/journald.c \
3281         src/journal/journald-server.h
3282
3283 systemd_journald_LDADD = \
3284         libsystemd-journal-core.la \
3285         libsystemd-internal.la \
3286         libsystemd-shared.la
3287
3288 systemd_cat_SOURCES = \
3289         src/journal/cat.c
3290
3291 systemd_cat_LDADD = \
3292         libsystemd-journal-core.la
3293
3294 if HAVE_MICROHTTPD
3295 rootlibexec_PROGRAMS += \
3296         systemd-journal-remote
3297
3298 systemd_journal_remote_SOURCES = \
3299         src/journal/journal-remote-parse.h \
3300         src/journal/journal-remote-parse.c \
3301         src/journal/journal-remote-write.h \
3302         src/journal/journal-remote-write.c \
3303         src/journal/journal-remote.c
3304
3305 systemd_journal_remote_LDADD = \
3306         libsystemd-internal.la \
3307         libsystemd-journal-core.la
3308
3309 systemd_journal_remote_SOURCES += \
3310         src/journal/microhttpd-util.h \
3311         src/journal/microhttpd-util.c
3312
3313 systemd_journal_remote_CFLAGS = \
3314         $(AM_CFLAGS) \
3315         $(MICROHTTPD_CFLAGS)
3316
3317 systemd_journal_remote_LDADD += \
3318         $(MICROHTTPD_LIBS)
3319
3320 if HAVE_GNUTLS
3321 systemd_journal_remote_LDADD += \
3322         $(GNUTLS_LIBS)
3323 endif
3324 endif
3325
3326 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3327 journalctl_CFLAGS = \
3328         $(AM_CFLAGS)
3329
3330 journalctl_SOURCES = \
3331         src/journal/journalctl.c
3332
3333 journalctl_LDADD = \
3334         libsystemd-journal-internal.la \
3335         libsystemd-internal.la \
3336         libsystemd-logs.la \
3337         libsystemd-shared.la
3338
3339 if HAVE_ACL
3340 journalctl_LDADD += \
3341         libsystemd-acl.la
3342 endif
3343
3344 if HAVE_QRENCODE
3345 journalctl_SOURCES += \
3346         src/journal/journal-qrcode.c \
3347         src/journal/journal-qrcode.h
3348
3349 journalctl_CFLAGS += \
3350         $(QRENCODE_CFLAGS)
3351
3352 journalctl_LDADD += \
3353         $(QRENCODE_LIBS)
3354 endif
3355
3356 test_journal_SOURCES = \
3357         src/journal/test-journal.c
3358
3359 test_journal_LDADD = \
3360         libsystemd-journal-core.la
3361
3362 test_journal_send_SOURCES = \
3363         src/journal/test-journal-send.c
3364
3365 test_journal_send_LDADD = \
3366         libsystemd-journal-core.la
3367
3368 test_journal_syslog_SOURCES = \
3369         src/journal/test-journal-syslog.c
3370
3371 test_journal_syslog_LDADD = \
3372         libsystemd-journal-core.la
3373
3374 test_journal_match_SOURCES = \
3375         src/journal/test-journal-match.c
3376
3377 test_journal_match_LDADD = \
3378         libsystemd-journal-core.la
3379
3380 test_journal_enum_SOURCES = \
3381         src/journal/test-journal-enum.c
3382
3383 test_journal_enum_LDADD = \
3384         libsystemd-journal-core.la
3385
3386 test_journal_stream_SOURCES = \
3387         src/journal/test-journal-stream.c
3388
3389 test_journal_stream_LDADD = \
3390         libsystemd-journal-core.la
3391
3392 test_journal_flush_SOURCES = \
3393         src/journal/test-journal-flush.c
3394
3395 test_journal_flush_LDADD = \
3396         libsystemd-journal-core.la
3397
3398 test_journal_init_SOURCES = \
3399         src/journal/test-journal-init.c
3400
3401 test_journal_init_LDADD = \
3402         libsystemd-journal-core.la
3403
3404 test_journal_verify_SOURCES = \
3405         src/journal/test-journal-verify.c
3406
3407 test_journal_verify_LDADD = \
3408         libsystemd-journal-core.la
3409
3410 test_journal_interleaving_SOURCES = \
3411         src/journal/test-journal-interleaving.c
3412
3413 test_journal_interleaving_LDADD = \
3414         libsystemd-journal-core.la
3415
3416 test_mmap_cache_SOURCES = \
3417         src/journal/test-mmap-cache.c
3418
3419 test_mmap_cache_LDADD = \
3420         libsystemd-journal-core.la
3421
3422 test_catalog_SOURCES = \
3423         src/journal/test-catalog.c
3424
3425 test_catalog_CPPFLAGS = \
3426         $(AM_CPPFLAGS) \
3427         -DCATALOG_DIR=\"$(abs_top_srcdir)/catalog\"
3428
3429 test_catalog_LDADD = \
3430         libsystemd-journal-core.la
3431
3432 libsystemd_journal_core_la_SOURCES = \
3433         src/journal/journald-kmsg.c \
3434         src/journal/journald-kmsg.h \
3435         src/journal/journald-syslog.c \
3436         src/journal/journald-syslog.h \
3437         src/journal/journald-stream.c \
3438         src/journal/journald-stream.h \
3439         src/journal/journald-server.c \
3440         src/journal/journald-server.h \
3441         src/journal/journald-console.c \
3442         src/journal/journald-console.h \
3443         src/journal/journald-wall.c \
3444         src/journal/journald-wall.h \
3445         src/journal/journald-native.c \
3446         src/journal/journald-native.h \
3447         src/journal/journald-rate-limit.c \
3448         src/journal/journald-rate-limit.h \
3449         src/journal/journal-internal.h
3450
3451 nodist_libsystemd_journal_core_la_SOURCES = \
3452         src/journal/journald-gperf.c
3453
3454 libsystemd_journal_core_la_LIBADD = \
3455         libsystemd-journal-internal.la \
3456         libudev-internal.la \
3457         libsystemd-capability.la \
3458         libsystemd-label.la \
3459         libsystemd-internal.la \
3460         libsystemd-shared.la
3461
3462 if HAVE_ACL
3463 libsystemd_journal_core_la_LIBADD += \
3464         libsystemd-acl.la
3465 endif
3466
3467 noinst_LTLIBRARIES += \
3468         libsystemd-journal-core.la
3469
3470 journal-install-hook:
3471         -$(MKDIR_P) $(DESTDIR)/var/log/journal
3472         -chown 0:0 $(DESTDIR)/var/log/journal
3473         -chmod 755 $(DESTDIR)/var/log/journal
3474         -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
3475         -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
3476
3477 journal-uninstall-hook:
3478         -rmdir $(DESTDIR)/var/log/journal/
3479
3480 INSTALL_EXEC_HOOKS += journal-install-hook
3481 UNINSTALL_EXEC_HOOKS += journal-uninstall-hook
3482
3483 # ------------------------------------------------------------------------------
3484 # Update catalog on installation. Do not bother if installing
3485 # in DESTDIR, since this is likely for packaging purposes.
3486 catalog-update-hook:
3487         -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
3488
3489 INSTALL_DATA_HOOKS += \
3490         catalog-update-hook
3491
3492 catalog-remove-hook:
3493         -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
3494
3495 UNINSTALL_DATA_HOOKS += \
3496         catalog-remove-hook
3497
3498 manual_tests += \
3499         test-journal-enum
3500
3501 tests += \
3502         test-journal \
3503         test-journal-send \
3504         test-journal-syslog \
3505         test-journal-match \
3506         test-journal-stream \
3507         test-journal-init \
3508         test-journal-verify \
3509         test-journal-interleaving \
3510         test-journal-flush \
3511         test-mmap-cache \
3512         test-catalog
3513
3514 pkginclude_HEADERS += \
3515         src/systemd/sd-journal.h \
3516         src/systemd/sd-messages.h \
3517         src/systemd/_sd-common.h
3518
3519 libsystemd_journal_internal_la_SOURCES = \
3520         src/journal/sd-journal.c \
3521         src/systemd/sd-journal.h \
3522         src/systemd/_sd-common.h \
3523         src/journal/journal-file.c \
3524         src/journal/journal-file.h \
3525         src/journal/journal-vacuum.c \
3526         src/journal/journal-vacuum.h \
3527         src/journal/journal-verify.c \
3528         src/journal/journal-verify.h \
3529         src/journal/lookup3.c \
3530         src/journal/lookup3.h \
3531         src/journal/journal-send.c \
3532         src/journal/journal-def.h \
3533         src/journal/compress.h \
3534         src/journal/catalog.c \
3535         src/journal/catalog.h \
3536         src/journal/mmap-cache.c \
3537         src/journal/mmap-cache.h
3538
3539 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
3540 libsystemd_journal_internal_la_CFLAGS = \
3541         $(AM_CFLAGS)
3542
3543 libsystemd_journal_internal_la_LIBADD =
3544
3545 if HAVE_XZ
3546 libsystemd_journal_internal_la_SOURCES += \
3547         src/journal/compress.c
3548
3549 libsystemd_journal_internal_la_CFLAGS += \
3550         $(XZ_CFLAGS)
3551
3552 libsystemd_journal_internal_la_LIBADD += \
3553         $(XZ_LIBS)
3554 endif
3555
3556 if HAVE_GCRYPT
3557 libsystemd_journal_internal_la_SOURCES += \
3558         src/journal/journal-authenticate.c \
3559         src/journal/journal-authenticate.h \
3560         src/journal/fsprg.c \
3561         src/journal/fsprg.h
3562
3563 libsystemd_journal_internal_la_LIBADD += \
3564         $(GCRYPT_LIBS)
3565
3566 # fsprg.c is a drop-in file using void pointer arithmetic
3567 libsystemd_journal_internal_la_CFLAGS += \
3568         $(GCRYPT_CFLAGS) \
3569         -Wno-pointer-arith
3570 endif
3571
3572 noinst_LTLIBRARIES += \
3573         libsystemd-journal-internal.la
3574
3575 rootlibexec_PROGRAMS += \
3576         systemd-journald
3577
3578 rootbin_PROGRAMS += \
3579         journalctl
3580
3581 bin_PROGRAMS += \
3582         systemd-cat
3583
3584 dist_systemunit_DATA += \
3585         units/systemd-journald.socket \
3586         units/systemd-journald-dev-log.socket
3587
3588 nodist_systemunit_DATA += \
3589         units/systemd-journald.service \
3590         units/systemd-journal-flush.service \
3591         units/systemd-journal-catalog-update.service
3592
3593 dist_pkgsysconf_DATA += \
3594         src/journal/journald.conf
3595
3596 dist_catalog_DATA = \
3597         catalog/systemd.fr.catalog \
3598         catalog/systemd.ru.catalog \
3599         catalog/systemd.it.catalog \
3600         catalog/systemd.catalog
3601
3602 SOCKETS_TARGET_WANTS += \
3603         systemd-journald.socket \
3604         systemd-journald-dev-log.socket
3605
3606 SYSINIT_TARGET_WANTS += \
3607         systemd-journald.service \
3608         systemd-journal-flush.service \
3609         systemd-journal-catalog-update.service
3610
3611 EXTRA_DIST += \
3612         units/systemd-journald.service.in \
3613         units/systemd-journal-flush.service.in \
3614         units/systemd-journal-catalog-update.service.in \
3615         src/journal/journald-gperf.gperf
3616
3617 CLEANFILES += \
3618         src/journal/journald-gperf.c
3619
3620 # ------------------------------------------------------------------------------
3621 if HAVE_MICROHTTPD
3622 gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
3623
3624 rootlibexec_PROGRAMS += \
3625         systemd-journal-gatewayd
3626
3627 systemd_journal_gatewayd_SOURCES = \
3628         src/journal/journal-gatewayd.c \
3629         src/journal/microhttpd-util.h \
3630         src/journal/microhttpd-util.c
3631
3632 systemd_journal_gatewayd_LDADD = \
3633         libsystemd-logs.la \
3634         libsystemd-journal-internal.la \
3635         libsystemd-internal.la \
3636         libsystemd-shared.la \
3637         $(MICROHTTPD_LIBS)
3638
3639 if HAVE_GNUTLS
3640 systemd_journal_gatewayd_LDADD += \
3641         $(GNUTLS_LIBS)
3642 endif
3643
3644 systemd_journal_gatewayd_CFLAGS = \
3645         $(AM_CFLAGS) \
3646         $(MICROHTTPD_CFLAGS)
3647
3648 systemd_journal_gatewayd_CPPFLAGS = \
3649         $(AM_CPPFLAGS) \
3650         -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
3651
3652 dist_systemunit_DATA += \
3653         units/systemd-journal-gatewayd.socket
3654
3655 nodist_systemunit_DATA += \
3656         units/systemd-journal-gatewayd.service
3657
3658 dist_gatewayddocumentroot_DATA = \
3659         src/journal/browse.html
3660
3661 endif
3662
3663 EXTRA_DIST += \
3664         units/systemd-journal-gatewayd.service.in
3665
3666 # ------------------------------------------------------------------------------
3667
3668 systemd_socket_proxyd_SOURCES = \
3669         src/socket-proxy/socket-proxyd.c
3670
3671 systemd_socket_proxyd_LDADD = \
3672         libsystemd-logs.la \
3673         libsystemd-internal.la \
3674         libsystemd-journal-internal.la \
3675         libsystemd-shared.la \
3676         libsystemd-resolve.la
3677
3678 # ------------------------------------------------------------------------------
3679 if ENABLE_COREDUMP
3680 systemd_coredump_SOURCES = \
3681         src/journal/coredump.c
3682
3683 systemd_coredump_LDADD = \
3684         libsystemd-journal-internal.la \
3685         libsystemd-label.la \
3686         libsystemd-internal.la \
3687         libsystemd-shared.la
3688
3689 rootlibexec_PROGRAMS += \
3690         systemd-coredump
3691
3692 dist_pkgsysconf_DATA += \
3693         src/journal/coredump.conf
3694
3695 if HAVE_ACL
3696 systemd_coredump_LDADD += \
3697         libsystemd-acl.la
3698 endif
3699
3700 systemd_coredumpctl_SOURCES = \
3701         src/journal/coredumpctl.c
3702
3703 systemd_coredumpctl_LDADD = \
3704         libsystemd-journal-internal.la \
3705         libsystemd-internal.la \
3706         libsystemd-shared.la
3707
3708 bin_PROGRAMS += \
3709         systemd-coredumpctl
3710
3711 dist_bashcompletion_DATA += \
3712         shell-completion/bash/systemd-coredumpctl
3713
3714 dist_zshcompletion_DATA += \
3715         shell-completion/zsh/_systemd-coredumpctl
3716
3717 sysctl_DATA = \
3718         sysctl.d/50-coredump.conf
3719
3720 CLEANFILES += \
3721         sysctl.d/50-coredump.conf
3722 endif
3723
3724 EXTRA_DIST += \
3725         sysctl.d/50-coredump.conf.in
3726
3727 # ------------------------------------------------------------------------------
3728 if ENABLE_BINFMT
3729 systemd_binfmt_SOURCES = \
3730         src/binfmt/binfmt.c
3731
3732 systemd_binfmt_LDADD = \
3733         libsystemd-shared.la
3734
3735 rootlibexec_PROGRAMS += \
3736         systemd-binfmt
3737
3738 dist_systemunit_DATA += \
3739         units/proc-sys-fs-binfmt_misc.automount \
3740         units/proc-sys-fs-binfmt_misc.mount
3741
3742 nodist_systemunit_DATA += \
3743         units/systemd-binfmt.service
3744
3745 INSTALL_DIRS += \
3746         $(prefix)/lib/binfmt.d \
3747         $(sysconfdir)/binfmt.d
3748
3749 SYSINIT_TARGET_WANTS += \
3750         systemd-binfmt.service \
3751         proc-sys-fs-binfmt_misc.automount
3752
3753 endif
3754
3755 EXTRA_DIST += \
3756         units/systemd-binfmt.service.in
3757
3758 # ------------------------------------------------------------------------------
3759 if ENABLE_VCONSOLE
3760 systemd_vconsole_setup_SOURCES = \
3761         src/vconsole/vconsole-setup.c
3762
3763 systemd_vconsole_setup_LDADD = \
3764         libsystemd-shared.la
3765
3766 rootlibexec_PROGRAMS += \
3767         systemd-vconsole-setup
3768
3769 nodist_systemunit_DATA += \
3770         units/systemd-vconsole-setup.service
3771
3772 SYSINIT_TARGET_WANTS += \
3773         systemd-vconsole-setup.service
3774 endif
3775
3776 EXTRA_DIST += \
3777         units/systemd-vconsole-setup.service.in
3778
3779 # ------------------------------------------------------------------------------
3780 if ENABLE_READAHEAD
3781 systemd_readahead_SOURCES = \
3782         src/readahead/readahead.c \
3783         src/readahead/readahead-collect.c \
3784         src/readahead/readahead-replay.c \
3785         src/readahead/readahead-analyze.c \
3786         src/readahead/readahead-common.c \
3787         src/readahead/readahead-common.h
3788
3789 systemd_readahead_LDADD = \
3790         libsystemd-internal.la \
3791         libudev-internal.la \
3792         libsystemd-shared.la
3793
3794 dist_doc_DATA += \
3795         src/readahead/sd-readahead.c \
3796         src/systemd/sd-readahead.h
3797
3798 rootlibexec_PROGRAMS += \
3799         systemd-readahead
3800
3801 dist_systemunit_DATA += \
3802         units/systemd-readahead-drop.service \
3803         units/systemd-readahead-done.timer
3804
3805 nodist_systemunit_DATA += \
3806         units/systemd-readahead-collect.service \
3807         units/systemd-readahead-replay.service \
3808         units/systemd-readahead-done.service
3809
3810 manual_tests += \
3811         test-ssd
3812
3813 test_ssd_SOURCES = \
3814         src/readahead/test-ssd.c \
3815         src/readahead/readahead-common.c \
3816         src/readahead/readahead-common.h
3817
3818 test_ssd_LDADD = \
3819         libsystemd-internal.la \
3820         libudev-internal.la \
3821         libsystemd-shared.la
3822
3823 endif
3824
3825 EXTRA_DIST += \
3826         units/systemd-readahead-collect.service.in \
3827         units/systemd-readahead-replay.service.in \
3828         units/systemd-readahead-done.service.in
3829
3830 # ------------------------------------------------------------------------------
3831 if ENABLE_BOOTCHART
3832 systemd_bootchart_SOURCES = \
3833         src/bootchart/bootchart.c \
3834         src/bootchart/bootchart.h \
3835         src/bootchart/store.c \
3836         src/bootchart/store.h \
3837         src/bootchart/svg.c \
3838         src/bootchart/svg.h
3839
3840 systemd_bootchart_LDADD = \
3841         libsystemd-journal-internal.la \
3842         libsystemd-shared.la
3843
3844 rootlibexec_PROGRAMS += \
3845         systemd-bootchart
3846
3847 dist_pkgsysconf_DATA += \
3848         src/bootchart/bootchart.conf
3849 endif
3850
3851 # ------------------------------------------------------------------------------
3852 if ENABLE_QUOTACHECK
3853 rootlibexec_PROGRAMS += \
3854         systemd-quotacheck
3855
3856 nodist_systemunit_DATA += \
3857         units/systemd-quotacheck.service
3858
3859 systemd_quotacheck_SOURCES = \
3860         src/quotacheck/quotacheck.c
3861
3862 systemd_quotacheck_LDADD = \
3863         libsystemd-shared.la
3864 endif
3865
3866 EXTRA_DIST += \
3867         units/systemd-quotacheck.service.in
3868
3869 nodist_systemunit_DATA += \
3870         units/quotaon.service
3871
3872 # ------------------------------------------------------------------------------
3873 if ENABLE_RANDOMSEED
3874 rootlibexec_PROGRAMS += \
3875         systemd-random-seed
3876
3877 nodist_systemunit_DATA += \
3878         units/systemd-random-seed.service
3879
3880 systemd_random_seed_SOURCES = \
3881         src/random-seed/random-seed.c
3882
3883 systemd_random_seed_LDADD = \
3884         libsystemd-label.la \
3885         libsystemd-shared.la
3886
3887 SYSINIT_TARGET_WANTS += \
3888         systemd-random-seed.service
3889
3890 endif
3891
3892 EXTRA_DIST += \
3893         units/systemd-random-seed.service.in
3894
3895 # ------------------------------------------------------------------------------
3896 if ENABLE_BACKLIGHT
3897 rootlibexec_PROGRAMS += \
3898         systemd-backlight
3899
3900 nodist_systemunit_DATA += \
3901         units/systemd-backlight@.service
3902
3903 systemd_backlight_SOURCES = \
3904         src/backlight/backlight.c
3905
3906 systemd_backlight_LDADD = \
3907         libsystemd-label.la \
3908         libudev-internal.la \
3909         libsystemd-shared.la
3910 endif
3911
3912 EXTRA_DIST += \
3913         units/systemd-backlight@.service.in
3914
3915 # ------------------------------------------------------------------------------
3916 if ENABLE_RFKILL
3917 rootlibexec_PROGRAMS += \
3918         systemd-rfkill
3919
3920 nodist_systemunit_DATA += \
3921         units/systemd-rfkill@.service
3922
3923 systemd_rfkill_SOURCES = \
3924         src/rfkill/rfkill.c
3925
3926 systemd_rfkill_LDADD = \
3927         libsystemd-label.la \
3928         libudev-internal.la \
3929         libsystemd-shared.la
3930 endif
3931
3932 EXTRA_DIST += \
3933         units/systemd-rfkill@.service.in
3934
3935 # ------------------------------------------------------------------------------
3936 if HAVE_LIBCRYPTSETUP
3937 rootlibexec_PROGRAMS += \
3938         systemd-cryptsetup
3939
3940 systemgenerator_PROGRAMS += \
3941         systemd-cryptsetup-generator
3942
3943 dist_systemunit_DATA += \
3944         units/cryptsetup.target \
3945         units/cryptsetup-pre.target
3946
3947 systemd_cryptsetup_SOURCES = \
3948         src/cryptsetup/cryptsetup.c
3949
3950 systemd_cryptsetup_CFLAGS = \
3951         $(AM_CFLAGS) \
3952         $(LIBCRYPTSETUP_CFLAGS)
3953
3954 systemd_cryptsetup_LDADD = \
3955         libsystemd-label.la \
3956         libudev-internal.la \
3957         libsystemd-shared.la \
3958         $(LIBCRYPTSETUP_LIBS)
3959
3960 systemd_cryptsetup_generator_SOURCES = \
3961         src/cryptsetup/cryptsetup-generator.c
3962
3963 systemd_cryptsetup_generator_LDADD = \
3964         libsystemd-label.la \
3965         libsystemd-shared.la
3966
3967 SYSINIT_TARGET_WANTS += \
3968         cryptsetup.target
3969
3970 endif
3971
3972 # ------------------------------------------------------------------------------
3973 if ENABLE_HOSTNAMED
3974 systemd_hostnamed_SOURCES = \
3975         src/hostname/hostnamed.c
3976
3977 systemd_hostnamed_LDADD = \
3978         libsystemd-label.la \
3979         libsystemd-internal.la \
3980         libsystemd-shared.la
3981
3982 rootlibexec_PROGRAMS += \
3983         systemd-hostnamed
3984
3985 nodist_systemunit_DATA += \
3986         units/systemd-hostnamed.service
3987
3988 dist_systemunit_DATA += \
3989         units/org.freedesktop.hostname1.busname
3990
3991 dist_dbuspolicy_DATA += \
3992         src/hostname/org.freedesktop.hostname1.conf
3993
3994 dist_dbussystemservice_DATA += \
3995         src/hostname/org.freedesktop.hostname1.service
3996
3997 polkitpolicy_files += \
3998         src/hostname/org.freedesktop.hostname1.policy
3999
4000 SYSTEM_UNIT_ALIASES += \
4001         systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
4002
4003 BUSNAMES_TARGET_WANTS += \
4004         org.freedesktop.hostname1.busname
4005
4006 hostnamectl_SOURCES = \
4007         src/hostname/hostnamectl.c
4008
4009 hostnamectl_LDADD = \
4010         libsystemd-internal.la \
4011         libsystemd-shared.la
4012
4013 bin_PROGRAMS += \
4014         hostnamectl
4015
4016 dist_bashcompletion_DATA += \
4017         shell-completion/bash/hostnamectl
4018
4019 dist_zshcompletion_DATA += \
4020         shell-completion/zsh/_hostnamectl
4021
4022 endif
4023
4024 polkitpolicy_in_files += \
4025         src/hostname/org.freedesktop.hostname1.policy.in
4026
4027 EXTRA_DIST += \
4028         units/systemd-hostnamed.service.in
4029
4030 # ------------------------------------------------------------------------------
4031 if ENABLE_KDBUS
4032 dist_systemunit_DATA += \
4033         units/org.freedesktop.systemd1.busname
4034
4035 BUSNAMES_TARGET_WANTS += \
4036         org.freedesktop.systemd1.busname
4037 endif
4038
4039 # ------------------------------------------------------------------------------
4040 if ENABLE_LOCALED
4041 systemd_localed_SOURCES = \
4042         src/locale/localed.c
4043
4044 systemd_localed_LDADD = \
4045         libsystemd-label.la \
4046         libsystemd-internal.la \
4047         libsystemd-shared.la
4048
4049 nodist_systemunit_DATA += \
4050         units/systemd-localed.service
4051
4052 dist_systemunit_DATA += \
4053         units/org.freedesktop.locale1.busname
4054
4055 rootlibexec_PROGRAMS += \
4056         systemd-localed
4057
4058 dist_dbuspolicy_DATA += \
4059         src/locale/org.freedesktop.locale1.conf
4060
4061 dist_dbussystemservice_DATA += \
4062         src/locale/org.freedesktop.locale1.service
4063
4064 polkitpolicy_files += \
4065         src/locale/org.freedesktop.locale1.policy
4066
4067 SYSTEM_UNIT_ALIASES += \
4068         systemd-localed.service dbus-org.freedesktop.locale1.service
4069
4070 BUSNAMES_TARGET_WANTS += \
4071         org.freedesktop.locale1.busname
4072
4073 dist_pkgdata_DATA += \
4074         src/locale/kbd-model-map
4075
4076 dist_noinst_SCRIPT = \
4077         src/locale/generate-kbd-model-map
4078
4079 update-kbd-model-map: src/locale/generate-kbd-model-map
4080         $PYTHON $< >src/locale/kbd-model-map
4081
4082 localectl_SOURCES = \
4083         src/locale/localectl.c
4084
4085 localectl_LDADD = \
4086         libsystemd-internal.la \
4087         libsystemd-shared.la
4088
4089 bin_PROGRAMS += \
4090         localectl
4091
4092 dist_bashcompletion_DATA += \
4093         shell-completion/bash/localectl
4094
4095 dist_zshcompletion_DATA += \
4096         shell-completion/zsh/_localectl
4097
4098 endif
4099
4100 .PHONY: update-kbd-model-map
4101
4102 polkitpolicy_in_files += \
4103         src/locale/org.freedesktop.locale1.policy.in
4104
4105 EXTRA_DIST += \
4106         units/systemd-localed.service.in
4107
4108 # ------------------------------------------------------------------------------
4109 if ENABLE_TIMEDATED
4110 systemd_timedated_SOURCES = \
4111         src/timedate/timedated.c
4112
4113 systemd_timedated_LDADD = \
4114         libsystemd-label.la \
4115         libsystemd-internal.la \
4116         libsystemd-shared.la
4117
4118 rootlibexec_PROGRAMS += \
4119         systemd-timedated
4120
4121 dist_dbussystemservice_DATA += \
4122         src/timedate/org.freedesktop.timedate1.service
4123
4124 dist_dbuspolicy_DATA += \
4125         src/timedate/org.freedesktop.timedate1.conf
4126
4127 nodist_systemunit_DATA += \
4128         units/systemd-timedated.service
4129
4130 dist_systemunit_DATA += \
4131         units/org.freedesktop.timedate1.busname
4132
4133 polkitpolicy_files += \
4134         src/timedate/org.freedesktop.timedate1.policy
4135
4136 INSTALL_DIRS += \
4137         $(prefix)/lib/systemd/ntp-units.d \
4138         $(sysconfdir)/systemd/ntp-units.d
4139
4140 SYSTEM_UNIT_ALIASES += \
4141         systemd-timedated.service dbus-org.freedesktop.timedate1.service
4142
4143 BUSNAMES_TARGET_WANTS += \
4144         org.freedesktop.timedate1.busname
4145
4146 timedatectl_SOURCES = \
4147         src/timedate/timedatectl.c
4148
4149 timedatectl_LDADD = \
4150         libsystemd-internal.la \
4151         libsystemd-shared.la
4152
4153 bin_PROGRAMS += \
4154         timedatectl
4155
4156 dist_bashcompletion_DATA += \
4157         shell-completion/bash/timedatectl
4158
4159 dist_zshcompletion_DATA += \
4160         shell-completion/zsh/_timedatectl
4161 endif
4162
4163 polkitpolicy_in_files += \
4164         src/timedate/org.freedesktop.timedate1.policy.in
4165
4166 EXTRA_DIST += \
4167         units/systemd-timedated.service.in
4168
4169 # ------------------------------------------------------------------------------
4170 if ENABLE_TIMESYNCD
4171 systemd_timesyncd_SOURCES = \
4172         src/timesync/timesyncd.c \
4173         src/timesync/timesyncd.h
4174
4175 nodist_systemd_timesyncd_SOURCES = \
4176         src/timesync/timesyncd-gperf.c
4177
4178 EXTRA_DIST += \
4179         src/timesync/timesyncd-gperf.gperf
4180
4181 CLEANFILES += \
4182         src/timesync/timesyncd-gperf.c
4183
4184 systemd_timesyncd_LDADD = \
4185         libsystemd-resolve.la \
4186         libsystemd-network.la \
4187         libsystemd-label.la \
4188         libsystemd-capability.la \
4189         libsystemd-internal.la \
4190         libsystemd-shared.la \
4191         -lm
4192
4193 rootlibexec_PROGRAMS += \
4194         systemd-timesyncd
4195
4196 nodist_systemunit_DATA += \
4197         units/systemd-timesyncd.service
4198
4199 EXTRA_DIST += \
4200         units/systemd-timesyncd.service.in
4201
4202 nodist_pkgsysconf_DATA += \
4203         src/timesync/timesyncd.conf
4204
4205 EXTRA_DIST += \
4206         src/timesync/timesyncd.conf.in
4207
4208 CLEANFILES += \
4209         src/timesync/timesyncd.conf
4210
4211 dist_ntpunits_DATA = \
4212         src/timesync/90-systemd.list
4213
4214 endif
4215
4216 # ------------------------------------------------------------------------------
4217 if HAVE_MYHOSTNAME
4218 libnss_myhostname_la_SOURCES = \
4219         src/nss-myhostname/nss-myhostname.c \
4220         src/nss-myhostname/ifconf.h \
4221         src/nss-myhostname/netlink.c
4222
4223 libnss_myhostname_la_LDFLAGS = \
4224         $(AM_LDFLAGS) \
4225         -module \
4226         -export-dynamic \
4227         -avoid-version \
4228         -shared \
4229         -shrext .so.2
4230
4231 libnss_myhostname_la_LIBADD = \
4232         libsystemd-shared.la \
4233         libsystemd-internal.la
4234
4235 lib_LTLIBRARIES += \
4236         libnss_myhostname.la
4237 endif
4238
4239 # ------------------------------------------------------------------------------
4240 if ENABLE_MACHINED
4241 systemd_machined_SOURCES = \
4242         src/machine/machined.c \
4243         src/machine/machined.h
4244
4245 systemd_machined_LDADD = \
4246         libsystemd-machine-core.la
4247
4248 rootlibexec_PROGRAMS += \
4249         systemd-machined
4250
4251 libsystemd_machine_core_la_SOURCES = \
4252         src/machine/machined-dbus.c \
4253         src/machine/machine.c \
4254         src/machine/machine.h \
4255         src/machine/machine-dbus.c
4256
4257 libsystemd_machine_core_la_LIBADD = \
4258         libsystemd-label.la \
4259         libsystemd-internal.la \
4260         libudev-internal.la \
4261         libsystemd-shared.la
4262
4263 noinst_LTLIBRARIES += \
4264         libsystemd-machine-core.la
4265
4266 machinectl_SOURCES = \
4267         src/machine/machinectl.c
4268
4269 machinectl_LDADD = \
4270         libsystemd-internal.la \
4271         libsystemd-shared.la
4272
4273 rootbin_PROGRAMS += \
4274         machinectl
4275
4276 dist_bashcompletion_DATA += \
4277         shell-completion/bash/machinectl
4278
4279 test_machine_tables_SOURCES = \
4280         src/machine/test-machine-tables.c
4281
4282 test_machine_tables_LDADD = \
4283         libsystemd-machine-core.la
4284
4285 tests += \
4286         test-machine-tables
4287
4288 nodist_systemunit_DATA += \
4289         units/systemd-machined.service
4290
4291 dist_systemunit_DATA += \
4292         units/machine.slice \
4293         units/org.freedesktop.machine1.busname
4294
4295 dist_dbussystemservice_DATA += \
4296         src/machine/org.freedesktop.machine1.service
4297
4298 dist_dbuspolicy_DATA += \
4299         src/machine/org.freedesktop.machine1.conf
4300
4301 dist_zshcompletion_DATA += \
4302         shell-completion/zsh/_machinectl \
4303         shell-completion/zsh/_sd_machines
4304
4305 SYSTEM_UNIT_ALIASES += \
4306         systemd-machined.service dbus-org.freedesktop.machine1.service
4307
4308 BUSNAMES_TARGET_WANTS += \
4309         org.freedesktop.machine1.busname
4310
4311 EXTRA_DIST += \
4312         units/systemd-machined.service.in
4313
4314 endif
4315
4316 # ------------------------------------------------------------------------------
4317 if ENABLE_RESOLVED
4318 systemd_resolved_SOURCES = \
4319         src/resolve/resolved.h \
4320         src/resolve/resolved.c \
4321         src/resolve/resolved-manager.c
4322
4323 systemd_resolved_CFLAGS = \
4324         $(AM_CFLAGS) \
4325         $(KMOD_CFLAGS)
4326
4327 nodist_systemd_resolved_SOURCES = \
4328         src/resolve/resolved-gperf.c
4329
4330 EXTRA_DIST += \
4331         src/resolve/resolved-gperf.gperf
4332
4333 CLEANFILES += \
4334         src/resolve/resolved-gperf.c
4335
4336 systemd_resolved_LDADD = \
4337         libsystemd-capability.la \
4338         libsystemd-network.la \
4339         libsystemd-label.la \
4340         libsystemd-internal.la \
4341         libsystemd-shared.la
4342
4343 rootlibexec_PROGRAMS += \
4344         systemd-resolved
4345
4346 nodist_systemunit_DATA += \
4347         units/systemd-resolved.service
4348
4349 EXTRA_DIST += \
4350         units/systemd-resolved.service.in
4351
4352 GENERAL_ALIASES += \
4353         $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service
4354
4355 nodist_pkgsysconf_DATA += \
4356         src/resolve/resolved.conf
4357
4358 EXTRA_DIST += \
4359         src/resolve/resolved.conf.in
4360
4361 CLEANFILES += \
4362         src/resolve/resolved.conf
4363
4364 endif
4365
4366 # ------------------------------------------------------------------------------
4367 if ENABLE_NETWORKD
4368 rootlibexec_PROGRAMS += \
4369         systemd-networkd
4370
4371 systemd_networkd_SOURCES = \
4372         src/network/networkd.c
4373
4374 systemd_networkd_LDADD = \
4375         libsystemd-networkd-core.la \
4376         libsystemd-capability.la
4377
4378 noinst_LTLIBRARIES += \
4379         libsystemd-networkd-core.la
4380
4381 libsystemd_networkd_core_la_CFLAGS = \
4382         $(AM_CFLAGS)
4383
4384 libsystemd_networkd_core_la_SOURCES = \
4385         src/libsystemd-network/network-internal.h \
4386         src/network/networkd.h \
4387         src/network/networkd-link.c \
4388         src/network/networkd-netdev.c \
4389         src/network/networkd-tunnel.c \
4390         src/network/networkd-veth.c \
4391         src/network/networkd-vxlan.c \
4392         src/network/networkd-network.c \
4393         src/network/networkd-address.c \
4394         src/network/networkd-route.c \
4395         src/network/networkd-manager.c \
4396         src/network/networkd-address-pool.c
4397
4398 nodist_libsystemd_networkd_core_la_SOURCES = \
4399         src/network/networkd-network-gperf.c \
4400         src/network/networkd-netdev-gperf.c
4401
4402 libsystemd_networkd_core_la_LIBADD = \
4403         libudev-internal.la \
4404         libsystemd-internal.la \
4405         libsystemd-network.la \
4406         libsystemd-label.la \
4407         libsystemd-shared.la
4408
4409 rootlibexec_PROGRAMS += \
4410         systemd-networkd-wait-online
4411
4412 systemd_networkd_wait_online_CFLAGS = \
4413         $(AM_CFLAGS)
4414
4415 systemd_networkd_wait_online_SOURCES = \
4416         src/libsystemd-network/network-internal.h \
4417         src/network/networkd-wait-online.c \
4418         src/network/networkd-wait-online.h
4419
4420 systemd_networkd_wait_online_LDADD = \
4421         libsystemd-network.la \
4422         libudev-internal.la \
4423         libsystemd-internal.la \
4424         libsystemd-shared.la
4425
4426 test_network_SOURCES = \
4427         src/network/test-network.c
4428
4429 test_network_CFLAGS = \
4430         $(AM_CFLAGS)
4431
4432 test_network_LDADD = \
4433         libsystemd-networkd-core.la
4434
4435 tests += \
4436         test-network
4437
4438 nodist_systemunit_DATA += \
4439         units/systemd-networkd.service \
4440         units/systemd-networkd-wait-online.service
4441
4442 GENERAL_ALIASES += \
4443         $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \
4444         $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service
4445
4446 EXTRA_DIST += \
4447         src/network/networkd-network-gperf.gperf \
4448         src/network/networkd-netdev-gperf.gperf \
4449         units/systemd-networkd.service.in \
4450         units/systemd-networkd-wait-online.service.in
4451
4452 CLEANFILES += \
4453         src/network/networkd-network-gperf.c \
4454         src/network/networkd-netdev-gperf.c
4455 endif
4456
4457 # ------------------------------------------------------------------------------
4458 if ENABLE_LOGIND
4459 systemd_logind_SOURCES = \
4460         src/login/logind.c \
4461         src/login/logind.h
4462
4463 nodist_systemd_logind_SOURCES = \
4464         src/login/logind-gperf.c
4465
4466 systemd_logind_LDADD = \
4467         libsystemd-logind-core.la
4468
4469 libsystemd_logind_core_la_SOURCES = \
4470         src/login/logind-core.c \
4471         src/login/logind-device.c \
4472         src/login/logind-device.h \
4473         src/login/logind-button.c \
4474         src/login/logind-button.h \
4475         src/login/logind-action.c \
4476         src/login/logind-action.h \
4477         src/login/logind-seat.c \
4478         src/login/logind-seat.h \
4479         src/login/logind-session.c \
4480         src/login/logind-session.h \
4481         src/login/logind-session-device.c \
4482         src/login/logind-session-device.h \
4483         src/login/logind-user.c \
4484         src/login/logind-user.h \
4485         src/login/logind-inhibit.c \
4486         src/login/logind-inhibit.h \
4487         src/login/logind-dbus.c \
4488         src/login/logind-session-dbus.c \
4489         src/login/logind-seat-dbus.c \
4490         src/login/logind-user-dbus.c \
4491         src/login/logind-acl.h
4492
4493 libsystemd_logind_core_la_LIBADD = \
4494         libsystemd-label.la \
4495         libsystemd-capability.la \
4496         libsystemd-internal.la \
4497         libudev-internal.la \
4498         libsystemd-shared.la
4499
4500 if HAVE_ACL
4501 libsystemd_logind_core_la_SOURCES += \
4502         src/login/logind-acl.c
4503
4504 libsystemd_logind_core_la_LIBADD += \
4505         libsystemd-acl.la
4506 endif
4507
4508 noinst_LTLIBRARIES += \
4509         libsystemd-logind-core.la
4510
4511 systemd_user_sessions_SOURCES = \
4512         src/login/user-sessions.c
4513
4514 systemd_user_sessions_LDADD = \
4515         libsystemd-shared.la
4516
4517 rootlibexec_PROGRAMS += \
4518         systemd-logind \
4519         systemd-user-sessions
4520
4521 loginctl_SOURCES = \
4522         src/login/loginctl.c \
4523         src/login/sysfs-show.c
4524
4525 loginctl_LDADD = \
4526         libsystemd-internal.la \
4527         libudev-internal.la \
4528         libsystemd-shared.la
4529
4530 rootbin_PROGRAMS += \
4531         loginctl
4532
4533 dist_bashcompletion_DATA += \
4534         shell-completion/bash/loginctl
4535
4536 dist_zshcompletion_DATA += \
4537         shell-completion/zsh/_loginctl \
4538         shell-completion/zsh/_systemd-inhibit
4539
4540 systemd_inhibit_SOURCES = \
4541         src/login/inhibit.c
4542
4543 systemd_inhibit_LDADD = \
4544         libsystemd-internal.la \
4545         libsystemd-shared.la
4546
4547 rootbin_PROGRAMS += \
4548         systemd-inhibit
4549
4550 test_login_SOURCES = \
4551         src/libsystemd/sd-login/test-login.c
4552
4553 test_login_LDADD = \
4554         libsystemd-internal.la \
4555         libsystemd-shared.la
4556
4557 test_login_shared_SOURCES = \
4558         src/login/test-login-shared.c
4559
4560 test_login_shared_LDADD = \
4561         libsystemd-internal.la \
4562         libsystemd-shared.la
4563
4564 test_inhibit_SOURCES = \
4565         src/login/test-inhibit.c
4566
4567 test_inhibit_LDADD = \
4568         libsystemd-internal.la \
4569         libsystemd-shared.la
4570
4571 test_login_tables_SOURCES = \
4572         src/login/test-login-tables.c
4573
4574 test_login_tables_LDADD = \
4575         libsystemd-logind-core.la
4576
4577 manual_tests += \
4578         test-login \
4579         test-inhibit
4580
4581 tests += \
4582         test-login-tables \
4583         test-login-shared
4584
4585 if HAVE_PAM
4586 pam_systemd_la_SOURCES = \
4587         src/login/pam-module.c
4588
4589 pam_systemd_la_CFLAGS = \
4590         $(AM_CFLAGS) \
4591         $(PAM_CFLAGS) \
4592         -fvisibility=hidden
4593
4594 pam_systemd_la_LDFLAGS = \
4595         $(AM_LDFLAGS) \
4596         -module \
4597         -export-dynamic \
4598         -avoid-version \
4599         -shared \
4600         -export-symbols-regex '^pam_sm_.*'
4601
4602 pam_systemd_la_LIBADD = \
4603         libsystemd-capability.la \
4604         libsystemd-internal.la \
4605         libsystemd-shared.la \
4606         $(PAM_LIBS)
4607
4608 pamlib_LTLIBRARIES = \
4609         pam_systemd.la
4610
4611 dist_pamconf_DATA = \
4612         src/login/systemd-user
4613 endif
4614
4615 nodist_systemunit_DATA += \
4616         units/systemd-logind.service \
4617         units/systemd-user-sessions.service
4618
4619 dist_systemunit_DATA += \
4620         units/user.slice \
4621         units/org.freedesktop.login1.busname
4622
4623 dist_dbussystemservice_DATA += \
4624         src/login/org.freedesktop.login1.service
4625
4626 dist_dbuspolicy_DATA += \
4627         src/login/org.freedesktop.login1.conf
4628
4629 dist_pkgsysconf_DATA += \
4630         src/login/logind.conf
4631
4632 polkitpolicy_files += \
4633         src/login/org.freedesktop.login1.policy
4634
4635 INSTALL_DIRS += \
4636         $(systemdstatedir)
4637
4638 MULTI_USER_TARGET_WANTS += \
4639         systemd-logind.service \
4640         systemd-user-sessions.service
4641
4642 SYSTEM_UNIT_ALIASES += \
4643         systemd-logind.service dbus-org.freedesktop.login1.service
4644
4645 BUSNAMES_TARGET_WANTS += \
4646         org.freedesktop.login1.busname
4647
4648 if ENABLE_MULTI_SEAT_X
4649
4650 systemd_multi_seat_x_SOURCES = \
4651         src/login/multi-seat-x.c
4652
4653 systemd_multi_seat_x_LDADD = \
4654         libsystemd-label.la \
4655         libsystemd-shared.la
4656
4657 rootlibexec_PROGRAMS += \
4658         systemd-multi-seat-x
4659
4660 endif
4661
4662 dist_udevrules_DATA += \
4663         src/login/70-uaccess.rules \
4664         src/login/70-power-switch.rules
4665
4666 nodist_udevrules_DATA += \
4667         src/login/71-seat.rules \
4668         src/login/73-seat-late.rules
4669
4670 CLEANFILES += \
4671         src/login/logind-gperf.c \
4672         src/login/71-seat.rules \
4673         src/login/73-seat-late.rules
4674 endif
4675
4676 polkitpolicy_in_files += \
4677         src/login/org.freedesktop.login1.policy.in
4678
4679 EXTRA_DIST += \
4680         src/login/logind-gperf.gperf \
4681         src/login/71-seat.rules.in \
4682         src/login/73-seat-late.rules.in \
4683         units/systemd-logind.service.in \
4684         units/systemd-user-sessions.service.in
4685
4686 # ------------------------------------------------------------------------------
4687 if HAVE_PYTHON_DEVEL
4688 pkgpyexec_LTLIBRARIES = \
4689         _journal.la \
4690         id128.la \
4691         _daemon.la \
4692         _reader.la \
4693         login.la
4694
4695 _journal_la_SOURCES = \
4696         src/python-systemd/_journal.c
4697
4698 _journal_la_CFLAGS = \
4699         $(AM_CFLAGS) \
4700         -fvisibility=default \
4701         $(PYTHON_DEVEL_CFLAGS)
4702
4703 _journal_la_LDFLAGS = \
4704         $(AM_LDFLAGS) \
4705         -shared \
4706         -module \
4707         -avoid-version
4708
4709 _journal_la_LIBADD = \
4710         $(PYTHON_DEVEL_LIBS) \
4711         libsystemd.la
4712
4713 id128_la_SOURCES = \
4714         src/python-systemd/id128.c \
4715         src/python-systemd/id128-constants.h \
4716         src/python-systemd/pyutil.c \
4717         src/python-systemd/pyutil.h
4718
4719 id128_la_CFLAGS = \
4720         $(AM_CFLAGS) \
4721         -fvisibility=default \
4722         $(PYTHON_DEVEL_CFLAGS) \
4723         -I$(top_builddir)/src/python-systemd
4724
4725 id128_la_LDFLAGS = \
4726         $(AM_LDFLAGS) \
4727         -shared \
4728         -module \
4729         -avoid-version
4730
4731 id128_la_LIBADD = \
4732         $(PYTHON_DEVEL_LIBS) \
4733         libsystemd-shared.la \
4734         libsystemd.la
4735
4736 _daemon_la_SOURCES = \
4737         src/python-systemd/_daemon.c \
4738         src/python-systemd/pyutil.c \
4739         src/python-systemd/pyutil.h
4740
4741 _daemon_la_CFLAGS = \
4742         $(AM_CFLAGS) \
4743         -fvisibility=default \
4744         $(PYTHON_DEVEL_CFLAGS) \
4745         -I$(top_builddir)/src/python-systemd
4746
4747 _daemon_la_LDFLAGS = \
4748         $(AM_LDFLAGS) \
4749         -shared \
4750         -module \
4751         -avoid-version
4752
4753 _daemon_la_LIBADD = \
4754         $(PYTHON_DEVEL_LIBS) \
4755         libsystemd-shared.la \
4756         libsystemd.la
4757
4758 _reader_la_SOURCES = \
4759         src/python-systemd/_reader.c \
4760         src/python-systemd/pyutil.c \
4761         src/python-systemd/pyutil.h
4762
4763 _reader_la_CFLAGS = \
4764         $(AM_CFLAGS) \
4765         -fvisibility=default \
4766         $(PYTHON_DEVEL_CFLAGS)
4767
4768 _reader_la_LDFLAGS = \
4769         $(AM_LDFLAGS) \
4770         -shared \
4771         -module \
4772         -avoid-version
4773
4774 _reader_la_LIBADD = \
4775         $(PYTHON_DEVEL_LIBS) \
4776         libsystemd-shared.la \
4777         libsystemd.la
4778
4779 login_la_SOURCES = \
4780         src/python-systemd/login.c \
4781         src/python-systemd/pyutil.c \
4782         src/python-systemd/pyutil.h
4783
4784 login_la_CFLAGS = \
4785         $(AM_CFLAGS) \
4786         -fvisibility=default \
4787         $(PYTHON_DEVEL_CFLAGS)
4788
4789 login_la_LDFLAGS = \
4790         $(AM_LDFLAGS) \
4791         -shared \
4792         -module \
4793         -avoid-version
4794
4795 login_la_LIBADD = \
4796         $(PYTHON_DEVEL_LIBS) \
4797         libsystemd-shared.la \
4798         libsystemd.la
4799
4800 dist_pkgpyexec_PYTHON = \
4801         src/python-systemd/journal.py \
4802         src/python-systemd/daemon.py \
4803         src/python-systemd/__init__.py
4804
4805 src/python-systemd/id128-constants.h: src/systemd/sd-messages.h
4806         $(AM_V_at)$(MKDIR_P) $(dir $@)
4807         $(AM_V_GEN)$(SED) -n -r 's/,//g; s/#define (SD_MESSAGE_[A-Z0-9_]+)\s.*/add_id(m, "\1", \1) JOINER/p' <$< >$@
4808
4809 BUILT_SOURCES += \
4810         src/python-systemd/id128-constants.h
4811
4812 SPHINXOPTS = -D version=$(VERSION) -D release=$(VERSION)
4813 sphinx-%:
4814         $(AM_V_at)test -n "$(SPHINX_BUILD)" || { echo " *** sphinx-build is not available"; exit 1; }
4815         $(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/
4816         $(AM_V_at)echo Output has been generated in $(abs_top_builddir)/docs/html/python-systemd/
4817
4818 python-shell:
4819         $(AM_V_at)echo "Starting python with $(DESTDIR)$(pyexecdir)"
4820         $(AM_V_at)PYTHONPATH=$(DESTDIR)$(pyexecdir) LD_LIBRARY_PATH=$(DESTDIR)$(libdir) $(PYTHON)
4821
4822 destdir-sphinx: all
4823         dir="$$(mktemp -d /tmp/systemd-install.XXXXXX)" && \
4824                 $(MAKE) DESTDIR="$$dir" install && \
4825                 $(MAKE) DESTDIR="$$dir" sphinx-html && \
4826                 rm -rf "$$dir"
4827
4828 endif
4829
4830 CLEAN_LOCAL_HOOKS += clean-sphinx
4831
4832 .PHONY: python-shell destdir-sphinx clean-sphinx clean-python
4833
4834 clean-sphinx:
4835         -rm -rf docs/html/python-systemd/
4836
4837 # Remove Python stuff, e.g. to force rebuilding for a different Python version.
4838 clean-python:
4839         -rm -rf src/python-systemd/.libs src/python-systemd/*.l[ao]
4840         -rm -f _daemon.la id128.la _journal.la login.la _reader.la
4841
4842 # ------------------------------------------------------------------------------
4843 if ENABLE_COMPAT_LIBS
4844 EXTRA_DIST += \
4845         src/compat-libs/linkwarning.h
4846
4847 libsystemd-%.c: src/compat-libs/libsystemd-%.sym
4848         $(AM_V_at)$(MKDIR_P) $(dir $@)
4849         $(AM_V_GEN)sed -r -n 's/^ +(sd_.*);/obsolete_lib(\1,$(notdir $(basename $<)));/p' <$< >$@
4850
4851 BUILT_SOURCES += \
4852         libsystemd-journal.c \
4853         libsystemd-login.c \
4854         libsystemd-id128.c \
4855         libsystemd-daemon.c
4856
4857 libsystemd_journal_la_SOURCES = \
4858         libsystemd-journal.c \
4859         src/compat-libs/libsystemd-journal.sym
4860
4861 libsystemd_journal_la_CPPFLAGS = \
4862         $(AM_CFLAGS) \
4863         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4864
4865 libsystemd_journal_la_LDFLAGS = \
4866         $(AM_LDFLAGS) \
4867         -version-info $(LIBSYSTEMD_JOURNAL_CURRENT):$(LIBSYSTEMD_JOURNAL_REVISION):$(LIBSYSTEMD_JOURNAL_AGE) \
4868         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-journal.sym
4869
4870 libsystemd_journal_la_LIBADD = \
4871         libsystemd-journal-internal.la \
4872         libsystemd-internal.la \
4873         libsystemd-shared.la
4874
4875 libsystemd_login_la_SOURCES = \
4876         libsystemd-login.c \
4877         src/compat-libs/libsystemd-login.sym
4878
4879 libsystemd_login_la_CPPFLAGS = \
4880         $(AM_CFLAGS) \
4881         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4882
4883 libsystemd_login_la_LDFLAGS = \
4884         $(AM_LDFLAGS) \
4885         -version-info $(LIBSYSTEMD_LOGIN_CURRENT):$(LIBSYSTEMD_LOGIN_REVISION):$(LIBSYSTEMD_LOGIN_AGE) \
4886         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-login.sym
4887
4888 libsystemd_login_la_LIBADD = \
4889         libsystemd-internal.la \
4890         libsystemd-shared.la
4891
4892 libsystemd_id128_la_SOURCES = \
4893         libsystemd-id128.c \
4894         src/compat-libs/libsystemd-id128.sym
4895
4896 libsystemd_id128_la_CPPFLAGS = \
4897         $(AM_CFLAGS) \
4898         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4899
4900 libsystemd_id128_la_LDFLAGS = \
4901         $(AM_LDFLAGS) \
4902         -version-info $(LIBSYSTEMD_ID128_CURRENT):$(LIBSYSTEMD_ID128_REVISION):$(LIBSYSTEMD_ID128_AGE) \
4903         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-id128.sym
4904
4905 libsystemd_id128_la_LIBADD = \
4906         libsystemd-internal.la \
4907         libsystemd-shared.la
4908
4909 libsystemd_daemon_la_SOURCES = \
4910         libsystemd-daemon.c \
4911         src/compat-libs/libsystemd-daemon.sym
4912
4913 libsystemd_daemon_la_CPPFLAGS = \
4914         $(AM_CFLAGS) \
4915         -imacros$(top_srcdir)/src/compat-libs/linkwarning.h
4916
4917 libsystemd_daemon_la_LDFLAGS = \
4918         $(AM_LDFLAGS) \
4919         -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \
4920         -Wl,--version-script=$(top_srcdir)/src/compat-libs/libsystemd-daemon.sym
4921
4922 libsystemd_daemon_la_LIBADD = \
4923         libsystemd-internal.la \
4924         libsystemd-shared.la
4925
4926 lib_LTLIBRARIES += \
4927         libsystemd-journal.la \
4928         libsystemd-login.la \
4929         libsystemd-id128.la \
4930         libsystemd-daemon.la
4931
4932 pkgconfiglib_DATA += \
4933         src/compat-libs/libsystemd-journal.pc \
4934         src/compat-libs/libsystemd-login.pc \
4935         src/compat-libs/libsystemd-id128.pc \
4936         src/compat-libs/libsystemd-daemon.pc
4937
4938 # move lib from $(libdir) to $(rootlibdir) and update devel link, if needed
4939 compat-lib-install-hook:
4940         libname=libsystemd-login.so && $(move-to-rootlibdir)
4941         libname=libsystemd-journal.so && $(move-to-rootlibdir)
4942         libname=libsystemd-id128.so && $(move-to-rootlibdir)
4943         libname=libsystemd-daemon.so && $(move-to-rootlibdir)
4944
4945 compat-lib-uninstall-hook:
4946         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-login.so*
4947         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-journal.so*
4948         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-id128.so*
4949         rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so*
4950
4951 INSTALL_EXEC_HOOKS += compat-lib-install-hook
4952 UNINSTALL_EXEC_HOOKS += compat-lib-uninstall-hook
4953 endif
4954
4955 EXTRA_DIST += \
4956         src/compat-libs/libsystemd-journal.pc.in \
4957         src/compat-libs/libsystemd-login.pc.in \
4958         src/compat-libs/libsystemd-id128.pc.in \
4959         src/compat-libs/libsystemd-daemon.pc.in
4960
4961 # ------------------------------------------------------------------------------
4962 substitutions = \
4963        '|rootlibexecdir=$(rootlibexecdir)|' \
4964        '|rootbindir=$(rootbindir)|' \
4965        '|bindir=$(bindir)|' \
4966        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
4967        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
4968        '|pkgsysconfdir=$(pkgsysconfdir)|' \
4969        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
4970        '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
4971        '|pkgdatadir=$(pkgdatadir)|' \
4972        '|systemunitdir=$(systemunitdir)|' \
4973        '|userunitdir=$(userunitdir)|' \
4974        '|systempresetdir=$(systempresetdir)|' \
4975        '|userpresetdir=$(userpresetdir)|' \
4976        '|udevhwdbdir=$(udevhwdbdir)|' \
4977        '|udevrulesdir=$(udevrulesdir)|' \
4978        '|catalogdir=$(catalogdir)|' \
4979        '|tmpfilesdir=$(tmpfilesdir)|' \
4980        '|sysusersdir=$(sysusersdir)|' \
4981        '|sysctldir=$(sysctldir)|' \
4982        '|systemgeneratordir=$(systemgeneratordir)|' \
4983        '|usergeneratordir=$(usergeneratordir)|' \
4984        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
4985        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
4986        '|PACKAGE_URL=$(PACKAGE_URL)|' \
4987        '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
4988        '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
4989        '|prefix=$(prefix)|' \
4990        '|exec_prefix=$(exec_prefix)|' \
4991        '|libdir=$(libdir)|' \
4992        '|includedir=$(includedir)|' \
4993        '|VERSION=$(VERSION)|' \
4994        '|rootprefix=$(rootprefix)|' \
4995        '|udevlibexecdir=$(udevlibexecdir)|' \
4996        '|SUSHELL=$(SUSHELL)|' \
4997        '|DEBUGTTY=$(DEBUGTTY)|' \
4998        '|KILL=$(KILL)|' \
4999        '|KMOD=$(KMOD)|' \
5000        '|MKDIR_P=$(MKDIR_P)|' \
5001        '|QUOTAON=$(QUOTAON)|' \
5002        '|QUOTACHECK=$(QUOTACHECK)|' \
5003        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
5004        '|VARLOGDIR=$(varlogdir)|' \
5005        '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
5006        '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
5007        '|PYTHON=$(PYTHON)|' \
5008        '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
5009        '|NTP_SERVERS=$(NTP_SERVERS)|' \
5010        '|DNS_SERVERS=$(DNS_SERVERS)|' \
5011        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
5012        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
5013        '|TTY_GID=$(TTY_GID)|'
5014
5015 SED_PROCESS = \
5016         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
5017         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
5018                 < $< > $@
5019
5020 units/%: units/%.in
5021         $(SED_PROCESS)
5022
5023 man/%: man/%.in
5024         $(SED_PROCESS)
5025
5026 sysctl.d/%: sysctl.d/%.in
5027         $(SED_PROCESS)
5028
5029 %.pc: %.pc.in
5030         $(SED_PROCESS)
5031
5032 src/core/macros.%: src/core/macros.%.in
5033         $(SED_PROCESS)
5034
5035 src/%.policy.in: src/%.policy.in.in
5036         $(SED_PROCESS)
5037
5038 %.rules: %.rules.in
5039         $(SED_PROCESS)
5040
5041 %.conf: %.conf.in
5042         $(SED_PROCESS)
5043
5044 %.sh: %.sh.in
5045         $(SED_PROCESS)
5046         $(AM_V_GEN)chmod +x $@
5047
5048 src/%.c: src/%.gperf
5049         $(AM_V_at)$(MKDIR_P) $(dir $@)
5050         $(AM_V_GPERF)$(GPERF) < $< > $@
5051
5052 src/%: src/%.m4
5053         $(AM_V_at)$(MKDIR_P) $(dir $@)
5054         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
5055
5056 units/%: units/%.m4
5057         $(AM_V_at)$(MKDIR_P) $(dir $@)
5058         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
5059
5060 units/user/%: units/%.m4
5061         $(AM_V_at)$(MKDIR_P) $(dir $@)
5062         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
5063
5064 if ENABLE_POLKIT
5065 nodist_polkitpolicy_DATA = \
5066         $(polkitpolicy_files) \
5067         $(polkitpolicy_in_in_files:.policy.in.in=.policy)
5068 endif
5069
5070 EXTRA_DIST += \
5071         $(polkitpolicy_in_files) \
5072         $(polkitpolicy_in_in_files)
5073
5074 CLEANFILES += \
5075         $(nodist_systemunit_DATA) \
5076         $(nodist_userunit_DATA) \
5077         $(pkgconfigdata_DATA) \
5078         $(pkgconfiglib_DATA) \
5079         $(nodist_polkitpolicy_DATA)
5080
5081 # ------------------------------------------------------------------------------
5082 if ENABLE_MANPAGES
5083 man/custom-entities.ent: configure.ac
5084         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
5085         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
5086          printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
5087          > $@ # '
5088
5089 DISTCLEANFILES += \
5090         man/custom-entities.ent
5091
5092 XSLTPROC_FLAGS = \
5093         --nonet \
5094         --xinclude \
5095         --stringparam man.output.quietly 1 \
5096         --stringparam funcsynopsis.style ansi \
5097         --stringparam man.authors.section.enabled 0 \
5098         --stringparam man.copyright.section.enabled 0 \
5099         --stringparam systemd.version $(VERSION) \
5100         --path '$(builddir)/man:$(srcdir)/man'
5101
5102 XSLTPROC_PROCESS_MAN = \
5103         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
5104
5105 XSLTPROC_PROCESS_HTML = \
5106         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
5107
5108 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
5109         $(XSLTPROC_PROCESS_MAN)
5110
5111 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
5112         $(XSLTPROC_PROCESS_MAN)
5113
5114 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
5115         $(XSLTPROC_PROCESS_MAN)
5116
5117 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
5118         $(XSLTPROC_PROCESS_MAN)
5119
5120 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
5121         $(XSLTPROC_PROCESS_MAN)
5122
5123 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
5124         $(XSLTPROC_PROCESS_HTML)
5125
5126 define html-alias
5127         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
5128 endef
5129
5130 endif
5131
5132 EXTRA_DIST += \
5133         man/custom-html.xsl \
5134         man/custom-man.xsl
5135
5136 # ------------------------------------------------------------------------------
5137 if HAVE_SYSV_COMPAT
5138 sysvinit_DATA = \
5139         docs/sysvinit/README
5140
5141 varlog_DATA = \
5142         docs/var-log/README
5143
5144 docs/sysvinit/README: docs/sysvinit/README.in
5145         $(SED_PROCESS)
5146
5147 docs/var-log/README: docs/var-log/README.in
5148         $(SED_PROCESS)
5149
5150 CLEANFILES += \
5151         docs/sysvinit/README \
5152         docs/var-log/README
5153 endif
5154
5155 EXTRA_DIST += \
5156         docs/sysvinit/README.in \
5157         docs/var-log/README.in
5158
5159 SOCKETS_TARGET_WANTS += \
5160         systemd-initctl.socket \
5161         systemd-shutdownd.socket
5162
5163 if HAVE_SYSV_COMPAT
5164 RUNLEVEL1_TARGET_WANTS += \
5165         systemd-update-utmp-runlevel.service
5166 RUNLEVEL2_TARGET_WANTS += \
5167         systemd-update-utmp-runlevel.service
5168 RUNLEVEL3_TARGET_WANTS += \
5169         systemd-update-utmp-runlevel.service
5170 RUNLEVEL4_TARGET_WANTS += \
5171         systemd-update-utmp-runlevel.service
5172 RUNLEVEL5_TARGET_WANTS += \
5173         systemd-update-utmp-runlevel.service
5174 endif
5175
5176 SYSINIT_TARGET_WANTS += \
5177         systemd-update-utmp.service \
5178         systemd-update-done.service \
5179         ldconfig.service
5180
5181 LOCAL_FS_TARGET_WANTS += \
5182         systemd-remount-fs.service \
5183         tmp.mount
5184
5185 MULTI_USER_TARGET_WANTS += \
5186         getty.target \
5187         systemd-ask-password-wall.path
5188
5189 SYSINIT_TARGET_WANTS += \
5190         dev-hugepages.mount \
5191         dev-mqueue.mount \
5192         sys-kernel-config.mount \
5193         sys-kernel-debug.mount \
5194         sys-fs-fuse-connections.mount \
5195         systemd-sysctl.service \
5196         systemd-ask-password-console.path
5197
5198 if HAVE_SYSV_COMPAT
5199 SYSTEM_UNIT_ALIASES += \
5200         poweroff.target runlevel0.target \
5201         rescue.target runlevel1.target \
5202         multi-user.target runlevel2.target \
5203         multi-user.target runlevel3.target \
5204         multi-user.target runlevel4.target \
5205         graphical.target runlevel5.target \
5206         reboot.target runlevel6.target
5207 endif
5208
5209 SYSTEM_UNIT_ALIASES += \
5210         graphical.target default.target \
5211         reboot.target ctrl-alt-del.target \
5212         getty@.service autovt@.service
5213
5214 USER_UNIT_ALIASES += \
5215         $(systemunitdir)/shutdown.target shutdown.target \
5216         $(systemunitdir)/sockets.target sockets.target \
5217         $(systemunitdir)/busnames.target busnames.target \
5218         $(systemunitdir)/timers.target timers.target \
5219         $(systemunitdir)/paths.target paths.target \
5220         $(systemunitdir)/bluetooth.target bluetooth.target \
5221         $(systemunitdir)/printer.target printer.target \
5222         $(systemunitdir)/sound.target sound.target \
5223         $(systemunitdir)/smartcard.target smartcard.target
5224
5225 GENERAL_ALIASES += \
5226         $(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
5227         $(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \
5228         $(pkgsysconfdir)/user $(sysconfdir)/xdg/systemd/user \
5229         $(dbussystemservicedir)/org.freedesktop.systemd1.service $(dbussessionservicedir)/org.freedesktop.systemd1.service
5230
5231 if HAVE_SYSV_COMPAT
5232 INSTALL_DIRS += \
5233         $(systemunitdir)/runlevel1.target.wants \
5234         $(systemunitdir)/runlevel2.target.wants \
5235         $(systemunitdir)/runlevel3.target.wants \
5236         $(systemunitdir)/runlevel4.target.wants \
5237         $(systemunitdir)/runlevel5.target.wants
5238 endif
5239
5240 INSTALL_DIRS += \
5241         $(prefix)/lib/modules-load.d \
5242         $(sysconfdir)/modules-load.d \
5243         $(prefix)/lib/systemd/network \
5244         $(sysconfdir)/systemd/network \
5245         $(prefix)/lib/sysctl.d \
5246         $(sysconfdir)/sysctl.d \
5247         $(prefix)/lib/kernel/install.d \
5248         $(sysconfdir)/kernel/install.d \
5249         $(systemshutdowndir) \
5250         $(systemsleepdir) \
5251         $(systemgeneratordir) \
5252         $(usergeneratordir) \
5253         \
5254         $(userunitdir) \
5255         $(pkgsysconfdir)/system \
5256         $(pkgsysconfdir)/system/multi-user.target.wants \
5257         $(pkgsysconfdir)/system/getty.target.wants \
5258         $(pkgsysconfdir)/user \
5259         $(dbussessionservicedir) \
5260         $(sysconfdir)/xdg/systemd
5261
5262 install-exec-hook: $(INSTALL_EXEC_HOOKS)
5263
5264 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
5265
5266 install-data-hook: $(INSTALL_DATA_HOOKS)
5267
5268 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
5269
5270 clean-local: $(CLEAN_LOCAL_HOOKS)
5271         rm -rf $(abs_srcdir)/install-tree
5272         rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
5273               $(abs_srcdir)/hwdb/iab.txt
5274
5275 DISTCHECK_CONFIGURE_FLAGS = \
5276         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
5277         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
5278         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
5279         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
5280         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
5281         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
5282         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
5283         --with-rootprefix=$$dc_install_base \
5284         --disable-split-usr \
5285         --enable-kdbus \
5286         --enable-compat-libs
5287
5288 if HAVE_SYSV_COMPAT
5289 DISTCHECK_CONFIGURE_FLAGS += \
5290         --with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
5291         --with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
5292 else
5293 DISTCHECK_CONFIGURE_FLAGS += \
5294         --with-sysvinit-path= \
5295         --with-sysvrcnd-path=
5296 endif
5297
5298 if ENABLE_GTK_DOC
5299 DISTCHECK_CONFIGURE_FLAGS += \
5300         --enable-gtk-doc
5301 endif
5302
5303 # check "broken" platforms limited toolchains for link breakage before we release
5304 .PHONY: linkcheck
5305 linkcheck:
5306         $(MAKE) CFLAGS='-fno-lto' LDFLAGS='-Wl,-fuse-ld=gold -Wl,--as-needed -Wl,--no-gc-sections' distcheck
5307
5308 .PHONY: hwdb-update
5309 hwdb-update:
5310         ( cd $(top_srcdir)/hwdb && \
5311         wget -N http://www.linux-usb.org/usb.ids \
5312                 http://pci-ids.ucw.cz/v2.2/pci.ids \
5313                 http://standards.ieee.org/develop/regauth/oui/oui.txt \
5314                 http://standards.ieee.org/develop/regauth/iab/iab.txt && \
5315         ./ids-update.pl )
5316
5317 .PHONY: kdbus-update
5318 kdbus-update:
5319         ( cd $(top_srcdir)/src/libsystemd/sd-bus/ && \
5320         wget -N https://d-bus.googlecode.com/git/kdbus.h )
5321
5322 .PHONY: git-tag
5323 git-tag:
5324         git tag -s "v$(VERSION)" -m "systemd $(VERSION)"
5325
5326 www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
5327 .PHONY: upload
5328 upload: all check dist
5329         scp systemd-$(VERSION).tar.xz $(www_target)
5330
5331 .PHONY: doc-sync
5332 doc-sync: all destdir-sphinx
5333         gtkdoc-rebase --html-dir=docs/libudev/html --online
5334         rsync -rlv --delete docs/libudev/html/ --omit-dir-times $(www_target)/libudev/
5335         gtkdoc-rebase --html-dir=docs/gudev/html --online
5336         rsync -rlv --delete docs/gudev/html/ --omit-dir-times $(www_target)/gudev/
5337         rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
5338         rsync -rlv --delete --omit-dir-times docs/html/python-systemd/ $(www_target)/python-systemd/
5339
5340 .PHONY: tango
5341 tango: upload
5342         cp -v systemd-$(VERSION).tar.xz /home/lennart/git.fedora/systemd/
5343         scp man/*.html tango:public/systemd-man/
5344
5345 .PHONY: install-tree
5346 install-tree: all
5347         rm -rf $(abs_srcdir)/install-tree
5348         $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
5349         tree $(abs_srcdir)/install-tree
5350
5351 # Let's run all tests of the test suite, but under valgrind. Let's
5352 # exclude the one perl script we have in there
5353 .PHONY: valgrind-tests
5354 valgrind-tests: $(TESTS)
5355         $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
5356                 if file $$f | grep -q shell; then \
5357                 echo -e "$${x}Skipping non-binary $$f"; else \
5358                 echo -e "$${x}Running $$f"; \
5359                 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
5360                 x="\n\n"; \
5361         done
5362
5363 exported-%: %
5364         $(AM_V_GEN)nm -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
5365
5366 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
5367         $(AM_V_GEN)cat $^ > $@
5368
5369 .PHONY: check-api-docs
5370 check-api-docs: exported man
5371         $(AM_V_GEN)for symbol in `cat exported` ; do \
5372                 if test -f $(builddir)/man/$$symbol.html ; then \
5373                         echo "  Symbol $$symbol() is documented." ; \
5374                 else \
5375                         echo "‣ Symbol $$symbol() lacks documentation." ; \
5376                 fi ; \
5377         done
5378
5379 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
5380 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
5381
5382 undefined defined: $(ALL_OBJECTS)
5383         $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
5384                 nm -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
5385         done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
5386
5387 CLEANFILES += \
5388         defined \
5389         undefined
5390
5391 .PHONY: check-api-unused
5392 check-api-unused: defined undefined exported
5393         ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
5394
5395 .PHONY: check-includes
5396 check-includes: $(top_srcdir)/tools/check-includes.pl
5397         $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
5398                 | xargs $(top_srcdir)/tools/check-includes.pl
5399
5400 EXTRA_DIST += \
5401         $(top_srcdir)/tools/check-includes.pl
5402
5403 # Stupid test that everything purported to be exported really is
5404 define generate-sym-test
5405         $(AM_V_at)$(MKDIR_P) $(dir $@)
5406         $(AM_V_at)printf '#include <stdio.h>\n' > $@
5407         $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
5408         $(AM_V_at)printf 'void* functions[] = {\n' >> $@
5409         $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
5410         $(AM_V_at)printf '};\nint main(void) {\n' >> $@
5411         $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
5412         $(AM_V_at)printf 'return 0; }\n' >> $@
5413 endef
5414
5415 test-libsystemd-sym.c: \
5416                 $(top_builddir)/src/libsystemd/libsystemd.sym \
5417                 src/systemd/sd-journal.h \
5418                 src/systemd/sd-daemon.h \
5419                 src/systemd/sd-login.h \
5420                 src/systemd/sd-bus.h \
5421                 src/systemd/sd-utf8.h \
5422                 src/systemd/sd-resolve.h
5423         $(generate-sym-test)
5424
5425 test-libudev-sym.c: \
5426                 src/libudev/libudev.sym \
5427                 src/udev/udev.h
5428         $(generate-sym-test)
5429
5430 test_libsystemd_sym_SOURCES = \
5431         test-libsystemd-sym.c
5432 test_libsystemd_sym_LDADD = \
5433         libsystemd.la
5434
5435 test_libudev_sym_SOURCES = \
5436         test-libudev-sym.c
5437 test_libudev_sym_CFLAGS = \
5438         $(AM_CFLAGS) \
5439         -Wno-deprecated-declarations
5440 test_libudev_sym_LDADD = \
5441         libudev.la
5442
5443 BUILT_SOURCES += \
5444         $(test_libsystemd_sym_SOURCES) \
5445         $(test_libudev_sym_SOURCES)
5446
5447 tests += \
5448         test-libsystemd-sym \
5449         test-libudev-sym
5450
5451 .PHONY: cppcheck
5452 cppcheck:
5453         cppcheck --enable=all -q $(top_srcdir)
5454
5455 # Used to extract compile flags for YCM.
5456 print-%:
5457         @echo $($*)
5458
5459 git-contrib:
5460         @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u