1 # -*- Mode: makefile; indent-tabs-mode: t -*-
3 # This file is part of elogind.
5 # Copyright 2010-2012 Lennart Poettering
6 # Copyright 2010-2012 Kay Sievers
7 # Copyright 2013 Zbigniew Jędrzejewski-Szmek
8 # Copyright 2013 David Strauss
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.
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.
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/>.
23 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
24 AM_MAKEFLAGS = --no-print-directory
25 AUTOMAKE_OPTIONS = color-tests parallel-tests
27 GCC_COLORS ?= 'ooh, shiny!'
32 # remove targets if the command fails
35 # keep intermediate files
38 # Keep the test-suite.log
39 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
45 # Dirs of external packages
46 dbuspolicydir=@dbuspolicydir@
47 dbussystemservicedir=@dbussystemservicedir@
49 pamconfdir=@pamconfdir@
50 pkgconfigdatadir=$(datadir)/pkgconfig
51 pkgconfiglibdir=$(libdir)/pkgconfig
52 polkitpolicydir=$(datadir)/polkit-1/actions
53 bashcompletiondir=@bashcompletiondir@
54 zshcompletiondir=@zshcompletiondir@
55 systemsleepdir=$(pkglibexecdir)/sleep.d
56 systemshutdowndir=$(pkglibexecdir)/shutdown.d
58 CGROUP_CONTROLLER=@cgroup_controller@
59 PKTTYAGENT=$(bindir)/pkttyagent
61 # Our own, non-special dirs
62 pkgsysconfdir=$(sysconfdir)/elogind
63 pkgincludedir=$(includedir)/elogind
64 udevrulesdir=@udevrulesdir@
65 udevbindir=@udevbindir@
66 udevlibexecdir=$(udevbindir)
67 udevhomedir=$(udevlibexecdir)
68 factory_pamdir = $(datadir)/factory/etc/pam.d
70 # And these are the special ones for /
71 rootprefix=@rootprefix@
72 rootlibdir=@rootlibdir@
73 rootbindir=$(rootprefix)/bin
79 UNINSTALL_EXEC_HOOKS =
81 UNINSTALL_DATA_HOOKS =
82 DISTCLEAN_LOCAL_HOOKS =
89 polkitpolicy_in_files =
92 nodist_udevrules_DATA =
93 dist_pkgsysconf_DATA =
94 dist_dbuspolicy_DATA =
95 dist_dbussystemservice_DATA =
101 noinst_PROGRAMS = $(manual_tests) $(tests)
108 in_files = $(filter %.in,$(EXTRA_DIST))
109 in_in_files = $(filter %.in.in, $(in_files))
110 m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
112 CLEANFILES = $(BUILT_SOURCES) \
113 $(pkgconfiglib_DATA) \
114 $(in_files:.in=) $(in_in_files:.in.in=) \
117 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
118 $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
119 $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
122 -include $(top_builddir)/config.h \
123 -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
124 -DSYSTEMD_CGROUP_CONTROLLER=\"$(CGROUP_CONTROLLER)\" \
125 -DELOGIND_CGROUP_AGENT_PATH=\"$(pkglibexecdir)/elogind-cgroups-agent\" \
126 -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
127 -DPOLKIT_AGENT_BINARY_PATH=\"$(PKTTYAGENT)\" \
128 -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
129 -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
131 -DREBOOT=\"$(REBOOT)\" \
132 -DKEXEC=\"$(KEXEC)\" \
133 -DLIBDIR=\"$(libdir)\" \
134 -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
135 -I $(top_srcdir)/src \
136 -I $(top_builddir)/src/basic \
137 -I $(top_srcdir)/src/basic \
138 -I $(top_srcdir)/src/core \
139 -I $(top_srcdir)/src/shared \
140 -I $(top_builddir)/src/shared \
141 -I $(top_srcdir)/src/login \
142 -I $(top_srcdir)/src/systemd \
143 -I $(top_srcdir)/src/libelogind/sd-bus \
144 -I $(top_srcdir)/src/libelogind/sd-event \
145 -I $(top_srcdir)/src/libelogind/sd-login \
148 AM_CFLAGS = $(OUR_CFLAGS)
149 AM_LDFLAGS = $(OUR_LDFLAGS)
151 # ------------------------------------------------------------------------------
152 define move-to-rootlibdir
153 if test "$(libdir)" != "$(rootlibdir)"; then \
154 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
155 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
156 rm -f $(DESTDIR)$(libdir)/$$libname && \
157 $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
158 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
162 install-touch-usr-hook:
163 touch -c $(DESTDIR)/$(prefix)
165 INSTALL_EXEC_HOOKS += \
166 install-touch-usr-hook
169 # ------------------------------------------------------------------------------
170 AM_V_M4 = $(AM_V_M4_$(V))
171 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
172 AM_V_M4_0 = @echo " M4 " $@;
174 AM_V_XSLT = $(AM_V_XSLT_$(V))
175 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
176 AM_V_XSLT_0 = @echo " XSLT " $@;
178 AM_V_GPERF = $(AM_V_GPERF_$(V))
179 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
180 AM_V_GPERF_0 = @echo " GPERF " $@;
182 AM_V_LN = $(AM_V_LN_$(V))
183 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
184 AM_V_LN_0 = @echo " LN " $@;
186 AM_V_RM = $(AM_V_RM_$(V))
187 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
188 AM_V_RM_0 = @echo " RM " $@;
190 # ------------------------------------------------------------------------------
192 pkglibexec_PROGRAMS =
200 @INTLTOOL_POLICY_RULE@
202 # ------------------------------------------------------------------------------
207 include Makefile-man.am
209 .PHONY: man update-man-list
210 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
213 ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
215 ${XML_FILES:.xml=.html}
217 ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
234 $(AM_V_at)$(MKDIR_P) $(dir $@)
235 $(AM_V_LN)$(LN_S) -f ../../man $@
244 man/index.html: man/elogind.index.html
245 $(AM_V_LN)$(LN_S) -f elogind.index.html $@
253 XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml)
254 NON_INDEX_XML_FILES = $(filter-out man/elogind.index.xml,$(XML_FILES))
255 SOURCE_XML_FILES = ${patsubst %,$(top_srcdir)/%,$(filter-out man/elogind.directives.xml,$(NON_INDEX_XML_FILES))}
257 # This target should only be run manually. It recreates Makefile-man.am
258 # file in the source directory based on all man/*.xml files. Run it after
259 # adding, removing, or changing the conditional in a man page.
260 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB)
261 $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
262 $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
263 @echo "Makefile-man.am has been regenerated"
265 man/elogind.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
266 $(AM_V_at)$(MKDIR_P) $(dir $@)
267 $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
269 man/elogind.directives.xml: $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
270 $(AM_V_at)$(MKDIR_P) $(dir $@)
271 $(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
274 man/elogind.index.xml \
275 man/elogind.directives.xml
278 tools/make-man-rules.py
285 $(filter-out man/elogind.directives.xml,$(XML_FILES)) \
291 # ------------------------------------------------------------------------------
292 noinst_LTLIBRARIES += \
295 libbasic_la_SOURCES = \
296 src/basic/missing.h \
297 src/basic/musl_missing.h \
298 src/basic/musl_missing.c \
299 src/basic/capability.c \
300 src/basic/capability.h \
301 src/basic/conf-files.c \
302 src/basic/conf-files.h \
303 src/basic/hostname-util.h \
304 src/basic/hostname-util.c \
305 src/basic/unit-name.c \
306 src/basic/unit-name.h \
309 src/basic/path-util.c \
310 src/basic/path-util.h \
311 src/basic/time-util.c \
312 src/basic/time-util.h \
313 src/basic/signal-util.c \
314 src/basic/signal-util.h \
315 src/basic/mempool.c \
316 src/basic/mempool.h \
317 src/basic/hashmap.c \
318 src/basic/hashmap.h \
319 src/basic/siphash24.c \
320 src/basic/siphash24.h \
327 src/basic/bus-label.c \
328 src/basic/bus-label.h \
331 src/basic/smack-util.c \
332 src/basic/smack-util.h \
335 src/basic/gunicode.c \
336 src/basic/gunicode.h \
341 src/basic/cgroup-util.c \
342 src/basic/cgroup-util.h \
343 src/basic/errno-list.c \
344 src/basic/errno-list.h \
345 src/basic/terminal-util.c \
346 src/basic/terminal-util.h \
347 src/basic/login-util.h \
348 src/basic/login-util.c \
351 src/basic/memfd-util.c \
352 src/basic/memfd-util.h \
353 src/basic/process-util.c \
354 src/basic/process-util.h \
355 src/basic/random-util.c \
356 src/basic/random-util.h \
361 src/basic/selinux-util.c \
362 src/basic/selinux-util.h \
363 src/basic/mkdir-label.c \
364 src/basic/fileio-label.c \
365 src/basic/fileio-label.h \
370 src/basic/parse-printf-format.c \
371 src/basic/parse-printf-format.h
373 nodist_libbasic_la_SOURCES = \
374 src/basic/errno-from-name.h \
375 src/basic/errno-to-name.h
377 libbasic_la_CFLAGS = \
383 libbasic_la_LDFLAGS = \
386 libbasic_la_LIBADD = \
392 # -----------------------------------------------------------------------------
393 noinst_LTLIBRARIES += \
396 libshared_la_SOURCES = \
397 src/shared/sleep-config.c \
398 src/shared/sleep-config.h \
399 src/shared/conf-parser.c \
400 src/shared/conf-parser.h \
403 src/shared/spawn-polkit-agent.c \
404 src/shared/spawn-polkit-agent.h \
405 src/shared/clean-ipc.c \
406 src/shared/clean-ipc.h \
407 src/shared/cgroup-show.c \
408 src/shared/cgroup-show.h \
409 src/shared/utmp-wtmp.h \
410 src/shared/bus-util.c \
411 src/shared/bus-util.h
414 libshared_la_SOURCES += \
415 src/shared/acl-util.c \
416 src/shared/acl-util.h
419 libshared_la_CFLAGS = \
423 libshared_la_LIBADD = \
424 libelogind-internal.la \
428 gperf_txt_sources = \
429 src/basic/errno-list.txt
432 $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
433 $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
434 $(gperf_txt_sources:-list.txt=-from-name.h) \
435 $(gperf_txt_sources:-list.txt=-to-name.h)
438 $(gperf_txt_sources:-list.txt=-from-name.gperf)
443 $(gperf_gperf_m4_sources) \
444 $(gperf_gperf_sources)
449 %-from-name.gperf: %-list.txt
450 $(AM_V_at)$(MKDIR_P) $(dir $@)
451 $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
453 %-from-name.h: %-from-name.gperf
454 $(AM_V_at)$(MKDIR_P) $(dir $@)
455 $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
458 src/basic/errno-list.txt:
459 $(AM_V_at)$(MKDIR_P) $(dir $@)
460 $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
462 src/basic/errno-to-name.h: src/basic/errno-list.txt
463 $(AM_V_at)$(MKDIR_P) $(dir $@)
464 $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
467 # ------------------------------------------------------------------------------
470 dist_factory_pam_DATA = \
471 factory/etc/pam.d/system-auth \
472 factory/etc/pam.d/other
475 # ------------------------------------------------------------------------------
476 pkglibexec_PROGRAMS += \
477 elogind-cgroups-agent
479 elogind_cgroups_agent_SOURCES = \
480 src/cgroups-agent/cgroups-agent.c
482 elogind_cgroups_agent_LDADD = \
485 # ------------------------------------------------------------------------------
486 libelogind_internal_la_SOURCES = \
487 src/systemd/sd-bus.h \
488 src/systemd/sd-bus-protocol.h \
489 src/systemd/sd-bus-vtable.h \
490 src/systemd/sd-event.h \
491 src/systemd/sd-login.h \
492 src/systemd/sd-id128.h \
493 src/systemd/sd-daemon.h \
494 src/libelogind/libelogind.sym \
495 src/libelogind/sd-bus/sd-bus.c \
496 src/libelogind/sd-bus/bus-control.c \
497 src/libelogind/sd-bus/bus-control.h \
498 src/libelogind/sd-bus/bus-error.c \
499 src/libelogind/sd-bus/bus-error.h \
500 src/libelogind/sd-bus/bus-common-errors.h \
501 src/libelogind/sd-bus/bus-common-errors.c \
502 src/libelogind/sd-bus/bus-internal.c \
503 src/libelogind/sd-bus/bus-internal.h \
504 src/libelogind/sd-bus/bus-socket.c \
505 src/libelogind/sd-bus/bus-socket.h \
506 src/libelogind/sd-bus/bus-kernel.c \
507 src/libelogind/sd-bus/bus-kernel.h \
508 src/libelogind/sd-bus/bus-container.c \
509 src/libelogind/sd-bus/bus-container.h \
510 src/libelogind/sd-bus/bus-message.c \
511 src/libelogind/sd-bus/bus-message.h \
512 src/libelogind/sd-bus/bus-creds.c \
513 src/libelogind/sd-bus/bus-creds.h \
514 src/libelogind/sd-bus/bus-signature.c \
515 src/libelogind/sd-bus/bus-signature.h \
516 src/libelogind/sd-bus/bus-type.c \
517 src/libelogind/sd-bus/bus-type.h \
518 src/libelogind/sd-bus/bus-match.c \
519 src/libelogind/sd-bus/bus-match.h \
520 src/libelogind/sd-bus/bus-bloom.c \
521 src/libelogind/sd-bus/bus-bloom.h \
522 src/libelogind/sd-bus/bus-introspect.c \
523 src/libelogind/sd-bus/bus-introspect.h \
524 src/libelogind/sd-bus/bus-objects.c \
525 src/libelogind/sd-bus/bus-objects.h \
526 src/libelogind/sd-bus/bus-gvariant.c \
527 src/libelogind/sd-bus/bus-gvariant.h \
528 src/libelogind/sd-bus/bus-convenience.c \
529 src/libelogind/sd-bus/bus-track.c \
530 src/libelogind/sd-bus/bus-track.h \
531 src/libelogind/sd-bus/bus-slot.c \
532 src/libelogind/sd-bus/bus-slot.h \
533 src/libelogind/sd-bus/bus-protocol.h \
534 src/libelogind/sd-event/sd-event.c \
535 src/libelogind/sd-id128/sd-id128.c \
536 src/libelogind/sd-daemon/sd-daemon.c \
537 src/libelogind/sd-login/sd-login.c
539 libelogind_internal_la_LIBADD = \
543 noinst_LTLIBRARIES += \
544 libelogind-internal.la
547 src/libelogind/libelogind.pc.in \
548 src/libelogind/sd-bus/DIFFERENCES \
549 src/libelogind/sd-bus/GVARIANT-SERIALIZATION
551 libelogind_la_SOURCES = \
552 $(libelogind_internal_la_SOURCES)
554 nodist_libelogind_la_SOURCES = \
555 $(nodist_libelogind_internal_la_SOURCES)
557 libelogind_la_CFLAGS = \
558 $(libelogind_internal_la_CFLAGS)
560 libelogind_la_LDFLAGS = \
562 -version-info $(LIBELOGIND_CURRENT):$(LIBELOGIND_REVISION):$(LIBELOGIND_AGE) \
563 -Wl,--version-script=$(top_srcdir)/src/libelogind/libelogind.sym
565 libelogind_la_LIBADD = \
566 $(libelogind_internal_la_LIBADD)
568 libelogind-install-hook:
569 libname=libelogind.so && $(move-to-rootlibdir)
571 libelogind-uninstall-hook:
572 rm -f $(DESTDIR)$(rootlibdir)/libelogind.so*
574 INSTALL_EXEC_HOOKS += libelogind-install-hook
575 UNINSTALL_EXEC_HOOKS += libelogind-uninstall-hook
577 pkgconfiglib_DATA += \
578 src/libelogind/libelogind.pc
580 pkginclude_HEADERS += \
581 src/systemd/sd-login.h \
582 src/systemd/sd-messages.h \
583 src/systemd/sd-id128.h \
584 src/systemd/_sd-common.h
590 # ------------------------------------------------------------------------------
595 nodist_elogind_SOURCES = \
596 src/login/logind-gperf.c
601 libelogind_core_la_SOURCES = \
602 src/login/logind-core.c \
603 src/login/logind-device.c \
604 src/login/logind-device.h \
605 src/login/logind-button.c \
606 src/login/logind-button.h \
607 src/login/logind-action.c \
608 src/login/logind-action.h \
609 src/login/logind-seat.c \
610 src/login/logind-seat.h \
611 src/login/logind-session.c \
612 src/login/logind-session.h \
613 src/login/logind-session-device.c \
614 src/login/logind-session-device.h \
615 src/login/logind-user.c \
616 src/login/logind-user.h \
617 src/login/logind-inhibit.c \
618 src/login/logind-inhibit.h \
619 src/login/logind-dbus.c \
620 src/login/logind-session-dbus.c \
621 src/login/logind-seat-dbus.c \
622 src/login/logind-user-dbus.c \
623 src/login/logind-utmp.c \
624 src/login/logind-acl.h \
627 src/core/mount-setup.h \
628 src/core/mount-setup.c
630 libelogind_core_la_LIBADD = \
634 libelogind_core_la_SOURCES += \
635 src/login/logind-acl.c
638 noinst_LTLIBRARIES += \
641 pkglibexec_PROGRAMS += \
645 src/login/loginctl.c \
646 src/login/sysfs-show.h \
647 src/login/sysfs-show.c
652 rootbin_PROGRAMS += \
655 if ENABLE_BASH_COMPLETION
656 dist_bashcompletion_DATA = \
657 shell-completion/bash/loginctl
660 if ENABLE_ZSH_COMPLETION
661 dist_zshcompletion_DATA = \
662 shell-completion/zsh/_loginctl \
663 shell-completion/zsh/_elogind-inhibit
666 elogind_inhibit_SOURCES = \
669 elogind_inhibit_LDADD = \
672 rootbin_PROGRAMS += \
675 test_login_SOURCES = \
676 src/libelogind/sd-login/test-login.c
681 test_login_shared_SOURCES = \
682 src/login/test-login-shared.c
684 test_login_shared_LDADD = \
687 test_inhibit_SOURCES = \
688 src/login/test-inhibit.c
690 test_inhibit_LDADD = \
693 test_login_tables_SOURCES = \
694 src/login/test-login-tables.c
696 test_login_tables_LDADD = \
708 pam_elogind_la_SOURCES = \
709 src/login/pam_elogind.sym \
710 src/login/pam_elogind.c
712 pam_elogind_la_CFLAGS = \
716 pam_elogind_la_LDFLAGS = \
722 -Wl,--version-script=$(top_srcdir)/src/login/pam_elogind.sym
724 pam_elogind_la_LIBADD = \
728 pamlib_LTLIBRARIES = \
731 dist_pamconf_DATA = \
732 src/login/elogind-user
736 dist_dbussystemservice_DATA += \
737 src/login/org.freedesktop.login1.service
739 dist_dbuspolicy_DATA += \
740 src/login/org.freedesktop.login1.conf
742 dist_pkgsysconf_DATA += \
743 src/login/logind.conf
745 polkitpolicy_files += \
746 src/login/org.freedesktop.login1.policy
748 dist_udevrules_DATA += \
749 src/login/70-uaccess.rules \
750 src/login/70-power-switch.rules
752 nodist_udevrules_DATA += \
753 src/login/71-seat.rules \
754 src/login/73-seat-late.rules
756 polkitpolicy_in_files += \
757 src/login/org.freedesktop.login1.policy.in
759 gperf_gperf_sources = \
760 src/login/logind-gperf.gperf
763 src/login/71-seat.rules.in \
764 src/login/73-seat-late.rules.in
766 # ------------------------------------------------------------------------------
768 '|rootbindir=$(rootbindir)|' \
769 '|bindir=$(bindir)|' \
770 '|pkgsysconfdir=$(pkgsysconfdir)|' \
771 '|pkgdatadir=$(pkgdatadir)|' \
772 '|udevrulesdir=$(udevrulesdir)|' \
773 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
774 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
775 '|PACKAGE_URL=$(PACKAGE_URL)|' \
776 '|prefix=$(prefix)|' \
777 '|exec_prefix=$(exec_prefix)|' \
778 '|libdir=$(libdir)|' \
779 '|includedir=$(includedir)|' \
780 '|VERSION=$(VERSION)|' \
781 '|rootprefix=$(rootprefix)|' \
782 '|udevlibexecdir=$(udevlibexecdir)|' \
784 '|MKDIR_P=$(MKDIR_P)|' \
785 '|systemuidmax=$(SYSTEM_UID_MAX)|' \
786 '|systemgidmax=$(SYSTEM_GID_MAX)|' \
787 '|TTY_GID=$(TTY_GID)|'
790 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
791 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
797 sysctl.d/%: sysctl.d/%.in
803 shell-completion/%: shell-completion/%.in
814 $(AM_V_GEN)chmod +x $@
817 $(AM_V_at)$(MKDIR_P) $(dir $@)
818 $(AM_V_GPERF)$(GPERF) < $< > $@
821 $(AM_V_at)$(MKDIR_P) $(dir $@)
822 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
824 sysusers.d/%: sysusers.d/%.m4
825 $(AM_V_at)$(MKDIR_P) $(dir $@)
826 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
828 tmpfiles.d/%: tmpfiles.d/%.m4
829 $(AM_V_at)$(MKDIR_P) $(dir $@)
830 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
834 $(AM_V_at)$(MKDIR_P) $(dir $@)
835 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
837 units/user/%: units/user/%.m4
838 $(AM_V_at)$(MKDIR_P) $(dir $@)
839 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
842 nodist_polkitpolicy_DATA = \
843 $(polkitpolicy_files)
847 $(polkitpolicy_in_files)
849 # ------------------------------------------------------------------------------
851 man/custom-entities.ent: configure.ac
852 $(AM_V_GEN)$(MKDIR_P) $(dir $@)
853 $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
854 printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
858 man/custom-entities.ent
863 --stringparam man.output.quietly 1 \
864 --stringparam funcsynopsis.style ansi \
865 --stringparam man.authors.section.enabled 0 \
866 --stringparam man.copyright.section.enabled 0 \
867 --stringparam elogind.version $(VERSION) \
868 --path '$(builddir)/man:$(srcdir)/man'
870 XSLTPROC_PROCESS_MAN = \
871 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
873 XSLTPROC_PROCESS_HTML = \
874 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
876 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
877 $(XSLTPROC_PROCESS_MAN)
879 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
880 $(XSLTPROC_PROCESS_MAN)
882 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
883 $(XSLTPROC_PROCESS_MAN)
885 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
886 $(XSLTPROC_PROCESS_MAN)
888 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
889 $(XSLTPROC_PROCESS_MAN)
891 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
892 $(XSLTPROC_PROCESS_HTML)
895 $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
901 man/custom-html.xsl \
904 install-exec-hook: $(INSTALL_EXEC_HOOKS)
906 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
908 install-data-hook: $(INSTALL_DATA_HOOKS)
910 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
912 clean-local: $(CLEAN_LOCAL_HOOKS)
913 rm -rf $(abs_srcdir)/install-tree
914 rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
915 $(abs_srcdir)/hwdb/iab.txt
917 DISTCHECK_CONFIGURE_FLAGS = \
918 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
919 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
920 --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
921 --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
922 --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
923 --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
924 --with-rootprefix=$$dc_install_base
927 DISTCHECK_CONFIGURE_FLAGS += \
930 DISTCHECK_CONFIGURE_FLAGS += \
934 .PHONY: dist-check-help
936 dist-check-help: $(rootbin_PROGRAMS)
937 for i in $(abspath $^); do \
938 if $$i --help | grep -v 'default:' | grep -E -q '.{80}.' ; then \
939 echo "$(basename $$i) --help output is too wide:"; \
940 $$i --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
948 git tag -s "v$(VERSION)" -m "elogind $(VERSION)"
952 $(AM_V_at)git archive --format=tar --prefix=elogind-$(VERSION)-raw/ HEAD | \
953 (cd /var/tmp/ && tar xf -)
954 $(AM_V_GEN)(cd /var/tmp && rm -rf elogind-$(VERSION) && $(MKDIR_P) elogind-$(VERSION) && \
955 for f in `find elogind-$(VERSION)-raw/ -type f | cut -d '/' -f 2-` ; do \
956 $(MKDIR_P) elogind-$(VERSION)/`dirname $$f` ; \
957 $(AWK) 'BEGIN { i=0;e=0 } \
958 /^#if\s+0\s*$$/ { i=1;next } \
960 { if ( i==1 ) e=1; else print }{next} \
962 /^#endif\s*\/\/\s*0\s*$$/ { \
963 { if ( i==1 ) { i=0;e=0 } else print }{next} \
965 /^\s*\/\/\/.*elogind.*$$/{ next } \
966 /^\s*\/\/\s*#include.+$$/{ next } \
967 { if ( (i==0) || (e==1) ) print }' \
968 elogind-$(VERSION)-raw/$$f \
969 > elogind-$(VERSION)/$$f ; \
970 chmod `stat -c '%a' elogind-$(VERSION)-raw/$$f` \
971 elogind-$(VERSION)/$$f ; \
973 for l in `find elogind-$(VERSION)-raw/ -type l | cut -d '/' -f 2-` ; do \
974 $(MKDIR_P) elogind-$(VERSION)/`dirname $$l` ; \
975 cp -P elogind-$(VERSION)-raw/$$l elogind-$(VERSION)/$$l ; \
977 tar czf elogind-$(VERSION).tar.gz elogind-$(VERSION) ; \
978 rm -rf elogind-$(VERSION) elogind-$(VERSION)-raw) ; \
979 $(AM_V_at)mv /var/tmp/elogind-$(VERSION).tar.gz ./
983 rm -rf $(abs_srcdir)/install-tree
984 $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
985 tree $(abs_srcdir)/install-tree
987 # Let's run all tests of the test suite, but under valgrind. Let's
988 # exclude the one perl script we have in there
989 .PHONY: valgrind-tests
990 valgrind-tests: $(TESTS)
991 $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
992 if file $$f | grep -q shell; then \
993 echo -e "$${x}Skipping non-binary $$f"; else \
994 echo -e "$${x}Running $$f"; \
995 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
1000 $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
1002 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
1003 $(AM_V_GEN)cat $^ > $@
1005 .PHONY: check-api-docs
1006 check-api-docs: exported man
1007 $(AM_V_GEN)for symbol in `cat exported` ; do \
1008 if test -f $(builddir)/man/$$symbol.html ; then \
1009 echo " Symbol $$symbol() is documented." ; \
1011 echo "‣ Symbol $$symbol() lacks documentation." ; \
1015 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
1016 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
1018 undefined defined: $(ALL_OBJECTS)
1019 $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
1020 $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
1021 done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
1027 .PHONY: check-api-unused
1028 check-api-unused: defined undefined exported
1029 ( cat exported undefined ) | sort -u | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
1031 .PHONY: check-includes
1032 check-includes: $(top_srcdir)/tools/check-includes.pl
1033 $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
1034 | xargs $(top_srcdir)/tools/check-includes.pl
1037 $(top_srcdir)/tools/check-includes.pl
1039 # Stupid test that everything purported to be exported really is
1040 define generate-sym-test
1041 $(AM_V_at)$(MKDIR_P) $(dir $@)
1042 $(AM_V_at)printf '#include <stdio.h>\n' > $@
1043 $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
1044 $(AM_V_at)printf 'void* functions[] = {\n' >> $@
1045 $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
1046 $(AM_V_at)printf '};\nint main(void) {\n' >> $@
1047 $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
1048 $(AM_V_at)printf 'return 0; }\n' >> $@
1051 test-libelogind-sym.c: \
1052 $(top_builddir)/src/libelogind/libelogind.sym \
1053 src/systemd/sd-daemon.h \
1054 src/systemd/sd-login.h \
1055 src/systemd/sd-bus.h \
1056 src/systemd/sd-event.h
1057 $(generate-sym-test)
1059 test_libelogind_sym_SOURCES = \
1060 test-libelogind-sym.c
1061 test_libelogind_sym_LDADD = \
1065 $(test_libelogind_sym_SOURCES)
1072 cppcheck --enable=all -q $(top_srcdir)
1074 # Used to extract compile flags for YCM.
1079 @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u
1082 tools/gdb-sd_dump_hashmaps.py
1085 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
1088 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -