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 polkitrulesdir=$(datadir)/polkit-1/rules.d
54 polkitpkladir=$(localstatedir)/lib/polkit-1/localauthority/10-vendor.d
55 bashcompletiondir=@bashcompletiondir@
56 zshcompletiondir=@zshcompletiondir@
58 CGROUP_CONTROLLER=@cgroup_controller@
59 PKTTYAGENT=$(bindir)/pkttyagent
61 # Our own, non-special dirs
62 pkgsysconfdir=$(sysconfdir)/elogind
63 pkgincludedir=$(includedir)/elogind/systemd
64 udevrulesdir=@udevrulesdir@
65 udevbindir=@udevbindir@
66 udevlibexecdir=$(udevbindir)
67 udevhomedir=$(udevlibexecdir)
68 systemshutdowndir=$(rootlibexecdir)/system-shutdown
69 systemsleepdir=$(rootlibexecdir)/system-sleep
70 factory_pamdir = $(datadir)/factory/etc/pam.d
72 # And these are the special ones for /
73 rootprefix=@rootprefix@
74 rootbindir=$(rootprefix)/bin
75 rootlibexecdir=$(rootprefix)/lib/elogind
80 UNINSTALL_EXEC_HOOKS =
81 DISTCLEAN_LOCAL_HOOKS =
88 polkitpolicy_in_files =
93 nodist_udevrules_DATA =
94 dist_pkgsysconf_DATA =
95 nodist_pkgsysconf_DATA =
96 dist_dbuspolicy_DATA =
97 dist_dbussystemservice_DATA =
100 dist_rootlibexec_DATA =
101 rootlib_LTLIBRARIES =
105 noinst_PROGRAMS = $(manual_tests) $(tests)
112 if ENABLE_BASH_COMPLETION
113 dist_bashcompletion_DATA = $(dist_bashcompletion_data)
115 if ENABLE_ZSH_COMPLETION
116 dist_zshcompletion_DATA = $(dist_zshcompletion_data)
119 in_files = $(filter %.in,$(EXTRA_DIST))
120 in_in_files = $(filter %.in.in, $(in_files))
121 m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
123 CLEANFILES = $(BUILT_SOURCES) \
124 $(pkgconfiglib_DATA) \
125 $(in_files:.in=) $(in_in_files:.in.in=) \
128 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
129 $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
132 -include $(top_builddir)/config.h \
133 -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
134 -DSYSTEMD_CGROUP_CONTROLLER=\"_$(CGROUP_CONTROLLER)\" \
135 -DSYSTEMD_CGROUP_CONTROLLER_LEGACY=\"name=$(CGROUP_CONTROLLER)\" \
136 -DSYSTEMD_CGROUP_CONTROLLER_HYBRID=\"name=$(CGROUP_CONTROLLER)\" \
137 -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/elogind-cgroups-agent\" \
138 -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
139 -DPOLKIT_AGENT_BINARY_PATH=\"$(PKTTYAGENT)\" \
140 -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
141 -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
143 -DREBOOT=\"$(REBOOT)\" \
144 -DKEXEC=\"$(KEXEC)\" \
145 -DLIBDIR=\"$(libdir)\" \
146 -DROOTLIBDIR=\"$(rootlibdir)\" \
147 -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
148 -I $(top_srcdir)/src \
149 -I $(top_builddir)/src/basic \
150 -I $(top_srcdir)/src/basic \
151 -I $(top_srcdir)/src/core \
152 -I $(top_srcdir)/src/shared \
153 -I $(top_builddir)/src/shared \
154 -I $(top_srcdir)/src/login \
155 -I $(top_srcdir)/src/systemd \
156 -I $(top_srcdir)/src/libelogind/sd-bus \
157 -I $(top_srcdir)/src/libelogind/sd-event \
158 -I $(top_srcdir)/src/libelogind/sd-login \
159 -I $(top_srcdir)/src/libelogind/sd-id128 \
160 -I $(top_srcdir)/src/update-utmp \
161 -I $(top_srcdir)/src/sleep \
162 -DABS_SRC_DIR=\"$(abs_top_srcdir)\" \
163 -DABS_BUILD_DIR=\"$(abs_top_builddir)\" \
166 AM_CFLAGS = $(OUR_CFLAGS)
167 AM_LDFLAGS = $(OUR_LDFLAGS)
169 # ------------------------------------------------------------------------------
170 install-touch-usr-hook:
171 touch -c $(DESTDIR)/$(prefix)
173 INSTALL_EXEC_HOOKS += \
174 install-touch-usr-hook
177 # ------------------------------------------------------------------------------
178 AM_V_M4 = $(AM_V_M4_$(V))
179 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
180 AM_V_M4_0 = @echo " M4 " $@;
182 AM_V_XSLT = $(AM_V_XSLT_$(V))
183 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
184 AM_V_XSLT_0 = @echo " XSLT " $@;
186 AM_V_GPERF = $(AM_V_GPERF_$(V))
187 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
188 AM_V_GPERF_0 = @echo " GPERF " $@;
190 AM_V_LN = $(AM_V_LN_$(V))
191 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
192 AM_V_LN_0 = @echo " LN " $@;
194 AM_V_RM = $(AM_V_RM_$(V))
195 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
196 AM_V_RM_0 = @echo " RM " $@;
198 # ------------------------------------------------------------------------------
200 pkglibexec_PROGRAMS =
208 @INTLTOOL_POLICY_RULE@
210 # ------------------------------------------------------------------------------
215 include Makefile-man.am
217 .PHONY: man update-man-list
218 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
221 ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
223 ${XML_FILES:.xml=.html}
225 ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
245 $(AM_V_at)$(MKDIR_P) $(dir $@)
246 $(AM_V_LN)$(LN_S) -f ../../man $@
248 man/index.html: man/elogind.index.html
249 $(AM_V_LN)$(LN_S) -f elogind.index.html $@
259 XML_GLOB := $(wildcard $(top_srcdir)/man/*.xml)
260 DIRECTIVE_FILE := man/elogind.directives.xml
261 INDEX_XML_FILE := man/elogind.index.xml
262 NON_INDEX_XML_FILES := $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_FILES))
263 ALL_XML_FILES := $(INDEX_XML_FILE) $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_GLOB))
264 SOURCE_XML_FILES := ${patsubst %,$(top_srcdir)/%,$(filter-out $(DIRECTIVE_FILE),$(NON_INDEX_XML_FILES))}
266 # This target should only be run manually. It recreates Makefile-man.am
267 # file in the source directory based on all man/*.xml files. Run it after
268 # adding, removing, or changing the conditional in a man page.
269 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(ALL_XML_FILES) man/custom-entities.ent
270 $(AM_V_GEN)$(PYTHON) $< $(ALL_XML_FILES) > $(top_srcdir)/Makefile-man.tmp
271 $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
272 @echo "Makefile-man.am has been regenerated"
274 $(INDEX_XML_FILE): $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
275 $(AM_V_at)$(MKDIR_P) $(dir $@)
276 $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
278 $(DIRECTIVE_FILE): $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
279 $(AM_V_at)$(MKDIR_P) $(dir $@)
280 $(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
287 $(filter-out $(DIRECTIVE_FILE) $(INDEX_XML_FILE),$(XML_FILES)) \
288 tools/make-man-index.py \
289 tools/make-man-rules.py \
290 tools/make-directive-index.py \
291 tools/xml_helper.py \
292 man/glib-event-glue.c
294 # ------------------------------------------------------------------------------
295 noinst_LTLIBRARIES += \
298 libbasic_la_SOURCES = \
299 src/basic/missing.h \
300 src/basic/capability-util.c \
301 src/basic/capability-util.h \
302 src/basic/conf-files.c \
303 src/basic/conf-files.h \
304 src/basic/stdio-util.h \
305 src/basic/hostname-util.h \
306 src/basic/hostname-util.c \
307 src/basic/unit-name.c \
308 src/basic/unit-name.h \
309 src/basic/unaligned.h \
312 src/basic/io-util.c \
313 src/basic/io-util.h \
314 src/basic/string-util.c \
315 src/basic/string-util.h \
316 src/basic/parse-util.c \
317 src/basic/parse-util.h \
318 src/basic/fd-util.c \
319 src/basic/fd-util.h \
320 src/basic/user-util.c \
321 src/basic/user-util.h \
322 src/basic/dirent-util.c \
323 src/basic/dirent-util.h \
324 src/basic/xattr-util.c \
325 src/basic/xattr-util.h \
326 src/basic/proc-cmdline.c \
327 src/basic/proc-cmdline.h \
328 src/basic/fs-util.c \
329 src/basic/fs-util.h \
330 src/basic/syslog-util.c \
331 src/basic/syslog-util.h \
332 src/basic/stat-util.c \
333 src/basic/stat-util.h \
334 src/basic/mount-util.c \
335 src/basic/mount-util.h \
336 src/basic/hexdecoct.c \
337 src/basic/hexdecoct.h \
338 src/basic/extract-word.c \
339 src/basic/extract-word.h \
342 src/basic/path-util.c \
343 src/basic/path-util.h \
344 src/basic/parse-printf-format.c \
345 src/basic/parse-printf-format.h \
346 src/basic/time-util.c \
347 src/basic/time-util.h \
348 src/basic/locale-util.c \
349 src/basic/locale-util.h \
350 src/basic/umask-util.h \
351 src/basic/signal-util.c \
352 src/basic/signal-util.h \
353 src/basic/string-table.c \
354 src/basic/string-table.h \
355 src/basic/mempool.c \
356 src/basic/mempool.h \
357 src/basic/hashmap.c \
358 src/basic/hashmap.h \
359 src/basic/hash-funcs.c \
360 src/basic/hash-funcs.h \
361 src/basic/siphash24.c \
362 src/basic/siphash24.h \
367 src/basic/env-util.c \
368 src/basic/env-util.h \
371 src/basic/bus-label.c \
372 src/basic/bus-label.h \
373 src/basic/exec-util.c \
374 src/basic/exec-util.h \
377 src/basic/smack-util.c \
378 src/basic/smack-util.h \
381 src/basic/gunicode.c \
382 src/basic/gunicode.h \
383 src/basic/socket-util.c \
384 src/basic/socket-util.h \
389 src/basic/cgroup-util.c \
390 src/basic/cgroup-util.h \
391 src/basic/errno-list.c \
392 src/basic/errno-list.h \
393 src/basic/terminal-util.c \
394 src/basic/terminal-util.h \
395 src/basic/login-util.h \
396 src/basic/login-util.c \
397 src/basic/audit-util.c \
398 src/basic/audit-util.h \
399 src/basic/memfd-util.c \
400 src/basic/memfd-util.h \
401 src/basic/process-util.c \
402 src/basic/process-util.h \
403 src/basic/random-util.c \
404 src/basic/random-util.h \
409 src/basic/selinux-util.c \
410 src/basic/selinux-util.h \
411 src/basic/mkdir-label.c \
412 src/basic/fileio-label.c \
413 src/basic/fileio-label.h \
418 src/basic/alloc-util.h \
419 src/basic/alloc-util.c \
420 src/basic/format-util.h \
424 nodist_libbasic_la_SOURCES = \
425 src/basic/errno-from-name.h \
426 src/basic/errno-to-name.h
428 libbasic_la_CFLAGS = \
434 libbasic_la_LDFLAGS = \
437 libbasic_la_LIBADD = \
443 # -----------------------------------------------------------------------------
444 noinst_LTLIBRARIES += \
447 libshared_la_SOURCES = \
448 src/shared/bus-util.c \
449 src/shared/bus-util.h \
450 src/shared/clean-ipc.c \
451 src/shared/clean-ipc.h \
452 src/shared/conf-parser.c \
453 src/shared/conf-parser.h \
454 src/shared/musl_missing.h \
455 src/shared/musl_missing.c \
458 src/shared/sleep-config.c \
459 src/shared/sleep-config.h \
460 src/shared/spawn-polkit-agent.c \
461 src/shared/spawn-polkit-agent.h \
462 src/shared/nsflags.h \
466 libshared_la_SOURCES += \
467 src/shared/acl-util.c \
468 src/shared/acl-util.h
471 libshared_la_CFLAGS = \
475 libshared_la_LIBADD = \
476 libelogind-internal.la \
481 noinst_LTLIBRARIES += \
484 libelogind_shared_la_SOURCES = \
485 $(libbasic_la_SOURCES) \
486 $(libshared_la_SOURCES) \
487 $(libelogind_internal_la_SOURCES)
489 libelogind_shared_la_CFLAGS = \
491 $(libbasic_la_CFLAGS) \
492 $(libshared_la_CFLAGS) \
493 $(libelogind_internal_la_CFLAGS) \
494 $(libelogind_journal_internal_la_CFLAGS) \
495 $(libudev_internal_la_CFLAGS) \
501 # We can't use libshared_la_LIBADD here because it would
502 # pull in libelogind*-internal.la
503 libelogind_shared_la_LIBADD = \
504 $(libbasic_la_LIBADD) \
505 $(libelogind_internal_la_LIBADD) \
511 libelogind_shared_la_LDFLAGS = \
513 # -----------------------------------------------------------------------------
514 gperf_txt_sources = \
515 src/basic/errno-list.txt
518 $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
519 $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
520 $(gperf_txt_sources:-list.txt=-from-name.h) \
521 $(gperf_txt_sources:-list.txt=-to-name.h)
524 $(gperf_txt_sources:-list.txt=-from-name.gperf)
529 $(gperf_gperf_m4_sources) \
530 $(gperf_gperf_sources)
535 %-from-name.gperf: %-list.txt
536 $(AM_V_at)$(MKDIR_P) $(dir $@)
537 $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
539 %-from-name.h: %-from-name.gperf
540 $(AM_V_at)$(MKDIR_P) $(dir $@)
541 $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
544 src/basic/errno-list.txt:
545 $(AM_V_at)$(MKDIR_P) $(dir $@)
546 $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
548 src/basic/errno-to-name.h: src/basic/errno-list.txt
549 $(AM_V_at)$(MKDIR_P) $(dir $@)
550 $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
553 # ------------------------------------------------------------------------------
556 dist_factory_pam_DATA = \
557 factory/etc/pam.d/system-auth \
558 factory/etc/pam.d/other
561 # ------------------------------------------------------------------------------
562 pkglibexec_PROGRAMS += \
563 elogind-cgroups-agent
565 elogind_cgroups_agent_SOURCES = \
566 src/cgroups-agent/cgroups-agent.c
568 elogind_cgroups_agent_LDADD = \
571 # ------------------------------------------------------------------------------
572 libelogind_internal_la_SOURCES = \
573 src/systemd/sd-bus.h \
574 src/systemd/sd-bus-protocol.h \
575 src/systemd/sd-bus-vtable.h \
576 src/systemd/sd-event.h \
577 src/systemd/sd-login.h \
578 src/systemd/sd-id128.h \
579 src/systemd/sd-daemon.h \
580 src/libelogind/libelogind.sym \
581 src/libelogind/sd-bus/sd-bus.c \
582 src/libelogind/sd-bus/bus-control.c \
583 src/libelogind/sd-bus/bus-control.h \
584 src/libelogind/sd-bus/bus-error.c \
585 src/libelogind/sd-bus/bus-error.h \
586 src/libelogind/sd-bus/bus-common-errors.h \
587 src/libelogind/sd-bus/bus-common-errors.c \
588 src/libelogind/sd-bus/bus-internal.c \
589 src/libelogind/sd-bus/bus-internal.h \
590 src/libelogind/sd-bus/bus-socket.c \
591 src/libelogind/sd-bus/bus-socket.h \
592 src/libelogind/sd-bus/bus-kernel.c \
593 src/libelogind/sd-bus/bus-kernel.h \
594 src/libelogind/sd-bus/bus-container.c \
595 src/libelogind/sd-bus/bus-container.h \
596 src/libelogind/sd-bus/bus-message.c \
597 src/libelogind/sd-bus/bus-message.h \
598 src/libelogind/sd-bus/bus-creds.c \
599 src/libelogind/sd-bus/bus-creds.h \
600 src/libelogind/sd-bus/bus-signature.c \
601 src/libelogind/sd-bus/bus-signature.h \
602 src/libelogind/sd-bus/bus-type.c \
603 src/libelogind/sd-bus/bus-type.h \
604 src/libelogind/sd-bus/bus-match.c \
605 src/libelogind/sd-bus/bus-match.h \
606 src/libelogind/sd-bus/bus-bloom.c \
607 src/libelogind/sd-bus/bus-bloom.h \
608 src/libelogind/sd-bus/bus-introspect.c \
609 src/libelogind/sd-bus/bus-introspect.h \
610 src/libelogind/sd-bus/bus-objects.c \
611 src/libelogind/sd-bus/bus-objects.h \
612 src/libelogind/sd-bus/bus-gvariant.c \
613 src/libelogind/sd-bus/bus-gvariant.h \
614 src/libelogind/sd-bus/bus-convenience.c \
615 src/libelogind/sd-bus/bus-track.c \
616 src/libelogind/sd-bus/bus-track.h \
617 src/libelogind/sd-bus/bus-slot.c \
618 src/libelogind/sd-bus/bus-slot.h \
619 src/libelogind/sd-bus/bus-protocol.h \
620 src/libelogind/sd-event/sd-event.c \
621 src/libelogind/sd-id128/sd-id128.c \
622 src/libelogind/sd-id128/id128-util.h \
623 src/libelogind/sd-id128/id128-util.c \
624 src/libelogind/sd-daemon/sd-daemon.c \
625 src/libelogind/sd-login/sd-login.c
627 noinst_LTLIBRARIES += \
628 libelogind-internal.la
631 src/libelogind/libelogind.pc.in \
632 src/libelogind/sd-bus/DIFFERENCES \
633 src/libelogind/sd-bus/GVARIANT-SERIALIZATION
635 libelogind_la_SOURCES =
637 libelogind_la_LDFLAGS = \
639 -version-info $(LIBELOGIND_CURRENT):$(LIBELOGIND_REVISION):$(LIBELOGIND_AGE) \
640 -Wl,--version-script=$(top_srcdir)/src/libelogind/libelogind.sym
642 libelogind_la_LIBADD = \
643 libelogind-internal.la \
646 pkgconfiglib_DATA += \
647 src/libelogind/libelogind.pc
649 pkginclude_HEADERS += \
650 src/systemd/sd-login.h \
651 src/systemd/sd-messages.h \
652 src/systemd/sd-id128.h \
653 src/systemd/_sd-common.h
656 $(MKDIR_P) $(DESTDIR)/$(pkgincludedir)
657 cd $(DESTDIR)/$(includedir)/elogind && \
658 for hdr in $(notdir $(pkginclude_HEADERS)) ; do \
660 $(LN_S) systemd/$$hdr $$hdr ; \
663 header-uninstall-hook:
664 m -f $(DESTDIR)/$(includedir)/elogind/*.h
666 INSTALL_EXEC_HOOKS += header-install-hook
667 UNINSTALL_EXEC_HOOKS += header-uninstall-hook
669 rootlib_LTLIBRARIES += \
672 # ------------------------------------------------------------------------------
677 nodist_elogind_SOURCES = \
678 src/login/logind-gperf.c
683 libelogind_core_la_SOURCES = \
686 src/core/mount-setup.h \
687 src/core/mount-setup.c \
688 src/login/elogind.c \
689 src/login/elogind.h \
690 src/login/elogind-action.c \
691 src/login/elogind-action.h \
692 src/login/elogind-dbus.c \
693 src/login/elogind-dbus.h \
694 src/login/logind-core.c \
695 src/login/logind-device.c \
696 src/login/logind-device.h \
697 src/login/logind-button.c \
698 src/login/logind-button.h \
699 src/login/logind-action.c \
700 src/login/logind-action.h \
701 src/login/logind-seat.c \
702 src/login/logind-seat.h \
703 src/login/logind-session.c \
704 src/login/logind-session.h \
705 src/login/logind-session-device.c \
706 src/login/logind-session-device.h \
707 src/login/logind-user.c \
708 src/login/logind-user.h \
709 src/login/logind-inhibit.c \
710 src/login/logind-inhibit.h \
711 src/login/logind-dbus.c \
712 src/login/logind-session-dbus.c \
713 src/login/logind-seat-dbus.c \
714 src/login/logind-user-dbus.c \
715 src/login/logind-utmp.c \
716 src/login/logind-acl.h \
721 libelogind_core_la_SOURCES += \
722 src/shared/utmp-wtmp.c \
723 src/update-utmp/update-utmp.c
726 libelogind_core_la_LIBADD = \
730 libelogind_core_la_SOURCES += \
731 src/login/logind-acl.c
734 noinst_LTLIBRARIES += \
737 pkglibexec_PROGRAMS += \
741 src/login/eloginctl.c \
742 src/login/eloginctl.h \
743 src/login/loginctl.c \
744 src/login/sysfs-show.h \
745 src/login/sysfs-show.c
750 rootbin_PROGRAMS += \
753 dist_bashcompletion_data = \
754 shell-completion/bash/loginctl
756 dist_zshcompletion_data = \
757 shell-completion/zsh/_loginctl \
758 shell-completion/zsh/_elogind-inhibit
760 elogind_inhibit_SOURCES = \
763 elogind_inhibit_LDADD = \
766 rootbin_PROGRAMS += \
769 test_login_SOURCES = \
770 src/libelogind/sd-login/test-login.c
775 test_login_shared_SOURCES = \
776 src/login/test-login-shared.c
778 test_login_shared_LDADD = \
781 test_inhibit_SOURCES = \
782 src/login/test-inhibit.c
784 test_inhibit_LDADD = \
787 test_login_tables_SOURCES = \
788 src/login/test-login-tables.c
790 test_login_tables_LDADD = \
802 pam_elogind_la_SOURCES = \
803 src/login/pam_elogind.sym \
804 src/login/pam_elogind.c
806 pam_elogind_la_CFLAGS = \
810 pam_elogind_la_LDFLAGS = \
816 -Wl,--version-script=$(top_srcdir)/src/login/pam_elogind.sym
818 pam_elogind_la_LIBADD = \
822 pamlib_LTLIBRARIES = \
826 dist_pamconf_DATA = \
827 src/login/elogind-user
831 src/login/elogind-user.m4
834 dist_dbussystemservice_DATA += \
835 src/login/org.freedesktop.login1.service
837 dist_dbuspolicy_DATA += \
838 src/login/org.freedesktop.login1.conf
840 nodist_pkgsysconf_DATA += \
841 src/login/logind.conf
843 polkitpolicy_files += \
844 src/login/org.freedesktop.login1.policy
846 dist_udevrules_DATA += \
847 src/login/70-uaccess.rules \
848 src/login/70-power-switch.rules
850 nodist_udevrules_DATA += \
851 src/login/71-seat.rules \
852 src/login/73-seat-late.rules
854 polkitpolicy_in_files += \
855 src/login/org.freedesktop.login1.policy.in
857 gperf_gperf_sources = \
858 src/login/logind-gperf.gperf
861 src/login/71-seat.rules.in \
862 src/login/73-seat-late.rules.in \
863 src/login/logind.conf.in
865 # ------------------------------------------------------------------------------
867 '|rootlibdir=$(rootlibdir)|' \
868 '|rootlibexecdir=$(rootlibexecdir)|' \
869 '|rootbindir=$(rootbindir)|' \
870 '|bindir=$(bindir)|' \
871 '|pkgsysconfdir=$(pkgsysconfdir)|' \
872 '|pkgdatadir=$(pkgdatadir)|' \
873 '|udevrulesdir=$(udevrulesdir)|' \
874 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
875 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
876 '|PACKAGE_URL=$(PACKAGE_URL)|' \
877 '|prefix=$(prefix)|' \
878 '|exec_prefix=$(exec_prefix)|' \
879 '|libdir=$(libdir)|' \
880 '|includedir=$(includedir)|' \
881 '|VERSION=$(VERSION)|' \
882 '|rootprefix=$(rootprefix)|' \
883 '|udevlibexecdir=$(udevlibexecdir)|' \
885 '|MKDIR_P=$(MKDIR_P)|' \
886 '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
887 '|systemuidmax=$(SYSTEM_UID_MAX)|' \
888 '|systemgidmax=$(SYSTEM_GID_MAX)|' \
889 '|TTY_GID=$(TTY_GID)|'
892 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
893 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
900 sysctl.d/%: sysctl.d/%.in
906 shell-completion/%: shell-completion/%.in
917 $(AM_V_GEN)chmod +x $@
920 $(AM_V_at)$(MKDIR_P) $(dir $@)
921 $(AM_V_GPERF)$(GPERF) < $< > $@
924 $(AM_V_at)$(MKDIR_P) $(dir $@)
925 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
927 sysusers.d/%: sysusers.d/%.m4
928 $(AM_V_at)$(MKDIR_P) $(dir $@)
929 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
931 tmpfiles.d/%: tmpfiles.d/%.m4
932 $(AM_V_at)$(MKDIR_P) $(dir $@)
933 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
937 $(AM_V_at)$(MKDIR_P) $(dir $@)
938 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
940 units/user/%: units/user/%.m4
941 $(AM_V_at)$(MKDIR_P) $(dir $@)
942 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
945 nodist_polkitpolicy_DATA = \
946 $(polkitpolicy_files)
947 polkitrules_DATA = $(polkitrules_files)
948 polkitpkla_DATA = $(polkitpkla_files)
952 $(polkitpolicy_in_files)
954 # ------------------------------------------------------------------------------
956 man/custom-entities.ent: configure.ac
957 $(AM_V_GEN)$(MKDIR_P) $(dir $@)
958 $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
959 printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
963 man/custom-entities.ent
968 --stringparam man.output.quietly 1 \
969 --stringparam funcsynopsis.style ansi \
970 --stringparam man.authors.section.enabled 0 \
971 --stringparam man.copyright.section.enabled 0 \
972 --stringparam elogind.version $(VERSION) \
973 --path '$(builddir)/man:$(srcdir)/man'
975 XSLTPROC_PROCESS_MAN = \
976 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
978 XSLTPROC_PROCESS_HTML = \
979 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
981 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
982 $(XSLTPROC_PROCESS_MAN)
984 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
985 $(XSLTPROC_PROCESS_MAN)
987 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
988 $(XSLTPROC_PROCESS_MAN)
990 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
991 $(XSLTPROC_PROCESS_MAN)
993 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
994 $(XSLTPROC_PROCESS_MAN)
996 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
997 $(XSLTPROC_PROCESS_HTML)
1000 $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
1006 man/custom-html.xsl \
1009 install-exec-hook: $(INSTALL_EXEC_HOOKS)
1011 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
1013 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
1015 clean-local: $(CLEAN_LOCAL_HOOKS)
1016 rm -rf $(abs_srcdir)/install-tree
1017 rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
1018 $(abs_srcdir)/hwdb/iab.txt
1020 DISTCHECK_CONFIGURE_FLAGS = \
1021 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
1022 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
1023 --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
1024 --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
1025 --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
1026 --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
1027 --with-rootprefix=$$dc_install_base
1030 DISTCHECK_CONFIGURE_FLAGS += \
1033 DISTCHECK_CONFIGURE_FLAGS += \
1037 .PHONY: dist-check-help
1038 dist-check-help: $(rootbin_PROGRAMS)
1039 for i in $(abspath $^); do \
1040 if $$i --help | grep -v 'default:' | grep -E -q '.{80}.' ; then \
1041 echo "$(basename $$i) --help output is too wide:"; \
1042 $$i --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
1046 include_compilers = "$(CC)" "$(CC) -ansi" "$(CC) -std=iso9899:1990"
1047 public_headers = $(filter-out src/systemd/_sd-common.h, $(pkginclude_HEADERS) $(include_HEADERS))
1048 .PHONY: dist-check-includes
1049 dist-check-includes: $(public_headers)
1051 for i in $(abspath $^); do \
1052 for cc in $(include_compilers); do \
1053 echo "$$cc -o/dev/null -c -x c -include "$$i" - </dev/null"; \
1054 $$cc -o/dev/null -c -x c -include "$$i" - </dev/null || res=1; \
1062 git tag -s "v$(VERSION)" -m "elogind $(VERSION)"
1066 $(AM_V_at)git archive --format=tar --prefix=elogind-$(VERSION)-raw/ HEAD | \
1067 (cd /var/tmp/ && tar xf -)
1068 $(AM_V_GEN)(cd /var/tmp && rm -rf elogind-$(VERSION) && $(MKDIR_P) elogind-$(VERSION) && \
1069 for f in `find elogind-$(VERSION)-raw/ -type f | cut -d '/' -f 2-` ; do \
1070 $(MKDIR_P) elogind-$(VERSION)/`dirname $$f` ; \
1071 $(AWK) 'BEGIN { i=0;e=0 } \
1072 /^#if\s+0.*elogind.*$$/ { i=1;next } \
1074 { if ( i==1 ) e=1; else print }{next} \
1076 /^#endif\s*\/\/\s*0\s*$$/ { \
1077 { if ( i==1 ) { i=0;e=0 } else print }{next} \
1079 /^\s*\/\/\/.*elogind.*$$/{ next } \
1080 /^\s*\/\/\s*#include.+$$/{ next } \
1081 { if ( (i==0) || (e==1) ) print }' \
1082 elogind-$(VERSION)-raw/$$f \
1083 > elogind-$(VERSION)/$$f ; \
1084 chmod `stat -c '%a' elogind-$(VERSION)-raw/$$f` \
1085 elogind-$(VERSION)/$$f ; \
1087 for l in `find elogind-$(VERSION)-raw/ -type l | cut -d '/' -f 2-` ; do \
1088 $(MKDIR_P) elogind-$(VERSION)/`dirname $$l` ; \
1089 cp -P elogind-$(VERSION)-raw/$$l elogind-$(VERSION)/$$l ; \
1091 tar czf elogind-$(VERSION).tar.gz elogind-$(VERSION) ; \
1092 rm -rf elogind-$(VERSION) elogind-$(VERSION)-raw) ; \
1093 $(AM_V_at)mv /var/tmp/elogind-$(VERSION).tar.gz ./
1095 .PHONY: install-tree
1097 rm -rf $(abs_srcdir)/install-tree
1098 $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
1099 tree $(abs_srcdir)/install-tree
1101 # Let's run all tests of the test suite, but under valgrind. Let's
1102 # exclude the one perl script we have in there
1103 .PHONY: valgrind-tests
1104 valgrind-tests: $(TESTS)
1105 $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
1106 if $(LIBTOOL) --mode=execute file $$f | grep -q shell; then \
1107 echo -e "$${x}Skipping non-binary $$f"; else \
1108 echo -e "$${x}Running $$f"; \
1109 $(AM_TESTS_ENVIRONMENT) $(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
1114 $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
1116 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
1117 $(AM_V_GEN)cat $^ > $@
1119 .PHONY: check-api-docs
1120 check-api-docs: exported man
1121 $(AM_V_GEN)for symbol in `cat exported` ; do \
1122 if test -f $(builddir)/man/$$symbol.html ; then \
1123 echo " Symbol $$symbol() is documented." ; \
1125 echo "‣ Symbol $$symbol() lacks documentation." ; \
1129 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
1130 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
1132 undefined defined: $(ALL_OBJECTS)
1133 $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
1134 $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
1135 done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
1141 .PHONY: check-api-unused
1142 check-api-unused: defined undefined exported
1143 ( cat exported undefined ) | sort -u | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
1145 .PHONY: check-includes
1146 check-includes: $(top_srcdir)/tools/check-includes.pl
1147 $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
1148 | xargs $(top_srcdir)/tools/check-includes.pl
1151 $(top_srcdir)/tools/check-includes.pl
1153 # Stupid test that everything purported to be exported really is
1154 define generate-sym-test
1155 $(AM_V_at)$(MKDIR_P) $(dir $@)
1156 $(AM_V_at)printf '#include <stdio.h>\n' > $@
1157 $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
1158 $(AM_V_at)printf 'void* functions[] = {\n' >> $@
1159 $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
1160 $(AM_V_at)printf '};\nint main(void) {\n' >> $@
1161 $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
1162 $(AM_V_at)printf 'return 0; }\n' >> $@
1165 test-libelogind-sym.c: \
1166 $(top_builddir)/src/libelogind/libelogind.sym \
1167 src/systemd/sd-daemon.h \
1168 src/systemd/sd-login.h \
1169 src/systemd/sd-bus.h \
1170 src/systemd/sd-event.h
1171 $(generate-sym-test)
1173 test_libelogind_sym_SOURCES = \
1174 test-libelogind-sym.c
1175 test_libelogind_sym_LDADD = \
1179 $(test_libelogind_sym_SOURCES)
1186 cppcheck --enable=all -q $(top_srcdir)
1188 # Used to extract compile flags for YCM.
1193 @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | sed 's/ / /g' | awk '{ print $$0 "," }' | sort -u
1196 tools/gdb-sd_dump_hashmaps.py
1199 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
1202 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -