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