chiark / gitweb /
Compiling.
[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 GCC_COLORS ?= 'ooh, shiny!'
28 export GCC_COLORS
29
30 SUBDIRS = . po
31
32 # remove targets if the command fails
33 .DELETE_ON_ERROR:
34
35 # keep intermediate files
36 .SECONDARY:
37
38 # Keep the test-suite.log
39 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
40
41 LIBSYSTEMD_CURRENT=6
42 LIBSYSTEMD_REVISION=0
43 LIBSYSTEMD_AGE=6
44
45 # The following four libraries only exist for compatibility reasons,
46 # their version info should not be bumped anymore
47 LIBSYSTEMD_LOGIN_CURRENT=9
48 LIBSYSTEMD_LOGIN_REVISION=3
49 LIBSYSTEMD_LOGIN_AGE=9
50
51 LIBSYSTEMD_DAEMON_CURRENT=0
52 LIBSYSTEMD_DAEMON_REVISION=12
53 LIBSYSTEMD_DAEMON_AGE=0
54
55 LIBSYSTEMD_ID128_CURRENT=0
56 LIBSYSTEMD_ID128_REVISION=28
57 LIBSYSTEMD_ID128_AGE=0
58
59 LIBSYSTEMD_JOURNAL_CURRENT=11
60 LIBSYSTEMD_JOURNAL_REVISION=5
61 LIBSYSTEMD_JOURNAL_AGE=11
62
63 # Dirs of external packages
64 dbuspolicydir=@dbuspolicydir@
65 dbussessionservicedir=@dbussessionservicedir@
66 dbussystemservicedir=@dbussystemservicedir@
67 pamlibdir=@pamlibdir@
68 pamconfdir=@pamconfdir@
69 pkgconfiglibdir=$(libdir)/pkgconfig
70 polkitpolicydir=$(datadir)/polkit-1/actions
71 bashcompletiondir=@bashcompletiondir@
72 zshcompletiondir=@zshcompletiondir@
73 varlogdir=$(localstatedir)/log
74 systemdstatedir=$(localstatedir)/lib/systemd
75 catalogstatedir=$(systemdstatedir)/catalog
76 xinitrcdir=$(sysconfdir)/X11/xinit/xinitrc.d
77
78 # Our own, non-special dirs
79 pkgsysconfdir=$(sysconfdir)/systemd
80 userunitdir=$(prefix)/lib/systemd/user
81 userpresetdir=$(prefix)/lib/systemd/user-preset
82 tmpfilesdir=$(prefix)/lib/tmpfiles.d
83 sysusersdir=$(prefix)/lib/sysusers.d
84 sysctldir=$(prefix)/lib/sysctl.d
85 binfmtdir=$(prefix)/lib/binfmt.d
86 modulesloaddir=$(prefix)/lib/modules-load.d
87 networkdir=$(rootprefix)/lib/systemd/network
88 pkgincludedir=$(includedir)/systemd
89 systemgeneratordir=$(rootlibexecdir)/system-generators
90 usergeneratordir=$(prefix)/lib/systemd/user-generators
91 systemshutdowndir=$(rootlibexecdir)/system-shutdown
92 systemsleepdir=$(rootlibexecdir)/system-sleep
93 systemunitdir=$(rootprefix)/lib/systemd/system
94 systempresetdir=$(rootprefix)/lib/systemd/system-preset
95 udevrulesdir=$(rootprefix)/lib/udev/rules.d
96 catalogdir=$(prefix)/lib/systemd/catalog
97 kernelinstalldir = $(prefix)/lib/kernel/install.d
98 factory_etcdir = $(prefix)/share/factory/etc
99 factory_pamdir = $(prefix)/share/factory/etc/pam.d
100 bootlibdir = $(prefix)/lib/systemd/boot/efi
101
102 # And these are the special ones for /
103 rootprefix=@rootprefix@
104 rootbindir=$(rootprefix)/bin
105 rootlibexecdir=$(rootprefix)/lib/systemd
106
107 EXTRA_DIST =
108 BUILT_SOURCES =
109 INSTALL_EXEC_HOOKS =
110 UNINSTALL_EXEC_HOOKS =
111 INSTALL_DATA_HOOKS =
112 UNINSTALL_DATA_HOOKS =
113 DISTCLEAN_LOCAL_HOOKS =
114 CLEAN_LOCAL_HOOKS =
115 pkginclude_HEADERS =
116 noinst_LTLIBRARIES =
117 lib_LTLIBRARIES =
118 include_HEADERS =
119 noinst_DATA =
120 pkgconfiglib_DATA =
121 polkitpolicy_in_in_files =
122 polkitpolicy_in_files =
123 polkitpolicy_files =
124 dist_pkgsysconf_DATA =
125 nodist_pkgsysconf_DATA =
126 dist_pkgdata_DATA =
127 dist_dbuspolicy_DATA =
128 dist_dbussystemservice_DATA =
129 dist_systemunit_DATA_busnames =
130 dist_sysusers_DATA =
131 check_PROGRAMS =
132 check_DATA =
133 tests=
134 manual_tests =
135 TEST_EXTENSIONS = .py
136 PY_LOG_COMPILER = $(PYTHON)
137 if ENABLE_TESTS
138 noinst_PROGRAMS = $(manual_tests) $(tests)
139 TESTS = $(tests)
140 else
141 noinst_PROGRAMS =
142 TESTS =
143 endif
144
145 in_files = $(filter %.in,$(EXTRA_DIST))
146 in_in_files = $(filter %.in.in, $(in_files))
147 m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
148
149 CLEANFILES = $(BUILT_SOURCES) \
150         $(pkgconfiglib_DATA) \
151         $(in_files:.in=) $(in_in_files:.in.in=) \
152         $(m4_files:.m4=)
153
154 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
155         $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
156         $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
157
158 # FIXME a different pkttyagent path...
159
160 AM_CPPFLAGS = \
161         -include $(top_builddir)/config.h \
162         -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
163         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
164         -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
165         -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
166         -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
167         -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
168         -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
169         -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
170         -DCERTIFICATE_ROOT=\"$(CERTIFICATEROOT)\" \
171         -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
172         -DROOTPREFIX=\"$(rootprefix)\" \
173         -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\" \
174         -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\" \
175         -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
176         -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
177         -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
178         -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
179         -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
180         -DSYSTEMD_LANGUAGE_FALLBACK_MAP=\"$(pkgdatadir)/language-fallback-map\" \
181         -DX_SERVER=\"$(bindir)/X\" \
182         -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
183         -DQUOTACHECK=\"$(QUOTACHECK)\" \
184         -DKEXEC=\"$(KEXEC)\" \
185         -DLIBDIR=\"$(libdir)\" \
186         -DROOTLIBDIR=\"$(rootlibdir)\" \
187         -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
188         -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
189         -I $(top_srcdir)/src \
190         -I $(top_builddir)/src/shared \
191         -I $(top_srcdir)/src/shared \
192         -I $(top_srcdir)/src/login \
193         -I $(top_srcdir)/src/systemd \
194         -I $(top_builddir)/src/core \
195         -I $(top_srcdir)/src/core \
196         -I $(top_srcdir)/src/libsystemd/sd-bus \
197         -I $(top_srcdir)/src/libsystemd/sd-event \
198         -I $(top_srcdir)/src/libsystemd/sd-device \
199         $(UDEV_CFLAGS) \
200         $(OUR_CPPFLAGS)
201
202 AM_CFLAGS = $(OUR_CFLAGS)
203 AM_LDFLAGS = $(OUR_LDFLAGS)
204
205 # ------------------------------------------------------------------------------
206 define move-to-rootlibdir
207         if test "$(libdir)" != "$(rootlibdir)"; then \
208                 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
209                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
210                 rm -f $(DESTDIR)$(libdir)/$$libname && \
211                 $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
212                 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
213         fi
214 endef
215
216 INSTALL_DIRS =
217
218 SHUTDOWN_TARGET_WANTS =
219 LOCAL_FS_TARGET_WANTS =
220 MULTI_USER_TARGET_WANTS =
221 GRAPHICAL_TARGET_WANTS =
222 RESCUE_TARGET_WANTS =
223 SYSINIT_TARGET_WANTS =
224 SOCKETS_TARGET_WANTS =
225 BUSNAMES_TARGET_WANTS =
226 TIMERS_TARGET_WANTS =
227 USER_SOCKETS_TARGET_WANTS =
228 USER_DEFAULT_TARGET_WANTS =
229 USER_BUSNAMES_TARGET_WANTS =
230
231 SYSTEM_UNIT_ALIASES =
232 USER_UNIT_ALIASES =
233 GENERAL_ALIASES =
234
235 install-target-wants-hook:
236         what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && dir=$(systemunitdir) && $(add-wants)
237         what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && dir=$(systemunitdir) && $(add-wants)
238         what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
239         what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && dir=$(systemunitdir) && $(add-wants)
240         what="$(RESCUE_TARGET_WANTS)" && wants=rescue.target && dir=$(systemunitdir) && $(add-wants)
241         what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && dir=$(systemunitdir) && $(add-wants)
242         what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(systemunitdir) && $(add-wants)
243         what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && dir=$(systemunitdir) && $(add-wants)
244         what="$(SLICES_TARGET_WANTS)" && wants=slices.target && dir=$(systemunitdir) && $(add-wants)
245         what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
246         what="$(USER_DEFAULT_TARGET_WANTS)" && wants=default.target && dir=$(userunitdir) && $(add-wants)
247
248 install-busnames-target-wants-hook:
249         what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
250         what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
251
252 define add-wants
253         [ -z "$$what" ] || ( \
254           dir=$(DESTDIR)$$dir/$$wants.wants && \
255           $(MKDIR_P) -m 0755 $$dir && \
256           cd $$dir && \
257           rm -f $$what && \
258           for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
259 endef
260
261 install-directories-hook:
262         $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
263
264 install-aliases-hook:
265         set -- $(SYSTEM_UNIT_ALIASES) && \
266                 dir=$(systemunitdir) && $(install-aliases)
267         set -- $(USER_UNIT_ALIASES) && \
268                 dir=$(userunitdir) && $(install-relative-aliases)
269         set -- $(GENERAL_ALIASES) && \
270                 dir= && $(install-relative-aliases)
271
272 define install-aliases
273         while [ -n "$$1" ]; do \
274                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
275                 rm -f $(DESTDIR)$$dir/$$2 && \
276                 $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
277                 shift 2 || exit $$?; \
278         done
279 endef
280
281 define install-relative-aliases
282         while [ -n "$$1" ]; do \
283                 $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
284                 rm -f $(DESTDIR)$$dir/$$2 && \
285                 $(LN_S) --relative $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
286                 shift 2 || exit $$?; \
287         done
288 endef
289
290 install-touch-usr-hook:
291         touch -c $(DESTDIR)/$(prefix)
292
293 INSTALL_EXEC_HOOKS += \
294         install-target-wants-hook \
295         install-directories-hook \
296         install-aliases-hook \
297         install-touch-usr-hook
298
299 if ENABLE_KDBUS
300 INSTALL_EXEC_HOOKS += \
301         install-busnames-target-wants-hook
302 endif
303
304 # ------------------------------------------------------------------------------
305 AM_V_M4 = $(AM_V_M4_$(V))
306 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
307 AM_V_M4_0 = @echo "  M4      " $@;
308
309 AM_V_XSLT = $(AM_V_XSLT_$(V))
310 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
311 AM_V_XSLT_0 = @echo "  XSLT    " $@;
312
313 AM_V_GPERF = $(AM_V_GPERF_$(V))
314 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
315 AM_V_GPERF_0 = @echo "  GPERF   " $@;
316
317 AM_V_LN = $(AM_V_LN_$(V))
318 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
319 AM_V_LN_0 = @echo "  LN      " $@;
320
321 AM_V_RM = $(AM_V_RM_$(V))
322 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
323 AM_V_RM_0 = @echo "  RM      " $@;
324
325 # ------------------------------------------------------------------------------
326 rootbin_PROGRAMS =
327 bin_PROGRAMS =
328 rootlibexec_PROGRAMS =
329 systemgenerator_PROGRAMS =
330 dist_bashcompletion_DATA =
331 dist_zshcompletion_DATA =
332
333 dist_doc_DATA = \
334         README \
335         NEWS \
336         LICENSE.LGPL2.1 \
337         LICENSE.GPL2 \
338         LICENSE.MIT \
339         src/libsystemd/sd-bus/PORTING-DBUS1 \
340         src/libsystemd/sd-bus/DIFFERENCES \
341         src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
342
343 @INTLTOOL_POLICY_RULE@
344
345 # ------------------------------------------------------------------------------
346
347 MANPAGES =
348 MANPAGES_ALIAS =
349
350 include Makefile-man.am
351
352 .PHONY: man update-man-list
353 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
354
355 XML_FILES = \
356         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
357 HTML_FILES = \
358         ${XML_FILES:.xml=.html}
359 HTML_ALIAS = \
360         ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
361
362 if ENABLE_MANPAGES
363 man_MANS = \
364         $(MANPAGES) \
365         $(MANPAGES_ALIAS)
366
367 noinst_DATA += \
368         $(HTML_FILES) \
369         $(HTML_ALIAS)
370
371 CLEANFILES += \
372         $(man_MANS) \
373         $(HTML_FILES) \
374         $(HTML_ALIAS)
375
376 docs/html/man:
377         $(AM_V_at)$(MKDIR_P) $(dir $@)
378         $(AM_V_LN)$(LN_S) -f ../../man $@
379
380 noinst_DATA += \
381         docs/html/man
382
383 CLEANFILES += \
384         docs/html/man
385
386 endif
387
388 EXTRA_DIST += \
389         $(XML_FILES) \
390         $(HTML_FILES) \
391         $(HTML_ALIAS) \
392         $(man_MANS) \
393         tools/make-man-index.py \
394         tools/make-directive-index.py \
395         tools/xml_helper.py
396
397 # ------------------------------------------------------------------------------
398 noinst_LTLIBRARIES += \
399         libsystemd-shared.la
400
401 libsystemd_shared_la_SOURCES = \
402         src/shared/capability.c \
403         src/shared/capability.h \
404         src/shared/linux/auto_dev-ioctl.h \
405         src/shared/ioprio.h \
406         src/shared/missing.h \
407         src/shared/initreq.h \
408         src/shared/securebits.h \
409         src/shared/special.h \
410         src/shared/list.h \
411         src/shared/unaligned.h \
412         src/shared/macro.h \
413         src/shared/def.h \
414         src/shared/sparse-endian.h \
415         src/shared/refcnt.h \
416         src/shared/udev-util.h \
417         src/shared/device-nodes.c \
418         src/shared/device-nodes.h \
419         src/shared/util.c \
420         src/shared/util.h \
421         src/shared/virt.c \
422         src/shared/virt.h \
423         src/shared/architecture.c \
424         src/shared/architecture.h \
425         src/shared/efivars.c \
426         src/shared/efivars.h \
427         src/shared/fstab-util.c \
428         src/shared/fstab-util.h \
429         src/shared/path-util.c \
430         src/shared/path-util.h \
431         src/shared/time-util.c \
432         src/shared/time-util.h \
433         src/shared/locale-util.c \
434         src/shared/locale-util.h \
435         src/shared/mempool.c \
436         src/shared/mempool.h \
437         src/shared/hashmap.c \
438         src/shared/hashmap.h \
439         src/shared/siphash24.c \
440         src/shared/siphash24.h \
441         src/shared/set.h \
442         src/shared/fdset.c \
443         src/shared/fdset.h \
444         src/shared/prioq.c \
445         src/shared/prioq.h \
446         src/shared/sleep-config.c \
447         src/shared/sleep-config.h \
448         src/shared/strv.c \
449         src/shared/strv.h \
450         src/shared/env-util.c \
451         src/shared/env-util.h \
452         src/shared/strbuf.c \
453         src/shared/strbuf.h \
454         src/shared/strxcpyx.c \
455         src/shared/strxcpyx.h \
456         src/shared/conf-parser.c \
457         src/shared/conf-parser.h \
458         src/shared/log.c \
459         src/shared/log.h \
460         src/shared/ratelimit.h \
461         src/shared/ratelimit.c \
462         src/shared/exit-status.c \
463         src/shared/exit-status.h \
464         src/shared/utf8.c \
465         src/shared/utf8.h \
466         src/shared/gunicode.c \
467         src/shared/gunicode.h \
468         src/shared/pager.c \
469         src/shared/pager.h \
470         src/shared/socket-util.c \
471         src/shared/socket-util.h \
472         src/shared/in-addr-util.c \
473         src/shared/in-addr-util.h \
474         src/shared/ether-addr-util.h \
475         src/shared/conf-files.c \
476         src/shared/conf-files.h \
477         src/shared/cgroup-util.c \
478         src/shared/cgroup-util.h \
479         src/shared/cgroup-show.c \
480         src/shared/cgroup-show.h \
481         src/shared/unit-name.c \
482         src/shared/unit-name.h \
483         src/shared/watchdog.c \
484         src/shared/watchdog.h \
485         src/shared/replace-var.c \
486         src/shared/replace-var.h \
487         src/shared/spawn-polkit-agent.c \
488         src/shared/spawn-polkit-agent.h \
489         src/shared/clock-util.c \
490         src/shared/clock-util.h \
491         src/shared/calendarspec.c \
492         src/shared/calendarspec.h \
493         src/shared/fileio.c \
494         src/shared/fileio.h \
495         src/shared/output-mode.h \
496         src/shared/MurmurHash2.c \
497         src/shared/MurmurHash2.h \
498         src/shared/acpi-fpdt.h \
499         src/shared/acpi-fpdt.c \
500         src/shared/boot-timestamps.h \
501         src/shared/boot-timestamps.c \
502         src/shared/mkdir.c \
503         src/shared/mkdir.h \
504         src/shared/smack-util.c \
505         src/shared/smack-util.h \
506         src/shared/apparmor-util.c \
507         src/shared/apparmor-util.h \
508         src/shared/ima-util.c \
509         src/shared/ima-util.h \
510         src/shared/ptyfwd.c \
511         src/shared/ptyfwd.h \
512         src/shared/errno-list.c \
513         src/shared/errno-list.h \
514         src/shared/af-list.c \
515         src/shared/af-list.h \
516         src/shared/arphrd-list.c \
517         src/shared/arphrd-list.h \
518         src/shared/cap-list.c \
519         src/shared/cap-list.h \
520         src/shared/audit.c \
521         src/shared/audit.h \
522         src/shared/xml.c \
523         src/shared/xml.h \
524         src/shared/json.c \
525         src/shared/json.h \
526         src/shared/selinux-util.c \
527         src/shared/selinux-util.h \
528         src/shared/smack-util.c \
529         src/shared/smack-util.h \
530         src/shared/label.c \
531         src/shared/label.h \
532         src/shared/socket-label.c \
533         src/shared/mkdir-label.c \
534         src/shared/fileio-label.h \
535         src/shared/fileio-label.c \
536         src/shared/bus-label.c \
537         src/shared/bus-label.h \
538         src/shared/gpt.h \
539         src/shared/clean-ipc.h \
540         src/shared/clean-ipc.c \
541         src/shared/login-shared.c \
542         src/shared/login-shared.h \
543         src/shared/ring.c \
544         src/shared/ring.h \
545         src/shared/barrier.c \
546         src/shared/barrier.h \
547         src/shared/pty.c \
548         src/shared/pty.h \
549         src/shared/async.c \
550         src/shared/async.h \
551         src/shared/base-filesystem.c \
552         src/shared/base-filesystem.h \
553         src/shared/memfd-util.c \
554         src/shared/memfd-util.h \
555         src/shared/uid-range.c \
556         src/shared/uid-range.h \
557         src/shared/nss-util.h \
558         src/shared/verbs.c \
559         src/shared/verbs.h \
560         src/shared/sigbus.c \
561         src/shared/sigbus.h \
562         src/shared/build.h \
563         src/shared/import-util.c \
564         src/shared/import-util.h \
565         src/shared/sysctl-util.c \
566         src/shared/sysctl-util.h
567
568 nodist_libsystemd_shared_la_SOURCES = \
569         src/shared/errno-from-name.h \
570         src/shared/errno-to-name.h \
571         src/shared/af-from-name.h \
572         src/shared/af-to-name.h \
573         src/shared/arphrd-from-name.h \
574         src/shared/arphrd-to-name.h \
575         src/shared/cap-from-name.h \
576         src/shared/cap-to-name.h
577
578 libsystemd_shared_la_CFLAGS = \
579         $(AM_CFLAGS) \
580         $(CAP_CFLAGS) \
581         $(SECCOMP_CFLAGS) \
582         -pthread
583
584 libsystemd_shared_la_LIBADD = \
585         $(CAP_LIBS) \
586         -lm
587
588 # ------------------------------------------------------------------------------
589 if HAVE_ACL
590 noinst_LTLIBRARIES += \
591         libsystemd-acl.la
592
593 libsystemd_acl_la_SOURCES = \
594         src/shared/acl-util.c \
595         src/shared/acl-util.h
596
597 libsystemd_acl_la_CFLAGS = \
598         $(AM_CFLAGS) \
599         $(ACL_CFLAGS)
600
601 libsystemd_acl_la_LIBADD = \
602         $(ACL_LIBS)
603 endif
604
605 # ------------------------------------------------------------------------------
606 noinst_LTLIBRARIES += \
607         libsystemd-core.la
608
609 libsystemd_core_la_SOURCES = \
610         src/core/unit.c \
611         src/core/unit.h \
612         src/core/unit-printf.c \
613         src/core/unit-printf.h \
614         src/core/job.c \
615         src/core/job.h \
616         src/core/manager.c \
617         src/core/manager.h \
618         src/core/transaction.c \
619         src/core/transaction.h \
620         src/core/load-fragment.c \
621         src/core/load-fragment.h \
622         src/core/service.c \
623         src/core/service.h \
624         src/core/socket.c \
625         src/core/socket.h \
626         src/core/busname.c \
627         src/core/busname.h \
628         src/core/bus-endpoint.c \
629         src/core/bus-endpoint.h \
630         src/core/bus-policy.c \
631         src/core/bus-policy.h \
632         src/core/target.c \
633         src/core/target.h \
634         src/core/snapshot.c \
635         src/core/snapshot.h \
636         src/core/device.c \
637         src/core/device.h \
638         src/core/swap.c \
639         src/core/swap.h \
640         src/core/timer.c \
641         src/core/timer.h \
642         src/core/path.c \
643         src/core/path.h \
644         src/core/slice.c \
645         src/core/slice.h \
646         src/core/scope.c \
647         src/core/scope.h \
648         src/core/load-dropin.c \
649         src/core/load-dropin.h \
650         src/core/execute.c \
651         src/core/execute.h \
652         src/core/kill.c \
653         src/core/kill.h \
654         src/core/dbus.c \
655         src/core/dbus.h \
656         src/core/dbus-manager.c \
657         src/core/dbus-manager.h \
658         src/core/dbus-unit.c \
659         src/core/dbus-unit.h \
660         src/core/dbus-job.c \
661         src/core/dbus-job.h \
662         src/core/dbus-service.c \
663         src/core/dbus-service.h \
664         src/core/dbus-socket.c \
665         src/core/dbus-socket.h \
666         src/core/dbus-busname.c \
667         src/core/dbus-busname.h \
668         src/core/dbus-target.c \
669         src/core/dbus-target.h \
670         src/core/dbus-snapshot.c \
671         src/core/dbus-snapshot.h \
672         src/core/dbus-device.c \
673         src/core/dbus-device.h \
674         src/core/dbus-swap.c \
675         src/core/dbus-swap.h \
676         src/core/dbus-timer.c \
677         src/core/dbus-timer.h \
678         src/core/dbus-path.c \
679         src/core/dbus-path.h \
680         src/core/dbus-slice.c \
681         src/core/dbus-slice.h \
682         src/core/dbus-scope.c \
683         src/core/dbus-scope.h \
684         src/core/dbus-execute.c \
685         src/core/dbus-execute.h \
686         src/core/dbus-kill.c \
687         src/core/dbus-kill.h \
688         src/core/dbus-cgroup.c \
689         src/core/dbus-cgroup.h \
690         src/core/cgroup.c \
691         src/core/cgroup.h \
692         src/core/selinux-access.c \
693         src/core/selinux-access.h \
694         src/core/selinux-setup.c \
695         src/core/selinux-setup.h \
696         src/core/smack-setup.c \
697         src/core/smack-setup.h \
698         src/core/ima-setup.c \
699         src/core/ima-setup.h \
700         src/core/locale-setup.h \
701         src/core/locale-setup.c \
702         src/core/hostname-setup.c \
703         src/core/hostname-setup.h \
704         src/core/machine-id-setup.c \
705         src/core/machine-id-setup.h \
706         src/core/kmod-setup.c \
707         src/core/kmod-setup.h \
708         src/core/namespace.c \
709         src/core/namespace.h \
710         src/core/killall.h \
711         src/core/killall.c \
712         src/core/audit-fd.c \
713         src/core/audit-fd.h \
714         src/core/show-status.c \
715         src/core/show-status.h \
716         src/core/failure-action.c \
717         src/core/failure-action.h
718
719 nodist_libsystemd_core_la_SOURCES = \
720         src/core/load-fragment-gperf.c \
721         src/core/load-fragment-gperf-nulstr.c
722
723 libsystemd_core_la_CFLAGS = \
724         $(AM_CFLAGS) \
725         $(PAM_CFLAGS) \
726         -pthread
727
728 libsystemd_core_la_LIBADD = \
729         libsystemd-shared.la \
730         $(PAM_LIBS)
731
732 src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
733         $(AM_V_at)$(MKDIR_P) $(dir $@)
734         $(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 ";" }' < $< > $@
735
736 gperf_gperf_m4_sources = \
737         src/core/load-fragment-gperf.gperf.m4
738
739 gperf_txt_sources = \
740         src/shared/errno-list.txt \
741         src/shared/af-list.txt \
742         src/shared/arphrd-list.txt \
743         src/shared/cap-list.txt
744
745 BUILT_SOURCES += \
746         $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
747         $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf-nulstr.c) \
748         $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
749         $(gperf_txt_sources:-list.txt=-from-name.h) \
750         $(gperf_txt_sources:-list.txt=-to-name.h)
751
752 CLEANFILES += \
753         $(gperf_txt_sources:-list.txt=-from-name.gperf)
754 DISTCLEANFILES = \
755         $(gperf_txt_sources)
756
757 EXTRA_DIST += \
758         $(gperf_gperf_m4_sources) \
759         $(gperf_gperf_sources) \
760         $(gperf_txt_sources:-list.txt=-from-name.gperf)
761
762 CLEANFILES += \
763         $(gperf_txt_sources)
764
765 %-from-name.gperf: %-list.txt
766         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
767
768 %-from-name.h: %-from-name.gperf
769         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
770
771
772 src/shared/errno-list.txt:
773         $(AM_V_at)$(MKDIR_P) $(dir $@)
774         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
775
776 src/shared/errno-to-name.h: src/shared/errno-list.txt
777         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
778
779
780 src/shared/af-list.txt:
781         $(AM_V_at)$(MKDIR_P) $(dir $@)
782         $(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; }' >$@
783
784 src/shared/af-to-name.h: src/shared/af-list.txt
785         $(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 "};"}' <$< >$@
786
787
788 src/shared/arphrd-list.txt:
789         $(AM_V_at)$(MKDIR_P) $(dir $@)
790         $(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_//' >$@
791
792 src/shared/arphrd-to-name.h: src/shared/arphrd-list.txt
793         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const arphrd_names[] = { "} !/CISCO/ { printf "[ARPHRD_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
794
795 src/shared/arphrd-from-name.gperf: src/shared/arphrd-list.txt
796         $(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 }' <$< >$@
797
798
799 src/shared/cap-list.txt:
800         $(AM_V_at)$(MKDIR_P) $(dir $@)
801         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/capability.h -include missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
802
803 src/shared/cap-to-name.h: src/shared/cap-list.txt
804         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@
805
806 src/shared/cap-from-name.gperf: src/shared/cap-list.txt
807         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
808
809 src/shared/cap-from-name.h: src/shared/cap-from-name.gperf
810         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@
811
812 # ------------------------------------------------------------------------------
813 dist_factory_etc_DATA = \
814         factory/etc/nsswitch.conf
815
816 if HAVE_PAM
817 dist_factory_pam_DATA = \
818         factory/etc/pam.d/system-auth \
819         factory/etc/pam.d/other
820 endif
821
822 # ------------------------------------------------------------------------------
823 noinst_LTLIBRARIES += \
824         libsystemd-internal.la
825
826 libsystemd_internal_la_SOURCES = \
827         src/systemd/sd-bus.h \
828         src/systemd/sd-bus-protocol.h \
829         src/systemd/sd-bus-vtable.h \
830         src/systemd/sd-utf8.h \
831         src/systemd/sd-event.h \
832         src/systemd/sd-rtnl.h \
833         src/systemd/sd-resolve.h \
834         src/systemd/sd-login.h \
835         src/systemd/sd-id128.h \
836         src/systemd/sd-daemon.h \
837         src/systemd/sd-path.h \
838         src/systemd/sd-network.h \
839         src/systemd/sd-device.h \
840         src/libsystemd/sd-bus/sd-bus.c \
841         src/libsystemd/sd-bus/bus-control.c \
842         src/libsystemd/sd-bus/bus-control.h \
843         src/libsystemd/sd-bus/bus-error.c \
844         src/libsystemd/sd-bus/bus-error.h \
845         src/libsystemd/sd-bus/bus-common-errors.h \
846         src/libsystemd/sd-bus/bus-common-errors.c \
847         src/libsystemd/sd-bus/bus-internal.c \
848         src/libsystemd/sd-bus/bus-internal.h \
849         src/libsystemd/sd-bus/bus-socket.c \
850         src/libsystemd/sd-bus/bus-socket.h \
851         src/libsystemd/sd-bus/bus-kernel.c \
852         src/libsystemd/sd-bus/bus-kernel.h \
853         src/libsystemd/sd-bus/bus-container.c \
854         src/libsystemd/sd-bus/bus-container.h \
855         src/libsystemd/sd-bus/bus-message.c \
856         src/libsystemd/sd-bus/bus-message.h \
857         src/libsystemd/sd-bus/bus-creds.c \
858         src/libsystemd/sd-bus/bus-creds.h \
859         src/libsystemd/sd-bus/bus-signature.c \
860         src/libsystemd/sd-bus/bus-signature.h \
861         src/libsystemd/sd-bus/bus-type.c \
862         src/libsystemd/sd-bus/bus-type.h \
863         src/libsystemd/sd-bus/bus-match.c \
864         src/libsystemd/sd-bus/bus-match.h \
865         src/libsystemd/sd-bus/bus-bloom.c \
866         src/libsystemd/sd-bus/bus-bloom.h \
867         src/libsystemd/sd-bus/bus-introspect.c \
868         src/libsystemd/sd-bus/bus-introspect.h \
869         src/libsystemd/sd-bus/bus-objects.c \
870         src/libsystemd/sd-bus/bus-objects.h \
871         src/libsystemd/sd-bus/bus-gvariant.c \
872         src/libsystemd/sd-bus/bus-gvariant.h \
873         src/libsystemd/sd-bus/bus-convenience.c \
874         src/libsystemd/sd-bus/bus-track.c \
875         src/libsystemd/sd-bus/bus-track.h \
876         src/libsystemd/sd-bus/bus-util.c \
877         src/libsystemd/sd-bus/bus-util.h \
878         src/libsystemd/sd-bus/bus-slot.c \
879         src/libsystemd/sd-bus/bus-slot.h \
880         src/libsystemd/sd-bus/bus-protocol.h \
881         src/libsystemd/sd-bus/kdbus.h \
882         src/libsystemd/sd-utf8/sd-utf8.c \
883         src/libsystemd/sd-event/sd-event.c \
884         src/libsystemd/sd-event/event-util.h \
885         src/libsystemd/sd-rtnl/sd-rtnl.c \
886         src/libsystemd/sd-rtnl/rtnl-internal.h \
887         src/libsystemd/sd-rtnl/rtnl-message.c \
888         src/libsystemd/sd-rtnl/rtnl-types.h \
889         src/libsystemd/sd-rtnl/rtnl-types.c \
890         src/libsystemd/sd-rtnl/rtnl-util.h \
891         src/libsystemd/sd-rtnl/rtnl-util.c \
892         src/libsystemd/sd-rtnl/local-addresses.h \
893         src/libsystemd/sd-rtnl/local-addresses.c \
894         src/libsystemd/sd-id128/sd-id128.c \
895         src/libsystemd/sd-daemon/sd-daemon.c \
896         src/libsystemd/sd-login/sd-login.c \
897         src/libsystemd/sd-path/sd-path.c \
898         src/libsystemd/sd-network/sd-network.c \
899         src/libsystemd/sd-network/network-util.h \
900         src/libsystemd/sd-network/network-util.c \
901         src/libsystemd/sd-device/device-internal.h \
902         src/libsystemd/sd-device/device-util.h \
903         src/libsystemd/sd-device/sd-device.c \
904         src/libsystemd/sd-device/device-private.c \
905         src/libsystemd/sd-device/device-private.h
906
907 nodist_libsystemd_internal_la_SOURCES = \
908         src/libsystemd/libsystemd.sym
909
910 libsystemd_internal_la_CFLAGS = \
911         $(AM_CFLAGS) \
912         -pthread
913
914 BUILT_SOURCES += \
915        src/libsystemd/libsystemd.sym
916
917
918 libsystemd_internal_la_LIBADD = \
919         $(RT_LIBS) \
920         libsystemd-shared.la
921
922 libsystemd_internal_la_LDFLAGS = \
923         $(AM_LDFLAGS) \
924         -version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
925         -Wl,--version-script=$(top_builddir)/src/libsystemd/libsystemd.sym
926
927 libsystemd-install-hook:
928         libname=libsystemd.so && $(move-to-rootlibdir)
929
930 libsystemd-uninstall-hook:
931         rm -f $(DESTDIR)$(rootlibdir)/libsystemd.so*
932
933 INSTALL_EXEC_HOOKS += libsystemd-install-hook
934 UNINSTALL_EXEC_HOOKS += libsystemd-uninstall-hook
935
936 pkgconfiglib_DATA += \
937         src/libsystemd/libsystemd.pc
938
939 pkginclude_HEADERS += \
940         src/systemd/sd-login.h
941
942 # ------------------------------------------------------------------------------
943 systemd_logind_SOURCES = \
944         src/login/logind.c \
945         src/login/logind.h
946
947 nodist_systemd_logind_SOURCES = \
948         src/login/logind-gperf.c
949
950 systemd_logind_LDADD = \
951         libsystemd-logind-core.la
952
953 libsystemd_logind_core_la_SOURCES = \
954         src/login/logind-core.c \
955         src/login/logind-device.c \
956         src/login/logind-device.h \
957         src/login/logind-button.c \
958         src/login/logind-button.h \
959         src/login/logind-action.c \
960         src/login/logind-action.h \
961         src/login/logind-seat.c \
962         src/login/logind-seat.h \
963         src/login/logind-session.c \
964         src/login/logind-session.h \
965         src/login/logind-session-device.c \
966         src/login/logind-session-device.h \
967         src/login/logind-user.c \
968         src/login/logind-user.h \
969         src/login/logind-inhibit.c \
970         src/login/logind-inhibit.h \
971         src/login/logind-dbus.c \
972         src/login/logind-session-dbus.c \
973         src/login/logind-seat-dbus.c \
974         src/login/logind-user-dbus.c \
975         src/login/logind-acl.h
976
977 libsystemd_logind_core_la_LIBADD = \
978         $(UDEV_LIBS) \
979         libsystemd-internal.la \
980         libsystemd-shared.la
981
982 if HAVE_ACL
983 libsystemd_logind_core_la_SOURCES += \
984         src/login/logind-acl.c
985
986 libsystemd_logind_core_la_LIBADD += \
987         libsystemd-acl.la
988 endif
989
990 noinst_LTLIBRARIES += \
991         libsystemd-logind-core.la
992
993 rootlibexec_PROGRAMS += \
994         systemd-logind
995
996 loginctl_SOURCES = \
997         src/login/loginctl.c \
998         src/login/sysfs-show.h \
999         src/login/sysfs-show.c
1000
1001 loginctl_LDADD = \
1002         $(UDEV_LIBS) \
1003         libsystemd-internal.la \
1004         libsystemd-shared.la
1005
1006 rootbin_PROGRAMS += \
1007         loginctl
1008
1009 dist_bashcompletion_DATA += \
1010         shell-completion/bash/loginctl
1011
1012 dist_zshcompletion_DATA += \
1013         shell-completion/zsh/_loginctl \
1014         shell-completion/zsh/_systemd-inhibit
1015
1016 systemd_inhibit_SOURCES = \
1017         src/login/inhibit.c
1018
1019 systemd_inhibit_LDADD = \
1020         libsystemd-internal.la \
1021         libsystemd-shared.la
1022
1023 rootbin_PROGRAMS += \
1024         systemd-inhibit
1025
1026 test_login_SOURCES = \
1027         src/libsystemd/sd-login/test-login.c
1028
1029 test_login_LDADD = \
1030         libsystemd-internal.la \
1031         libsystemd-shared.la
1032
1033 test_login_shared_SOURCES = \
1034         src/login/test-login-shared.c
1035
1036 test_login_shared_LDADD = \
1037         libsystemd-internal.la \
1038         libsystemd-shared.la
1039
1040 test_inhibit_SOURCES = \
1041         src/login/test-inhibit.c
1042
1043 test_inhibit_LDADD = \
1044         libsystemd-internal.la \
1045         libsystemd-shared.la
1046
1047 test_login_tables_SOURCES = \
1048         src/login/test-login-tables.c
1049
1050 test_login_tables_LDADD = \
1051         libsystemd-logind-core.la
1052
1053 manual_tests += \
1054         test-login \
1055         test-inhibit
1056
1057 tests += \
1058         test-login-tables \
1059         test-login-shared
1060
1061 if HAVE_PAM
1062 pam_systemd_la_SOURCES = \
1063         src/login/pam_systemd.sym \
1064         src/login/pam_systemd.c
1065
1066 pam_systemd_la_CFLAGS = \
1067         $(AM_CFLAGS) \
1068         $(PAM_CFLAGS) \
1069         -fvisibility=hidden
1070
1071 pam_systemd_la_LDFLAGS = \
1072         $(AM_LDFLAGS) \
1073         -module \
1074         -export-dynamic \
1075         -avoid-version \
1076         -shared \
1077         -Wl,--version-script=$(top_srcdir)/src/login/pam_systemd.sym
1078
1079 pam_systemd_la_LIBADD = \
1080         libsystemd-internal.la \
1081         libsystemd-shared.la \
1082         $(PAM_LIBS)
1083
1084 pamlib_LTLIBRARIES = \
1085         pam_systemd.la
1086
1087 dist_pamconf_DATA = \
1088         src/login/systemd-user
1089
1090 endif
1091
1092 dist_dbussystemservice_DATA += \
1093         src/login/org.freedesktop.login1.service
1094
1095 dist_dbuspolicy_DATA += \
1096         src/login/org.freedesktop.login1.conf
1097
1098 dist_pkgsysconf_DATA += \
1099         src/login/logind.conf
1100
1101 polkitpolicy_files += \
1102         src/login/org.freedesktop.login1.policy
1103
1104 INSTALL_DIRS += \
1105         $(systemdstatedir)
1106
1107 SYSTEM_UNIT_ALIASES += \
1108         systemd-logind.service dbus-org.freedesktop.login1.service
1109
1110 dist_udevrules_DATA = \
1111         src/login/70-uaccess.rules \
1112         src/login/70-power-switch.rules
1113
1114 nodist_udevrules_DATA = \
1115         src/login/71-seat.rules \
1116         src/login/73-seat-late.rules
1117
1118 polkitpolicy_in_files += \
1119         src/login/org.freedesktop.login1.policy.in
1120
1121 gperf_gperf_sources = \
1122         src/login/logind-gperf.gperf
1123
1124 EXTRA_DIST += \
1125         src/login/71-seat.rules.in \
1126         src/login/73-seat-late.rules.in \
1127         units/systemd-logind.service.in
1128
1129 pkgconfiglib_DATA += \
1130         src/compat-libs/libsystemd-login.pc
1131
1132 EXTRA_DIST += \
1133         src/compat-libs/libsystemd-login.pc.in
1134
1135 # ------------------------------------------------------------------------------
1136 substitutions = \
1137        '|rootlibexecdir=$(rootlibexecdir)|' \
1138        '|rootbindir=$(rootbindir)|' \
1139        '|bindir=$(bindir)|' \
1140        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
1141        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
1142        '|pkgsysconfdir=$(pkgsysconfdir)|' \
1143        '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
1144        '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
1145        '|pkgdatadir=$(pkgdatadir)|' \
1146        '|systemunitdir=$(systemunitdir)|' \
1147        '|userunitdir=$(userunitdir)|' \
1148        '|systempresetdir=$(systempresetdir)|' \
1149        '|userpresetdir=$(userpresetdir)|' \
1150        '|udevrulesdir=$(udevrulesdir)|' \
1151        '|catalogdir=$(catalogdir)|' \
1152        '|tmpfilesdir=$(tmpfilesdir)|' \
1153        '|sysusersdir=$(sysusersdir)|' \
1154        '|sysctldir=$(sysctldir)|' \
1155        '|systemgeneratordir=$(systemgeneratordir)|' \
1156        '|usergeneratordir=$(usergeneratordir)|' \
1157        '|CERTIFICATEROOT=$(CERTIFICATEROOT)|' \
1158        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
1159        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
1160        '|PACKAGE_URL=$(PACKAGE_URL)|' \
1161        '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
1162        '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
1163        '|prefix=$(prefix)|' \
1164        '|exec_prefix=$(exec_prefix)|' \
1165        '|libdir=$(libdir)|' \
1166        '|includedir=$(includedir)|' \
1167        '|VERSION=$(VERSION)|' \
1168        '|rootprefix=$(rootprefix)|' \
1169        '|udevlibexecdir=$(udevlibexecdir)|' \
1170        '|SUSHELL=$(SUSHELL)|' \
1171        '|SULOGIN=$(SULOGIN)|' \
1172        '|DEBUGTTY=$(DEBUGTTY)|' \
1173        '|KILL=$(KILL)|' \
1174        '|KMOD=$(KMOD)|' \
1175        '|MKDIR_P=$(MKDIR_P)|' \
1176        '|QUOTAON=$(QUOTAON)|' \
1177        '|QUOTACHECK=$(QUOTACHECK)|' \
1178        '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
1179        '|VARLOGDIR=$(varlogdir)|' \
1180        '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
1181        '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
1182        '|PYTHON=$(PYTHON)|' \
1183        '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
1184        '|NTP_SERVERS=$(NTP_SERVERS)|' \
1185        '|DNS_SERVERS=$(DNS_SERVERS)|' \
1186        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
1187        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
1188        '|TTY_GID=$(TTY_GID)|' \
1189        '|systemsleepdir=$(systemsleepdir)|' \
1190        '|systemshutdowndir=$(systemshutdowndir)|' \
1191        '|binfmtdir=$(binfmtdir)|' \
1192        '|modulesloaddir=$(modulesloaddir)|'
1193
1194 SED_PROCESS = \
1195         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
1196         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
1197                 < $< > $@
1198
1199 units/%: units/%.in
1200         $(SED_PROCESS)
1201
1202 man/%: man/%.in
1203         $(SED_PROCESS)
1204
1205 sysctl.d/%: sysctl.d/%.in
1206         $(SED_PROCESS)
1207
1208 %.pc: %.pc.in
1209         $(SED_PROCESS)
1210
1211 %.conf: %.conf.in
1212         $(SED_PROCESS)
1213
1214 src/core/macros.%: src/core/macros.%.in
1215         $(SED_PROCESS)
1216
1217 src/%.policy.in: src/%.policy.in.in
1218         $(SED_PROCESS)
1219
1220 shell-completion/%: shell-completion/%.in
1221         $(SED_PROCESS)
1222
1223 %.rules: %.rules.in
1224         $(SED_PROCESS)
1225
1226 %.conf: %.conf.in
1227         $(SED_PROCESS)
1228
1229 %.sh: %.sh.in
1230         $(SED_PROCESS)
1231         $(AM_V_GEN)chmod +x $@
1232
1233 src/%.c: src/%.gperf
1234         $(AM_V_at)$(MKDIR_P) $(dir $@)
1235         $(AM_V_GPERF)$(GPERF) < $< > $@
1236
1237 src/%: src/%.m4
1238         $(AM_V_at)$(MKDIR_P) $(dir $@)
1239         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1240
1241 sysusers.d/%: sysusers.d/%.m4
1242         $(AM_V_at)$(MKDIR_P) $(dir $@)
1243         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1244
1245 tmpfiles.d/%: tmpfiles.d/%.m4
1246         $(AM_V_at)$(MKDIR_P) $(dir $@)
1247         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1248
1249
1250 units/%: units/%.m4
1251         $(AM_V_at)$(MKDIR_P) $(dir $@)
1252         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
1253
1254 units/user/%: units/user/%.m4
1255         $(AM_V_at)$(MKDIR_P) $(dir $@)
1256         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
1257
1258 if ENABLE_POLKIT
1259 nodist_polkitpolicy_DATA = \
1260         $(polkitpolicy_files) \
1261         $(polkitpolicy_in_in_files:.policy.in.in=.policy)
1262 endif
1263
1264 EXTRA_DIST += \
1265         $(polkitpolicy_in_files) \
1266         $(polkitpolicy_in_in_files)
1267
1268 # ------------------------------------------------------------------------------
1269 if ENABLE_MANPAGES
1270 man/custom-entities.ent: configure.ac
1271         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
1272         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
1273          printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
1274          > $@ # '
1275
1276 DISTCLEANFILES += \
1277         man/custom-entities.ent
1278
1279 XSLTPROC_FLAGS = \
1280         --nonet \
1281         --xinclude \
1282         --stringparam man.output.quietly 1 \
1283         --stringparam funcsynopsis.style ansi \
1284         --stringparam man.authors.section.enabled 0 \
1285         --stringparam man.copyright.section.enabled 0 \
1286         --stringparam systemd.version $(VERSION) \
1287         --path '$(builddir)/man:$(srcdir)/man'
1288
1289 XSLTPROC_PROCESS_MAN = \
1290         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
1291
1292 XSLTPROC_PROCESS_HTML = \
1293         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
1294
1295 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
1296         $(XSLTPROC_PROCESS_MAN)
1297
1298 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
1299         $(XSLTPROC_PROCESS_MAN)
1300
1301 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
1302         $(XSLTPROC_PROCESS_MAN)
1303
1304 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
1305         $(XSLTPROC_PROCESS_MAN)
1306
1307 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
1308         $(XSLTPROC_PROCESS_MAN)
1309
1310 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
1311         $(XSLTPROC_PROCESS_HTML)
1312
1313 define html-alias
1314         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
1315 endef
1316
1317 endif
1318
1319 EXTRA_DIST += \
1320         man/custom-html.xsl \
1321         man/custom-man.xsl
1322
1323 install-exec-hook: $(INSTALL_EXEC_HOOKS)
1324
1325 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
1326
1327 install-data-hook: $(INSTALL_DATA_HOOKS)
1328
1329 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
1330
1331 clean-local: $(CLEAN_LOCAL_HOOKS)
1332         rm -rf $(abs_srcdir)/install-tree
1333
1334 DISTCHECK_CONFIGURE_FLAGS = \
1335         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
1336         --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
1337         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
1338         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
1339         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
1340         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
1341         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
1342         --with-rootprefix=$$dc_install_base \
1343         --disable-split-usr \
1344         --enable-kdbus \
1345         --enable-compat-libs
1346
1347 DISTCHECK_CONFIGURE_FLAGS += \
1348         --with-sysvinit-path= \
1349         --with-sysvrcnd-path=
1350
1351 if ENABLE_GTK_DOC
1352 DISTCHECK_CONFIGURE_FLAGS += \
1353         --enable-gtk-doc
1354 endif
1355
1356 #
1357 # Require python when making dist
1358 #
1359 .PHONY: dist-check-compat-libs dist-check-help
1360
1361 dist-check-compat-libs:
1362 if !ENABLE_COMPAT_LIBS
1363         @echo "*** compat-libs must be enabled in order to make dist"
1364         @false
1365 endif
1366
1367 dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS)
1368         for i in $(abspath $^); do                                             \
1369             if $$i  --help | grep -v 'default:' | grep -E -q '.{80}.' ; then   \
1370                 echo "$(basename $$i) --help output is too wide:";             \
1371                 $$i  --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
1372                 exit 1;                                                        \
1373             fi; done
1374
1375 dist: dist-check-python dist-check-compat-libs