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@
56 # Our own, non-special dirs
57 pkgsysconfdir=$(sysconfdir)/elogind
58 pkgincludedir=$(includedir)/elogind
59 udevrulesdir=@udevrulesdir@
60 udevbindir=@udevbindir@
61 udevlibexecdir=$(udevbindir)
62 udevhomedir=$(udevlibexecdir)
63 udevhwdbdir=$(udevlibexecdir)/hwdb.d
64 factory_pamdir = $(datadir)/factory/etc/pam.d
66 # And these are the special ones for /
67 rootprefix=@rootprefix@
68 rootbindir=$(rootprefix)/bin
69 rootlibexecdir=$(rootprefix)/lib/elogind
74 UNINSTALL_EXEC_HOOKS =
76 UNINSTALL_DATA_HOOKS =
77 DISTCLEAN_LOCAL_HOOKS =
84 polkitpolicy_in_files =
87 nodist_udevrules_DATA =
88 dist_pkgsysconf_DATA =
89 dist_dbuspolicy_DATA =
90 dist_dbussystemservice_DATA =
96 noinst_PROGRAMS = $(manual_tests) $(tests)
103 in_files = $(filter %.in,$(EXTRA_DIST))
104 in_in_files = $(filter %.in.in, $(in_files))
105 m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
107 CLEANFILES = $(BUILT_SOURCES) \
108 $(pkgconfiglib_DATA) \
109 $(in_files:.in=) $(in_in_files:.in.in=) \
112 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
113 $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
114 $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
117 -include $(top_builddir)/config.h \
118 -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
119 -DCERTIFICATE_ROOT=\"$(CERTIFICATEROOT)\" \
120 -DELOGIND_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/elogind-cgroups-agent\" \
121 -DROOTPREFIX=\"$(rootprefix)\" \
122 -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
123 -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
124 -DKEXEC=\"$(KEXEC)\" \
125 -DLIBDIR=\"$(libdir)\" \
126 -DROOTLIBDIR=\"$(rootlibdir)\" \
127 -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
128 -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
129 -I $(top_srcdir)/src \
130 -I $(top_builddir)/src/basic \
131 -I $(top_srcdir)/src/basic \
132 -I $(top_srcdir)/src/shared \
133 -I $(top_builddir)/src/shared \
134 -I $(top_srcdir)/src/login \
135 -I $(top_srcdir)/src/systemd \
136 -I $(top_builddir)/src/core \
137 -I $(top_srcdir)/src/core \
138 -I $(top_srcdir)/src/libelogind/sd-bus \
139 -I $(top_srcdir)/src/libelogind/sd-event \
140 -I $(top_srcdir)/src/libelogind/sd-login \
141 -I $(top_srcdir)/src/libelogind/sd-netlink \
144 AM_CFLAGS = $(OUR_CFLAGS)
145 AM_LDFLAGS = $(OUR_LDFLAGS)
147 # ------------------------------------------------------------------------------
148 define move-to-rootlibdir
149 if test "$(libdir)" != "$(rootlibdir)"; then \
150 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
151 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
152 rm -f $(DESTDIR)$(libdir)/$$libname && \
153 $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
154 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
158 install-touch-usr-hook:
159 touch -c $(DESTDIR)/$(prefix)
161 INSTALL_EXEC_HOOKS += \
162 install-touch-usr-hook
165 # ------------------------------------------------------------------------------
166 AM_V_M4 = $(AM_V_M4_$(V))
167 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
168 AM_V_M4_0 = @echo " M4 " $@;
170 AM_V_XSLT = $(AM_V_XSLT_$(V))
171 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
172 AM_V_XSLT_0 = @echo " XSLT " $@;
174 AM_V_GPERF = $(AM_V_GPERF_$(V))
175 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
176 AM_V_GPERF_0 = @echo " GPERF " $@;
178 AM_V_LN = $(AM_V_LN_$(V))
179 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
180 AM_V_LN_0 = @echo " LN " $@;
182 AM_V_RM = $(AM_V_RM_$(V))
183 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
184 AM_V_RM_0 = @echo " RM " $@;
186 # ------------------------------------------------------------------------------
189 rootlibexec_PROGRAMS =
191 dist_bashcompletion_DATA =
192 dist_zshcompletion_DATA =
201 @INTLTOOL_POLICY_RULE@
203 # ------------------------------------------------------------------------------
208 include Makefile-man.am
210 .PHONY: man update-man-list
211 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
214 ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
216 ${XML_FILES:.xml=.html}
218 ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
235 $(AM_V_at)$(MKDIR_P) $(dir $@)
236 $(AM_V_LN)$(LN_S) -f ../../man $@
245 man/index.html: man/systemd.index.html
246 $(AM_V_LN)$(LN_S) -f systemd.index.html $@
254 XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml)
255 NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
256 SOURCE_XML_FILES = ${patsubst %,$(top_srcdir)/%,$(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))}
258 # This target should only be run manually. It recreates Makefile-man.am
259 # file in the source directory based on all man/*.xml files. Run it after
260 # adding, removing, or changing the conditional in a man page.
261 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB)
262 $(AM_V_GEN)$(PYTHON) $^ > $(top_srcdir)/Makefile-man.tmp
263 $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
264 @echo "Makefile-man.am has been regenerated"
266 man/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
267 $(AM_V_at)$(MKDIR_P) $(dir $@)
268 $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
270 man/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
271 $(AM_V_at)$(MKDIR_P) $(dir $@)
272 $(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
275 man/systemd.index.xml \
276 man/systemd.directives.xml
279 tools/make-man-rules.py
286 $(filter-out man/systemd.directives.xml,$(XML_FILES)) \
292 # ------------------------------------------------------------------------------
293 noinst_LTLIBRARIES += \
296 libbasic_la_SOURCES = \
297 src/basic/missing.h \
298 src/basic/capability.c \
299 src/basic/capability.h \
300 src/basic/conf-files.c \
301 src/basic/conf-files.h \
302 src/basic/hostname-util.h \
303 src/basic/hostname-util.c \
304 src/basic/unit-name.c \
305 src/basic/unit-name.h \
308 src/basic/path-util.c \
309 src/basic/path-util.h \
310 src/basic/time-util.c \
311 src/basic/time-util.h \
312 src/basic/signal-util.c \
313 src/basic/signal-util.h \
314 src/basic/mempool.c \
315 src/basic/mempool.h \
316 src/basic/hashmap.c \
317 src/basic/hashmap.h \
318 src/basic/siphash24.c \
319 src/basic/siphash24.h \
326 src/basic/bus-label.c \
327 src/basic/bus-label.h \
330 src/basic/smack-util.c \
331 src/basic/smack-util.h \
334 src/basic/gunicode.c \
335 src/basic/gunicode.h \
340 src/basic/cgroup-util.c \
341 src/basic/cgroup-util.h \
342 src/basic/errno-list.c \
343 src/basic/errno-list.h \
344 src/basic/terminal-util.c \
345 src/basic/terminal-util.h \
346 src/basic/login-util.h \
347 src/basic/login-util.c \
350 src/basic/memfd-util.c \
351 src/basic/memfd-util.h \
352 src/basic/process-util.c \
353 src/basic/process-util.h \
354 src/basic/random-util.c \
355 src/basic/random-util.h \
360 src/basic/selinux-util.c \
361 src/basic/selinux-util.h \
362 src/basic/mkdir-label.c \
363 src/basic/fileio-label.c \
364 src/basic/fileio-label.h \
368 nodist_libbasic_la_SOURCES = \
369 src/basic/errno-from-name.h \
370 src/basic/errno-to-name.h \
371 src/basic/cap-from-name.h \
372 src/basic/cap-to-name.h
374 libbasic_la_CFLAGS = \
380 libbasic_la_LIBADD = \
387 # -----------------------------------------------------------------------------
388 noinst_LTLIBRARIES += \
391 libshared_la_SOURCES = \
392 src/shared/sleep-config.c \
393 src/shared/sleep-config.h \
394 src/shared/conf-parser.c \
395 src/shared/conf-parser.h \
398 src/shared/spawn-polkit-agent.c \
399 src/shared/spawn-polkit-agent.h \
400 src/shared/apparmor-util.c \
401 src/shared/apparmor-util.h \
402 src/shared/clean-ipc.c \
403 src/shared/clean-ipc.h \
404 src/shared/cgroup-show.c \
405 src/shared/cgroup-show.h \
406 src/shared/bus-util.c \
407 src/shared/bus-util.h
410 libshared_la_SOURCES += \
411 src/shared/seccomp-util.h \
412 src/shared/seccomp-util.c
416 libshared_la_SOURCES += \
417 src/shared/acl-util.c \
418 src/shared/acl-util.h
421 libshared_la_CFLAGS = \
427 libshared_la_LIBADD = \
428 libelogind-internal.la \
434 gperf_txt_sources = \
435 src/basic/errno-list.txt \
436 src/basic/af-list.txt \
437 src/basic/arphrd-list.txt \
438 src/basic/cap-list.txt
441 $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
442 $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
443 $(gperf_txt_sources:-list.txt=-from-name.h) \
444 $(gperf_txt_sources:-list.txt=-to-name.h)
447 $(gperf_txt_sources:-list.txt=-from-name.gperf)
452 $(gperf_gperf_m4_sources) \
453 $(gperf_gperf_sources)
458 %-from-name.gperf: %-list.txt
459 $(AM_V_at)$(MKDIR_P) $(dir $@)
460 $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
462 %-from-name.h: %-from-name.gperf
463 $(AM_V_at)$(MKDIR_P) $(dir $@)
464 $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
467 src/basic/errno-list.txt:
468 $(AM_V_at)$(MKDIR_P) $(dir $@)
469 $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
471 src/basic/errno-to-name.h: src/basic/errno-list.txt
472 $(AM_V_at)$(MKDIR_P) $(dir $@)
473 $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
476 src/basic/af-list.txt:
477 $(AM_V_at)$(MKDIR_P) $(dir $@)
478 $(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; }' >$@
480 src/basic/af-to-name.h: src/basic/af-list.txt
481 $(AM_V_at)$(MKDIR_P) $(dir $@)
482 $(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 "};"}' <$< >$@
485 src/basic/arphrd-list.txt:
486 $(AM_V_at)$(MKDIR_P) $(dir $@)
487 $(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_//' >$@
489 src/basic/arphrd-to-name.h: src/basic/arphrd-list.txt
490 $(AM_V_at)$(MKDIR_P) $(dir $@)
491 $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const arphrd_names[] = { "} !/CISCO/ { printf "[ARPHRD_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
493 src/basic/arphrd-from-name.gperf: src/basic/arphrd-list.txt
494 $(AM_V_at)$(MKDIR_P) $(dir $@)
495 $(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 }' <$< >$@
498 src/basic/cap-list.txt:
499 $(AM_V_at)$(MKDIR_P) $(dir $@)
500 $(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 >$@
502 src/basic/cap-to-name.h: src/basic/cap-list.txt
503 $(AM_V_at)$(MKDIR_P) $(dir $@)
504 $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@
506 src/basic/cap-from-name.gperf: src/basic/cap-list.txt
507 $(AM_V_at)$(MKDIR_P) $(dir $@)
508 $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
510 src/basic/cap-from-name.h: src/basic/cap-from-name.gperf
511 $(AM_V_at)$(MKDIR_P) $(dir $@)
512 $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@
514 # ------------------------------------------------------------------------------
517 dist_factory_pam_DATA = \
518 factory/etc/pam.d/system-auth \
519 factory/etc/pam.d/other
522 # ------------------------------------------------------------------------------
523 rootlibexec_PROGRAMS += \
524 elogind-cgroups-agent
526 elogind_cgroups_agent_SOURCES = \
527 src/cgroups-agent/cgroups-agent.c
529 elogind_cgroups_agent_LDADD = \
532 # ------------------------------------------------------------------------------
533 libelogind_internal_la_SOURCES = \
534 src/systemd/sd-bus.h \
535 src/systemd/sd-bus-protocol.h \
536 src/systemd/sd-bus-vtable.h \
537 src/systemd/sd-event.h \
538 src/systemd/sd-login.h \
539 src/systemd/sd-id128.h \
540 src/systemd/sd-daemon.h \
541 src/systemd/sd-path.h \
542 src/libelogind/libelogind.sym \
543 src/libelogind/sd-bus/sd-bus.c \
544 src/libelogind/sd-bus/bus-control.c \
545 src/libelogind/sd-bus/bus-control.h \
546 src/libelogind/sd-bus/bus-error.c \
547 src/libelogind/sd-bus/bus-error.h \
548 src/libelogind/sd-bus/bus-common-errors.h \
549 src/libelogind/sd-bus/bus-common-errors.c \
550 src/libelogind/sd-bus/bus-internal.c \
551 src/libelogind/sd-bus/bus-internal.h \
552 src/libelogind/sd-bus/bus-socket.c \
553 src/libelogind/sd-bus/bus-socket.h \
554 src/libelogind/sd-bus/bus-kernel.c \
555 src/libelogind/sd-bus/bus-kernel.h \
556 src/libelogind/sd-bus/bus-message.c \
557 src/libelogind/sd-bus/bus-message.h \
558 src/libelogind/sd-bus/bus-creds.c \
559 src/libelogind/sd-bus/bus-creds.h \
560 src/libelogind/sd-bus/bus-signature.c \
561 src/libelogind/sd-bus/bus-signature.h \
562 src/libelogind/sd-bus/bus-type.c \
563 src/libelogind/sd-bus/bus-type.h \
564 src/libelogind/sd-bus/bus-match.c \
565 src/libelogind/sd-bus/bus-match.h \
566 src/libelogind/sd-bus/bus-bloom.c \
567 src/libelogind/sd-bus/bus-bloom.h \
568 src/libelogind/sd-bus/bus-introspect.c \
569 src/libelogind/sd-bus/bus-introspect.h \
570 src/libelogind/sd-bus/bus-objects.c \
571 src/libelogind/sd-bus/bus-objects.h \
572 src/libelogind/sd-bus/bus-gvariant.c \
573 src/libelogind/sd-bus/bus-gvariant.h \
574 src/libelogind/sd-bus/bus-convenience.c \
575 src/libelogind/sd-bus/bus-track.c \
576 src/libelogind/sd-bus/bus-track.h \
577 src/libelogind/sd-bus/bus-slot.c \
578 src/libelogind/sd-bus/bus-slot.h \
579 src/libelogind/sd-bus/bus-protocol.h \
580 src/libelogind/sd-event/sd-event.c \
581 src/libelogind/sd-event/event-util.h \
582 src/libelogind/sd-id128/sd-id128.c \
583 src/libelogind/sd-daemon/sd-daemon.c \
584 src/libelogind/sd-login/sd-login.c \
585 src/libelogind/sd-path/sd-path.c
587 libelogind_internal_la_LIBADD = \
591 noinst_LTLIBRARIES += \
592 libelogind-internal.la
595 src/libelogind/libelogind.pc.in \
596 src/libelogind/sd-bus/DIFFERENCES \
597 src/libelogind/sd-bus/GVARIANT-SERIALIZATION
599 libelogind_la_SOURCES = \
600 $(libelogind_internal_la_SOURCES)
602 nodist_libelogind_la_SOURCES = \
603 $(nodist_libelogind_internal_la_SOURCES)
605 libelogind_la_CFLAGS = \
606 $(libelogind_internal_la_CFLAGS)
608 libelogind_la_LDFLAGS = \
610 -version-info $(LIBELOGIND_CURRENT):$(LIBELOGIND_REVISION):$(LIBELOGIND_AGE) \
611 -Wl,--version-script=$(top_srcdir)/src/libelogind/libelogind.sym
613 libelogind_la_LIBADD = \
614 $(libelogind_internal_la_LIBADD)
616 libelogind-install-hook:
617 libname=libelogind.so && $(move-to-rootlibdir)
619 libelogind-uninstall-hook:
620 rm -f $(DESTDIR)$(rootlibdir)/libelogind.so*
622 INSTALL_EXEC_HOOKS += libelogind-install-hook
623 UNINSTALL_EXEC_HOOKS += libelogind-uninstall-hook
625 pkgconfiglib_DATA += \
626 src/libelogind/libelogind.pc
628 pkginclude_HEADERS += \
629 src/systemd/sd-bus.h \
630 src/systemd/sd-bus-protocol.h \
631 src/systemd/sd-bus-vtable.h \
632 src/systemd/sd-event.h \
633 src/systemd/sd-login.h \
634 src/systemd/sd-id128.h \
635 src/systemd/sd-daemon.h
640 # ------------------------------------------------------------------------------
645 nodist_elogind_SOURCES = \
646 src/login/logind-gperf.c
651 libelogind_core_la_SOURCES = \
652 src/login/logind-core.c \
653 src/login/logind-device.c \
654 src/login/logind-device.h \
655 src/login/logind-button.c \
656 src/login/logind-button.h \
657 src/login/logind-action.c \
658 src/login/logind-action.h \
659 src/login/logind-seat.c \
660 src/login/logind-seat.h \
661 src/login/logind-session.c \
662 src/login/logind-session.h \
663 src/login/logind-session-device.c \
664 src/login/logind-session-device.h \
665 src/login/logind-user.c \
666 src/login/logind-user.h \
667 src/login/logind-inhibit.c \
668 src/login/logind-inhibit.h \
669 src/login/logind-dbus.c \
670 src/login/logind-session-dbus.c \
671 src/login/logind-seat-dbus.c \
672 src/login/logind-user-dbus.c \
673 src/login/logind-utmp.c \
674 src/login/logind-acl.h
676 libelogind_core_la_LIBADD = \
680 libelogind_core_la_SOURCES += \
681 src/login/logind-acl.c
684 noinst_LTLIBRARIES += \
687 rootlibexec_PROGRAMS += \
691 src/login/loginctl.c \
692 src/login/sysfs-show.h \
693 src/login/sysfs-show.c
698 rootbin_PROGRAMS += \
701 dist_bashcompletion_DATA += \
702 shell-completion/bash/loginctl
704 dist_zshcompletion_DATA += \
705 shell-completion/zsh/_loginctl \
706 shell-completion/zsh/_elogind-inhibit
708 elogind_inhibit_SOURCES = \
711 elogind_inhibit_LDADD = \
714 rootbin_PROGRAMS += \
717 test_login_SOURCES = \
718 src/libelogind/sd-login/test-login.c
723 test_login_shared_SOURCES = \
724 src/login/test-login-shared.c
726 test_login_shared_LDADD = \
729 test_inhibit_SOURCES = \
730 src/login/test-inhibit.c
732 test_inhibit_LDADD = \
735 test_login_tables_SOURCES = \
736 src/login/test-login-tables.c
738 test_login_tables_LDADD = \
750 pam_elogind_la_SOURCES = \
751 src/login/pam_elogind.sym \
752 src/login/pam_elogind.c
754 pam_elogind_la_CFLAGS = \
758 pam_elogind_la_LDFLAGS = \
764 -Wl,--version-script=$(top_srcdir)/src/login/pam_elogind.sym
766 pam_elogind_la_LIBADD = \
770 pamlib_LTLIBRARIES = \
773 dist_pamconf_DATA = \
774 src/login/elogind-user
778 dist_dbussystemservice_DATA += \
779 src/login/org.freedesktop.login1.service
781 dist_dbuspolicy_DATA += \
782 src/login/org.freedesktop.login1.conf
784 dist_pkgsysconf_DATA += \
785 src/login/elogind.conf
787 polkitpolicy_files += \
788 src/login/org.freedesktop.login1.policy
790 dist_udevrules_DATA += \
791 src/login/70-uaccess.rules \
792 src/login/70-power-switch.rules
794 nodist_udevrules_DATA += \
795 src/login/71-seat.rules \
796 src/login/73-seat-late.rules
798 polkitpolicy_in_files += \
799 src/login/org.freedesktop.login1.policy.in
801 gperf_gperf_sources = \
802 src/login/logind-gperf.gperf
805 src/login/71-seat.rules.in \
806 src/login/73-seat-late.rules.in
808 # ------------------------------------------------------------------------------
810 '|rootlibexecdir=$(rootlibexecdir)|' \
811 '|rootbindir=$(rootbindir)|' \
812 '|bindir=$(bindir)|' \
813 '|pkgsysconfdir=$(pkgsysconfdir)|' \
814 '|pkgdatadir=$(pkgdatadir)|' \
815 '|udevhwdbdir=$(udevhwdbdir)|' \
816 '|udevrulesdir=$(udevrulesdir)|' \
817 '|CERTIFICATEROOT=$(CERTIFICATEROOT)|' \
818 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
819 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
820 '|PACKAGE_URL=$(PACKAGE_URL)|' \
821 '|prefix=$(prefix)|' \
822 '|exec_prefix=$(exec_prefix)|' \
823 '|libdir=$(libdir)|' \
824 '|includedir=$(includedir)|' \
825 '|VERSION=$(VERSION)|' \
826 '|rootprefix=$(rootprefix)|' \
827 '|udevlibexecdir=$(udevlibexecdir)|' \
828 '|SUSHELL=$(SUSHELL)|' \
829 '|SULOGIN=$(SULOGIN)|' \
830 '|DEBUGTTY=$(DEBUGTTY)|' \
833 '|MKDIR_P=$(MKDIR_P)|' \
834 '|QUOTAON=$(QUOTAON)|' \
835 '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
836 '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
837 '|PYTHON=$(PYTHON)|' \
838 '|PYTHON_BINARY=$(PYTHON_BINARY)|' \
839 '|NTP_SERVERS=$(NTP_SERVERS)|' \
840 '|DNS_SERVERS=$(DNS_SERVERS)|' \
841 '|systemuidmax=$(SYSTEM_UID_MAX)|' \
842 '|systemgidmax=$(SYSTEM_GID_MAX)|' \
843 '|TTY_GID=$(TTY_GID)|'
846 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
847 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
853 sysctl.d/%: sysctl.d/%.in
862 shell-completion/%: shell-completion/%.in
873 $(AM_V_GEN)chmod +x $@
876 $(AM_V_at)$(MKDIR_P) $(dir $@)
877 $(AM_V_GPERF)$(GPERF) < $< > $@
880 $(AM_V_at)$(MKDIR_P) $(dir $@)
881 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
883 sysusers.d/%: sysusers.d/%.m4
884 $(AM_V_at)$(MKDIR_P) $(dir $@)
885 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
887 tmpfiles.d/%: tmpfiles.d/%.m4
888 $(AM_V_at)$(MKDIR_P) $(dir $@)
889 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
893 $(AM_V_at)$(MKDIR_P) $(dir $@)
894 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
896 units/user/%: units/user/%.m4
897 $(AM_V_at)$(MKDIR_P) $(dir $@)
898 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
901 nodist_polkitpolicy_DATA = \
902 $(polkitpolicy_files)
906 $(polkitpolicy_in_files)
908 # ------------------------------------------------------------------------------
910 man/custom-entities.ent: configure.ac
911 $(AM_V_GEN)$(MKDIR_P) $(dir $@)
912 $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
913 printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
917 man/custom-entities.ent
922 --stringparam man.output.quietly 1 \
923 --stringparam funcsynopsis.style ansi \
924 --stringparam man.authors.section.enabled 0 \
925 --stringparam man.copyright.section.enabled 0 \
926 --stringparam elogind.version $(VERSION) \
927 --path '$(builddir)/man:$(srcdir)/man'
929 XSLTPROC_PROCESS_MAN = \
930 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
932 XSLTPROC_PROCESS_HTML = \
933 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
935 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
936 $(XSLTPROC_PROCESS_MAN)
938 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
939 $(XSLTPROC_PROCESS_MAN)
941 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
942 $(XSLTPROC_PROCESS_MAN)
944 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
945 $(XSLTPROC_PROCESS_MAN)
947 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
948 $(XSLTPROC_PROCESS_MAN)
950 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
951 $(XSLTPROC_PROCESS_HTML)
954 $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
960 man/custom-html.xsl \
963 install-exec-hook: $(INSTALL_EXEC_HOOKS)
965 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
967 install-data-hook: $(INSTALL_DATA_HOOKS)
969 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
971 clean-local: $(CLEAN_LOCAL_HOOKS)
972 rm -rf $(abs_srcdir)/install-tree
973 rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
974 $(abs_srcdir)/hwdb/iab.txt
976 DISTCHECK_CONFIGURE_FLAGS = \
977 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
978 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
979 --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
980 --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
981 --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
982 --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
983 --with-rootprefix=$$dc_install_base \
986 DISTCHECK_CONFIGURE_FLAGS += \
987 --with-sysvinit-path= \
988 --with-sysvrcnd-path=
991 DISTCHECK_CONFIGURE_FLAGS += \
994 DISTCHECK_CONFIGURE_FLAGS += \
999 # Require python when making dist
1001 .PHONY: dist-check-python dist-check-compat-libs dist-check-help
1004 dist-check-compat-libs:
1006 dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS)
1007 for i in $(abspath $^); do \
1008 if $$i --help | grep -v 'default:' | grep -E -q '.{80}.' ; then \
1009 echo "$(basename $$i) --help output is too wide:"; \
1010 $$i --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
1014 dist: dist-check-python dist-check-compat-libs
1018 git tag -s "v$(VERSION)" -m "elogind $(VERSION)"
1020 .PHONY: install-tree
1022 rm -rf $(abs_srcdir)/install-tree
1023 $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
1024 tree $(abs_srcdir)/install-tree
1026 # Let's run all tests of the test suite, but under valgrind. Let's
1027 # exclude the one perl script we have in there
1028 .PHONY: valgrind-tests
1029 valgrind-tests: $(TESTS)
1030 $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
1031 if file $$f | grep -q shell; then \
1032 echo -e "$${x}Skipping non-binary $$f"; else \
1033 echo -e "$${x}Running $$f"; \
1034 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
1039 $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
1041 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
1042 $(AM_V_GEN)cat $^ > $@
1044 .PHONY: check-api-docs
1045 check-api-docs: exported man
1046 $(AM_V_GEN)for symbol in `cat exported` ; do \
1047 if test -f $(builddir)/man/$$symbol.html ; then \
1048 echo " Symbol $$symbol() is documented." ; \
1050 echo "‣ Symbol $$symbol() lacks documentation." ; \
1054 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
1055 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
1057 undefined defined: $(ALL_OBJECTS)
1058 $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
1059 $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
1060 done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
1066 .PHONY: check-api-unused
1067 check-api-unused: defined undefined exported
1068 ( cat exported undefined ) | sort -u | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
1070 .PHONY: check-includes
1071 check-includes: $(top_srcdir)/tools/check-includes.pl
1072 $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
1073 | xargs $(top_srcdir)/tools/check-includes.pl
1076 $(top_srcdir)/tools/check-includes.pl
1078 # Stupid test that everything purported to be exported really is
1079 define generate-sym-test
1080 $(AM_V_at)$(MKDIR_P) $(dir $@)
1081 $(AM_V_at)printf '#include <stdio.h>\n' > $@
1082 $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
1083 $(AM_V_at)printf 'void* functions[] = {\n' >> $@
1084 $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
1085 $(AM_V_at)printf '};\nint main(void) {\n' >> $@
1086 $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
1087 $(AM_V_at)printf 'return 0; }\n' >> $@
1090 test-libelogind-sym.c: \
1091 $(top_builddir)/src/libelogind/libelogind.sym \
1092 src/systemd/sd-daemon.h \
1093 src/systemd/sd-login.h \
1094 src/systemd/sd-bus.h \
1095 src/systemd/sd-path.h \
1096 src/systemd/sd-event.h
1097 $(generate-sym-test)
1099 test_libelogind_sym_SOURCES = \
1100 test-libelogind-sym.c
1101 test_libelogind_sym_LDADD = \
1105 $(test_libelogind_sym_SOURCES)
1112 cppcheck --enable=all -q $(top_srcdir)
1114 # Used to extract compile flags for YCM.
1119 @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u
1122 tools/gdb-sd_dump_hashmaps.py
1125 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
1128 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -