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