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 =
106 noinst_PROGRAMS = $(manual_tests) $(tests) $(unsafe_tests)
108 if ENABLE_UNSAFE_TESTS
117 if ENABLE_BASH_COMPLETION
118 dist_bashcompletion_DATA = $(dist_bashcompletion_data)
120 if ENABLE_ZSH_COMPLETION
121 dist_zshcompletion_DATA = $(dist_zshcompletion_data)
124 in_files = $(filter %.in,$(EXTRA_DIST))
125 in_in_files = $(filter %.in.in, $(in_files))
126 m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
128 CLEANFILES = $(BUILT_SOURCES) \
129 $(pkgconfiglib_DATA) \
130 $(in_files:.in=) $(in_in_files:.in.in=) \
133 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
134 $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
137 -include $(top_builddir)/config.h \
138 -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
139 -DSYSTEMD_CGROUP_CONTROLLER=\"_$(CGROUP_CONTROLLER)\" \
140 -DSYSTEMD_CGROUP_CONTROLLER_LEGACY=\"name=$(CGROUP_CONTROLLER)\" \
141 -DSYSTEMD_CGROUP_CONTROLLER_HYBRID=\"name=$(CGROUP_CONTROLLER)\" \
142 -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/elogind-cgroups-agent\" \
143 -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/elogind\" \
144 -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
145 -DPOLKIT_AGENT_BINARY_PATH=\"$(PKTTYAGENT)\" \
146 -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
147 -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
149 -DREBOOT=\"$(REBOOT)\" \
150 -DKEXEC=\"$(KEXEC)\" \
151 -DLIBDIR=\"$(libdir)\" \
152 -DROOTLIBDIR=\"$(rootlibdir)\" \
153 -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
154 -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
155 -I $(top_srcdir)/src \
156 -I $(top_builddir)/src/basic \
157 -I $(top_srcdir)/src/basic \
158 -I $(top_srcdir)/src/core \
159 -I $(top_srcdir)/src/shared \
160 -I $(top_builddir)/src/shared \
161 -I $(top_srcdir)/src/login \
162 -I $(top_srcdir)/src/systemd \
163 -I $(top_srcdir)/src/libelogind/sd-bus \
164 -I $(top_srcdir)/src/libelogind/sd-event \
165 -I $(top_srcdir)/src/libelogind/sd-login \
166 -I $(top_srcdir)/src/libelogind/sd-id128 \
167 -I $(top_srcdir)/src/update-utmp \
168 -I $(top_srcdir)/src/sleep \
169 -DABS_SRC_DIR=\"$(abs_top_srcdir)\" \
170 -DABS_BUILD_DIR=\"$(abs_top_builddir)\" \
173 AM_CFLAGS = $(OUR_CFLAGS)
174 AM_LDFLAGS = $(OUR_LDFLAGS)
176 # ------------------------------------------------------------------------------
177 install-touch-usr-hook:
178 touch -c $(DESTDIR)/$(prefix)
180 INSTALL_EXEC_HOOKS += \
181 install-touch-usr-hook
184 # ------------------------------------------------------------------------------
185 AM_V_M4 = $(AM_V_M4_$(V))
186 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
187 AM_V_M4_0 = @echo " M4 " $@;
189 AM_V_XSLT = $(AM_V_XSLT_$(V))
190 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
191 AM_V_XSLT_0 = @echo " XSLT " $@;
193 AM_V_GPERF = $(AM_V_GPERF_$(V))
194 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
195 AM_V_GPERF_0 = @echo " GPERF " $@;
197 AM_V_LN = $(AM_V_LN_$(V))
198 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
199 AM_V_LN_0 = @echo " LN " $@;
201 AM_V_RM = $(AM_V_RM_$(V))
202 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
203 AM_V_RM_0 = @echo " RM " $@;
205 # ------------------------------------------------------------------------------
207 rootlibexec_PROGRAMS = \
209 elogind-cgroups-agent
211 pkglibexec_PROGRAMS =
219 @INTLTOOL_POLICY_RULE@
221 # ------------------------------------------------------------------------------
226 include Makefile-man.am
228 .PHONY: man update-man-list
229 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
232 ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
234 ${XML_FILES:.xml=.html}
236 ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
256 $(AM_V_at)$(MKDIR_P) $(dir $@)
257 $(AM_V_LN)$(LN_S) -f ../../man $@
259 man/index.html: man/elogind.index.html
260 $(AM_V_LN)$(LN_S) -f elogind.index.html $@
272 XML_GLOB := $(wildcard $(top_srcdir)/man/*.xml)
273 DIRECTIVE_FILE := man/elogind.directives.xml
274 INDEX_XML_FILE := man/elogind.index.xml
275 NON_INDEX_XML_FILES := $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_FILES))
276 ALL_XML_FILES := $(INDEX_XML_FILE) $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_GLOB))
277 SOURCE_XML_FILES := ${patsubst %,$(top_srcdir)/%,$(filter-out $(DIRECTIVE_FILE),$(NON_INDEX_XML_FILES))}
279 # This target should only be run manually. It recreates Makefile-man.am
280 # file in the source directory based on all man/*.xml files. Run it after
281 # adding, removing, or changing the conditional in a man page.
282 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(ALL_XML_FILES) man/custom-entities.ent
283 $(AM_V_GEN)$(PYTHON) $< $(ALL_XML_FILES) > $(top_srcdir)/Makefile-man.tmp
284 $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
285 @echo "Makefile-man.am has been regenerated"
287 $(INDEX_XML_FILE): $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
288 $(AM_V_at)$(MKDIR_P) $(dir $@)
289 $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
291 $(DIRECTIVE_FILE): $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
292 $(AM_V_at)$(MKDIR_P) $(dir $@)
293 $(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
300 $(filter-out $(DIRECTIVE_FILE) $(INDEX_XML_FILE),$(XML_FILES)) \
301 tools/make-man-index.py \
302 tools/make-man-rules.py \
303 tools/make-directive-index.py \
304 tools/xml_helper.py \
305 man/glib-event-glue.c
307 # ------------------------------------------------------------------------------
308 noinst_LTLIBRARIES += \
311 libbasic_la_SOURCES = \
312 src/basic/missing.h \
313 src/basic/capability-util.c \
314 src/basic/capability-util.h \
315 src/basic/conf-files.c \
316 src/basic/conf-files.h \
317 src/basic/stdio-util.h \
318 src/basic/hostname-util.h \
319 src/basic/hostname-util.c \
320 src/basic/unit-name.c \
321 src/basic/unit-name.h \
322 src/basic/unaligned.h \
325 src/basic/io-util.c \
326 src/basic/io-util.h \
327 src/basic/string-util.c \
328 src/basic/string-util.h \
329 src/basic/parse-util.c \
330 src/basic/parse-util.h \
331 src/basic/fd-util.c \
332 src/basic/fd-util.h \
333 src/basic/user-util.c \
334 src/basic/user-util.h \
335 src/basic/dirent-util.c \
336 src/basic/dirent-util.h \
337 src/basic/xattr-util.c \
338 src/basic/xattr-util.h \
339 src/basic/proc-cmdline.c \
340 src/basic/proc-cmdline.h \
341 src/basic/fs-util.c \
342 src/basic/fs-util.h \
343 src/basic/syslog-util.c \
344 src/basic/syslog-util.h \
345 src/basic/stat-util.c \
346 src/basic/stat-util.h \
347 src/basic/mount-util.c \
348 src/basic/mount-util.h \
349 src/basic/hexdecoct.c \
350 src/basic/hexdecoct.h \
351 src/basic/extract-word.c \
352 src/basic/extract-word.h \
355 src/basic/path-util.c \
356 src/basic/path-util.h \
357 src/basic/parse-printf-format.c \
358 src/basic/parse-printf-format.h \
359 src/basic/time-util.c \
360 src/basic/time-util.h \
361 src/basic/locale-util.c \
362 src/basic/locale-util.h \
363 src/basic/umask-util.h \
364 src/basic/signal-util.c \
365 src/basic/signal-util.h \
366 src/basic/string-table.c \
367 src/basic/string-table.h \
368 src/basic/mempool.c \
369 src/basic/mempool.h \
370 src/basic/hashmap.c \
371 src/basic/hashmap.h \
372 src/basic/hash-funcs.c \
373 src/basic/hash-funcs.h \
374 src/basic/siphash24.c \
375 src/basic/siphash24.h \
380 src/basic/env-util.c \
381 src/basic/env-util.h \
384 src/basic/bus-label.c \
385 src/basic/bus-label.h \
386 src/basic/exec-util.c \
387 src/basic/exec-util.h \
390 src/basic/smack-util.c \
391 src/basic/smack-util.h \
394 src/basic/gunicode.c \
395 src/basic/gunicode.h \
396 src/basic/socket-util.c \
397 src/basic/socket-util.h \
402 src/basic/cgroup-util.c \
403 src/basic/cgroup-util.h \
404 src/basic/errno-list.c \
405 src/basic/errno-list.h \
406 src/basic/terminal-util.c \
407 src/basic/terminal-util.h \
408 src/basic/login-util.h \
409 src/basic/login-util.c \
410 src/basic/audit-util.c \
411 src/basic/audit-util.h \
412 src/basic/memfd-util.c \
413 src/basic/memfd-util.h \
414 src/basic/process-util.c \
415 src/basic/process-util.h \
416 src/basic/random-util.c \
417 src/basic/random-util.h \
422 src/basic/selinux-util.c \
423 src/basic/selinux-util.h \
424 src/basic/mkdir-label.c \
425 src/basic/fileio-label.c \
426 src/basic/fileio-label.h \
431 src/basic/alloc-util.h \
432 src/basic/alloc-util.c \
433 src/basic/format-util.h \
437 nodist_libbasic_la_SOURCES = \
438 src/basic/errno-from-name.h \
439 src/basic/errno-to-name.h
441 libbasic_la_CFLAGS = \
447 libbasic_la_LDFLAGS = \
450 libbasic_la_LIBADD = \
456 # -----------------------------------------------------------------------------
457 noinst_LTLIBRARIES += \
460 libshared_la_SOURCES = \
461 src/shared/udev-util.h \
462 src/shared/udev-util.c \
463 src/shared/bus-util.c \
464 src/shared/bus-util.h \
465 src/shared/clean-ipc.c \
466 src/shared/clean-ipc.h \
467 src/shared/conf-parser.c \
468 src/shared/conf-parser.h \
469 src/shared/musl_missing.h \
470 src/shared/musl_missing.c \
473 src/shared/sleep-config.c \
474 src/shared/sleep-config.h \
475 src/shared/spawn-polkit-agent.c \
476 src/shared/spawn-polkit-agent.h \
479 src/shared/nsflags.h \
483 libshared_la_SOURCES += \
484 src/shared/acl-util.c \
485 src/shared/acl-util.h
488 libshared_la_CFLAGS = \
492 libshared_la_LIBADD = \
493 libelogind-internal.la \
498 noinst_LTLIBRARIES += \
501 libelogind_shared_la_SOURCES = \
502 $(libbasic_la_SOURCES) \
503 $(libshared_la_SOURCES) \
504 $(libelogind_internal_la_SOURCES)
506 libelogind_shared_la_CFLAGS = \
508 $(libbasic_la_CFLAGS) \
509 $(libshared_la_CFLAGS) \
510 $(libelogind_internal_la_CFLAGS) \
511 $(libelogind_journal_internal_la_CFLAGS) \
512 $(libudev_internal_la_CFLAGS) \
517 # We can't use libshared_la_LIBADD here because it would
518 # pull in libelogind*-internal.la
519 libelogind_shared_la_LIBADD = \
520 $(libbasic_la_LIBADD) \
521 $(libelogind_internal_la_LIBADD) \
526 libelogind_shared_la_LDFLAGS = \
528 # -----------------------------------------------------------------------------
529 gperf_txt_sources = \
530 src/basic/errno-list.txt
533 $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
534 $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
535 $(gperf_txt_sources:-list.txt=-from-name.h) \
536 $(gperf_txt_sources:-list.txt=-to-name.h)
539 $(gperf_txt_sources:-list.txt=-from-name.gperf)
544 $(gperf_gperf_m4_sources) \
545 $(gperf_gperf_sources)
550 %-from-name.gperf: %-list.txt
551 $(AM_V_at)$(MKDIR_P) $(dir $@)
552 $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
554 %-from-name.h: %-from-name.gperf
555 $(AM_V_at)$(MKDIR_P) $(dir $@)
556 $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
559 src/basic/errno-list.txt:
560 $(AM_V_at)$(MKDIR_P) $(dir $@)
561 $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
563 src/basic/errno-to-name.h: src/basic/errno-list.txt
564 $(AM_V_at)$(MKDIR_P) $(dir $@)
565 $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
567 # ------------------------------------------------------------------------------
596 test-strip-tab-ansi \
613 test/bus-policy/hello.conf \
614 test/bus-policy/methods.conf \
615 test/bus-policy/ownerships.conf \
616 test/bus-policy/signals.conf \
617 test/bus-policy/check-own-rules.conf \
618 test/bus-policy/many-rules.conf \
619 test/bus-policy/test.conf
623 src/test/test-helper.h
625 test_utf8_SOURCES = \
631 test_locale_util_SOURCES = \
632 src/test/test-locale-util.c
634 test_locale_util_LDADD = \
637 test_copy_SOURCES = \
640 # Link statically to ensure file is large
644 test_random_util_SOURCES = \
645 src/test/test-random-util.c
647 test_random_util_LDADD = \
650 test_util_SOURCES = \
656 test_exec_util_SOURCES = \
657 src/test/test-exec-util.c
659 test_exec_util_LDADD = \
662 test_hexdecoct_SOURCES = \
663 src/test/test-hexdecoct.c
665 test_hexdecoct_LDADD = \
668 test_alloc_util_SOURCES = \
669 src/test/test-alloc-util.c
671 test_alloc_util_LDADD = \
674 test_io_util_SOURCES = \
675 src/test/test-io-util.c
677 test_io_util_LDADD = \
680 test_fs_util_SOURCES = \
681 src/test/test-fs-util.c
683 test_fs_util_LDADD = \
686 test_proc_cmdline_SOURCES = \
687 src/test/test-proc-cmdline.c
689 test_proc_cmdline_LDADD = \
692 test_fd_util_SOURCES = \
693 src/test/test-fd-util.c
695 test_fd_util_LDADD = \
698 test_stat_util_SOURCES = \
699 src/test/test-stat-util.c
701 test_stat_util_LDADD = \
704 test_escape_SOURCES = \
705 src/test/test-escape.c
707 test_escape_LDADD = \
710 test_string_util_SOURCES = \
711 src/test/test-string-util.c
713 test_string_util_LDADD = \
716 test_extract_word_SOURCES = \
717 src/test/test-extract-word.c
719 test_extract_word_LDADD = \
722 test_parse_util_SOURCES = \
723 src/test/test-parse-util.c
725 test_parse_util_LDADD = \
728 test_user_util_SOURCES = \
729 src/test/test-user-util.c
731 test_user_util_LDADD = \
734 test_process_util_SOURCES = \
735 src/test/test-process-util.c
737 test_process_util_LDADD = \
740 test_verbs_SOURCES = \
741 src/test/test-verbs.c
746 test_signal_util_SOURCES = \
747 src/test/test-signal-util.c
749 test_signal_util_LDADD = \
752 test_selinux_SOURCES = \
753 src/test/test-selinux.c
755 test_selinux_LDADD = \
758 test_sizeof_SOURCES = \
759 src/test/test-sizeof.c
762 src/test/test-hashmap-ordered.c
764 src/test/test-hashmap-ordered.c: src/test/test-hashmap-plain.c
765 $(AM_V_at)$(MKDIR_P) $(dir $@)
766 $(AM_V_GEN)$(AWK) 'BEGIN { print "/* GENERATED FILE */\n#define ORDERED" } \
767 { if (!match($$0, "^#include")) \
768 gsub(/hashmap/, "ordered_hashmap"); \
769 gsub(/HASHMAP/, "ORDERED_HASHMAP"); \
770 gsub(/Hashmap/, "OrderedHashmap"); \
773 nodist_test_hashmap_SOURCES = \
774 src/test/test-hashmap-ordered.c
776 test_hashmap_SOURCES = \
777 src/test/test-hashmap.c \
778 src/test/test-hashmap-plain.c
780 test_hashmap_LDADD = \
789 test_list_SOURCES = \
795 test_unaligned_LDADD = \
798 test_unaligned_SOURCES = \
799 src/test/test-unaligned.c
801 test_prioq_SOURCES = \
802 src/test/test-prioq.c
813 test_ipcrm_SOURCES = \
814 src/test/test-ipcrm.c
819 test_ellipsize_SOURCES = \
820 src/test/test-ellipsize.c
822 test_ellipsize_LDADD = \
825 test_strip_tab_ansi_SOURCES = \
826 src/test/test-strip-tab-ansi.c
828 test_strip_tab_ansi_LDADD = \
831 test_cgroup_SOURCES = \
832 src/test/test-cgroup.c
834 test_cgroup_LDADD = \
837 test_path_util_SOURCES = \
838 src/test/test-path-util.c
840 test_path_util_LDADD = \
843 test_siphash24_SOURCES = \
844 src/test/test-siphash24.c
846 test_siphash24_LDADD = \
849 test_conf_files_SOURCES = \
850 src/test/test-conf-files.c
852 test_conf_files_LDADD = \
855 test_conf_parser_SOURCES = \
856 src/test/test-conf-parser.c
858 test_conf_parser_LDADD = \
861 # ------------------------------------------------------------------------------
862 ## .PHONY so it always rebuilds it
863 .PHONY: coverage lcov-run lcov-report coverage-sync
865 # run lcov from scratch, always
870 coverage_dir = coverage
871 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
874 # reset run coverage tests
876 @rm -rf $(coverage_dir)
877 lcov $(coverage_opts) --zerocounters
880 # generate report based on current coverage data
882 $(MKDIR_P) $(coverage_dir)
883 lcov $(coverage_opts) --compat-libtool --capture --no-external \
884 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
885 lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*'
886 genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info
887 @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
889 # lcov doesn't work properly with vpath builds, make sure that bad
890 # output is not uploaded by mistake.
891 coverage-sync: coverage
892 test "$(builddir)" = "$(srcdir)"
893 rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
896 lcov-run lcov-report:
897 echo "Need to reconfigure with --enable-coverage"
900 # ------------------------------------------------------------------------------
903 dist_factory_pam_DATA = \
904 factory/etc/pam.d/system-auth \
905 factory/etc/pam.d/other
908 # ------------------------------------------------------------------------------
909 pkglibexec_PROGRAMS += \
910 elogind-cgroups-agent
912 elogind_cgroups_agent_SOURCES = \
913 src/cgroups-agent/cgroups-agent.c
915 elogind_cgroups_agent_LDADD = \
918 # ------------------------------------------------------------------------------
919 libelogind_internal_la_SOURCES = \
920 src/systemd/sd-bus.h \
921 src/systemd/sd-bus-protocol.h \
922 src/systemd/sd-bus-vtable.h \
923 src/systemd/sd-event.h \
924 src/systemd/sd-login.h \
925 src/systemd/sd-id128.h \
926 src/systemd/sd-daemon.h \
927 src/libelogind/libelogind.sym \
928 src/libelogind/sd-bus/sd-bus.c \
929 src/libelogind/sd-bus/bus-control.c \
930 src/libelogind/sd-bus/bus-control.h \
931 src/libelogind/sd-bus/bus-error.c \
932 src/libelogind/sd-bus/bus-error.h \
933 src/libelogind/sd-bus/bus-common-errors.h \
934 src/libelogind/sd-bus/bus-common-errors.c \
935 src/libelogind/sd-bus/bus-internal.c \
936 src/libelogind/sd-bus/bus-internal.h \
937 src/libelogind/sd-bus/bus-socket.c \
938 src/libelogind/sd-bus/bus-socket.h \
939 src/libelogind/sd-bus/bus-kernel.c \
940 src/libelogind/sd-bus/bus-kernel.h \
941 src/libelogind/sd-bus/bus-container.c \
942 src/libelogind/sd-bus/bus-container.h \
943 src/libelogind/sd-bus/bus-message.c \
944 src/libelogind/sd-bus/bus-message.h \
945 src/libelogind/sd-bus/bus-creds.c \
946 src/libelogind/sd-bus/bus-creds.h \
947 src/libelogind/sd-bus/bus-signature.c \
948 src/libelogind/sd-bus/bus-signature.h \
949 src/libelogind/sd-bus/bus-type.c \
950 src/libelogind/sd-bus/bus-type.h \
951 src/libelogind/sd-bus/bus-match.c \
952 src/libelogind/sd-bus/bus-match.h \
953 src/libelogind/sd-bus/bus-bloom.c \
954 src/libelogind/sd-bus/bus-bloom.h \
955 src/libelogind/sd-bus/bus-introspect.c \
956 src/libelogind/sd-bus/bus-introspect.h \
957 src/libelogind/sd-bus/bus-objects.c \
958 src/libelogind/sd-bus/bus-objects.h \
959 src/libelogind/sd-bus/bus-gvariant.c \
960 src/libelogind/sd-bus/bus-gvariant.h \
961 src/libelogind/sd-bus/bus-convenience.c \
962 src/libelogind/sd-bus/bus-track.c \
963 src/libelogind/sd-bus/bus-track.h \
964 src/libelogind/sd-bus/bus-slot.c \
965 src/libelogind/sd-bus/bus-slot.h \
966 src/libelogind/sd-bus/bus-protocol.h \
967 src/libelogind/sd-event/sd-event.c \
968 src/libelogind/sd-id128/sd-id128.c \
969 src/libelogind/sd-id128/id128-util.h \
970 src/libelogind/sd-id128/id128-util.c \
971 src/libelogind/sd-daemon/sd-daemon.c \
972 src/libelogind/sd-login/sd-login.c
974 noinst_LTLIBRARIES += \
975 libelogind-internal.la
978 src/libelogind/libelogind.pc.in \
979 src/libelogind/sd-bus/GVARIANT-SERIALIZATION
981 libelogind_la_SOURCES =
983 libelogind_la_LDFLAGS = \
985 -version-info $(LIBELOGIND_CURRENT):$(LIBELOGIND_REVISION):$(LIBELOGIND_AGE) \
986 -Wl,--version-script=$(top_srcdir)/src/libelogind/libelogind.sym
988 libelogind_la_LIBADD = \
989 libelogind-internal.la \
992 pkgconfiglib_DATA += \
993 src/libelogind/libelogind.pc
995 pkginclude_HEADERS += \
996 src/systemd/sd-login.h \
997 src/systemd/sd-messages.h \
998 src/systemd/sd-id128.h \
999 src/systemd/_sd-common.h
1001 header-install-hook:
1002 $(MKDIR_P) $(DESTDIR)/$(pkgincludedir)
1003 cd $(DESTDIR)/$(includedir)/elogind && \
1004 for hdr in $(notdir $(pkginclude_HEADERS)) ; do \
1006 $(LN_S) systemd/$$hdr $$hdr ; \
1009 header-uninstall-hook:
1010 m -f $(DESTDIR)/$(includedir)/elogind/*.h
1012 INSTALL_EXEC_HOOKS += header-install-hook
1013 UNINSTALL_EXEC_HOOKS += header-uninstall-hook
1015 rootlib_LTLIBRARIES += \
1019 test-bus-signature \
1022 test-bus-introspect \
1027 test_bus_signature_SOURCES = \
1028 src/libelogind/sd-bus/test-bus-signature.c
1030 test_bus_signature_LDADD = \
1031 libelogind-shared.la
1033 test_bus_server_SOURCES = \
1034 src/libelogind/sd-bus/test-bus-server.c
1036 test_bus_server_LDADD = \
1037 libelogind-shared.la
1039 test_bus_vtable_SOURCES = \
1040 src/libelogind/sd-bus/test-bus-vtable.c
1042 test_bus_vtable_LDADD = \
1043 libelogind-shared.la
1045 test_bus_error_SOURCES = \
1046 src/libelogind/sd-bus/test-bus-error.c
1048 # Link statically because this test uses BUS_ERROR_MAP_ELF_REGISTER
1049 test_bus_error_LDADD = \
1052 test_bus_match_SOURCES = \
1053 src/libelogind/sd-bus/test-bus-match.c
1055 test_bus_match_LDADD = \
1056 libelogind-shared.la
1058 test_bus_introspect_SOURCES = \
1059 src/libelogind/sd-bus/test-bus-introspect.c
1061 test_bus_introspect_LDADD = \
1062 libelogind-shared.la
1064 test_event_SOURCES = \
1065 src/libelogind/sd-event/test-event.c
1067 test_event_LDADD = \
1068 libelogind-shared.la
1070 # ------------------------------------------------------------------------------
1071 test_id128_SOURCES = \
1072 src/test/test-id128.c
1074 test_id128_LDADD = \
1075 libelogind-shared.la
1080 # ------------------------------------------------------------------------------
1081 test_hash_SOURCES = \
1082 src/test/test-hash.c
1085 libelogind-shared.la
1090 # ------------------------------------------------------------------------------
1092 src/login/logind.c \
1095 nodist_elogind_SOURCES = \
1096 src/login/logind-gperf.c
1101 libelogind_core_la_SOURCES = \
1104 src/core/mount-setup.h \
1105 src/core/mount-setup.c \
1106 src/login/elogind.c \
1107 src/login/elogind.h \
1108 src/login/elogind-dbus.c \
1109 src/login/elogind-dbus.h \
1110 src/login/logind-core.c \
1111 src/login/logind-device.c \
1112 src/login/logind-device.h \
1113 src/login/logind-button.c \
1114 src/login/logind-button.h \
1115 src/login/logind-action.c \
1116 src/login/logind-action.h \
1117 src/login/logind-seat.c \
1118 src/login/logind-seat.h \
1119 src/login/logind-session.c \
1120 src/login/logind-session.h \
1121 src/login/logind-session-device.c \
1122 src/login/logind-session-device.h \
1123 src/login/logind-user.c \
1124 src/login/logind-user.h \
1125 src/login/logind-inhibit.c \
1126 src/login/logind-inhibit.h \
1127 src/login/logind-dbus.c \
1128 src/login/logind-session-dbus.c \
1129 src/login/logind-seat-dbus.c \
1130 src/login/logind-user-dbus.c \
1131 src/login/logind-utmp.c \
1132 src/login/logind-acl.h \
1137 libelogind_core_la_SOURCES += \
1138 src/shared/utmp-wtmp.c \
1139 src/update-utmp/update-utmp.c
1142 libelogind_core_la_LIBADD = \
1143 libelogind-shared.la
1146 libelogind_core_la_SOURCES += \
1147 src/login/logind-acl.c
1150 noinst_LTLIBRARIES += \
1153 pkglibexec_PROGRAMS += \
1156 loginctl_SOURCES = \
1157 src/login/eloginctl.c \
1158 src/login/eloginctl.h \
1159 src/login/loginctl.c \
1160 src/login/sysfs-show.h \
1161 src/login/sysfs-show.c
1164 libelogind-shared.la
1166 rootbin_PROGRAMS += \
1169 dist_bashcompletion_data = \
1170 shell-completion/bash/loginctl
1172 dist_zshcompletion_data = \
1173 shell-completion/zsh/_loginctl \
1174 shell-completion/zsh/_elogind-inhibit
1176 elogind_inhibit_SOURCES = \
1179 elogind_inhibit_LDADD = \
1180 libelogind-shared.la
1182 rootbin_PROGRAMS += \
1185 test_login_SOURCES = \
1186 src/libelogind/sd-login/test-login.c
1188 test_login_LDADD = \
1189 libelogind-shared.la
1191 test_login_shared_SOURCES = \
1192 src/login/test-login-shared.c
1194 test_login_shared_LDADD = \
1195 libelogind-shared.la
1197 test_inhibit_SOURCES = \
1198 src/login/test-inhibit.c
1200 test_inhibit_LDADD = \
1201 libelogind-shared.la
1203 test_login_tables_SOURCES = \
1204 src/login/test-login-tables.c
1206 test_login_tables_LDADD = \
1218 pam_elogind_la_SOURCES = \
1219 src/login/pam_elogind.sym \
1220 src/login/pam_elogind.c
1222 pam_elogind_la_CFLAGS = \
1226 pam_elogind_la_LDFLAGS = \
1232 -Wl,--version-script=$(top_srcdir)/src/login/pam_elogind.sym
1234 pam_elogind_la_LIBADD = \
1238 pamlib_LTLIBRARIES = \
1241 if ENABLE_PAM_CONFIG
1242 dist_pamconf_DATA = \
1243 src/login/elogind-user
1247 src/login/elogind-user.m4
1250 dist_dbussystemservice_DATA += \
1251 src/login/org.freedesktop.login1.service
1253 dist_dbuspolicy_DATA += \
1254 src/login/org.freedesktop.login1.conf
1256 nodist_pkgsysconf_DATA += \
1257 src/login/logind.conf
1259 polkitpolicy_files += \
1260 src/login/org.freedesktop.login1.policy
1262 dist_udevrules_DATA += \
1263 src/login/70-uaccess.rules \
1264 src/login/70-power-switch.rules
1266 nodist_udevrules_DATA += \
1267 src/login/71-seat.rules \
1268 src/login/73-seat-late.rules
1270 polkitpolicy_in_files += \
1271 src/login/org.freedesktop.login1.policy.in
1273 gperf_gperf_sources = \
1274 src/login/logind-gperf.gperf
1277 src/login/71-seat.rules.in \
1278 src/login/73-seat-late.rules.in \
1279 src/login/logind.conf.in
1281 # ------------------------------------------------------------------------------
1283 '|rootlibdir=$(rootlibdir)|' \
1284 '|rootlibexecdir=$(rootlibexecdir)|' \
1285 '|rootbindir=$(rootbindir)|' \
1286 '|bindir=$(bindir)|' \
1287 '|pkgsysconfdir=$(pkgsysconfdir)|' \
1288 '|pkgdatadir=$(pkgdatadir)|' \
1289 '|udevrulesdir=$(udevrulesdir)|' \
1290 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
1291 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
1292 '|PACKAGE_URL=$(PACKAGE_URL)|' \
1293 '|prefix=$(prefix)|' \
1294 '|exec_prefix=$(exec_prefix)|' \
1295 '|libdir=$(libdir)|' \
1296 '|includedir=$(includedir)|' \
1297 '|rootprefix=$(rootprefix)|' \
1298 '|udevlibexecdir=$(udevlibexecdir)|' \
1300 '|MKDIR_P=$(MKDIR_P)|' \
1301 '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
1302 '|systemuidmax=$(SYSTEM_UID_MAX)|' \
1303 '|systemgidmax=$(SYSTEM_GID_MAX)|'
1306 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
1307 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
1314 sysctl.d/%: sysctl.d/%.in
1320 shell-completion/%: shell-completion/%.in
1331 $(AM_V_GEN)chmod +x $@
1333 src/%.c: src/%.gperf
1334 $(AM_V_at)$(MKDIR_P) $(dir $@)
1335 $(AM_V_GPERF)$(GPERF) < $< > $@
1338 $(AM_V_at)$(MKDIR_P) $(dir $@)
1339 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1341 sysusers.d/%: sysusers.d/%.m4
1342 $(AM_V_at)$(MKDIR_P) $(dir $@)
1343 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1345 tmpfiles.d/%: tmpfiles.d/%.m4
1346 $(AM_V_at)$(MKDIR_P) $(dir $@)
1347 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1351 $(AM_V_at)$(MKDIR_P) $(dir $@)
1352 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
1354 units/user/%: units/user/%.m4
1355 $(AM_V_at)$(MKDIR_P) $(dir $@)
1356 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
1359 nodist_polkitpolicy_DATA = \
1360 $(polkitpolicy_files)
1361 polkitrules_DATA = $(polkitrules_files)
1362 if ENABLE_POLKIT_PKLA
1363 polkitpkla_DATA = $(polkitpkla_files)
1368 $(polkitpolicy_in_files)
1370 # ------------------------------------------------------------------------------
1372 man/custom-entities.ent: configure.ac
1373 $(AM_V_GEN)$(MKDIR_P) $(dir $@)
1374 $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
1375 printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
1379 man/custom-entities.ent
1384 --stringparam man.output.quietly 1 \
1385 --stringparam funcsynopsis.style ansi \
1386 --stringparam man.authors.section.enabled 0 \
1387 --stringparam man.copyright.section.enabled 0 \
1388 --stringparam elogind.version $(PACKAGE_VERSION) \
1389 --path '$(builddir)/man:$(srcdir)/man'
1391 XSLTPROC_PROCESS_MAN = \
1392 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
1394 XSLTPROC_PROCESS_HTML = \
1395 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
1397 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
1398 $(XSLTPROC_PROCESS_MAN)
1400 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
1401 $(XSLTPROC_PROCESS_MAN)
1403 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
1404 $(XSLTPROC_PROCESS_MAN)
1406 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
1407 $(XSLTPROC_PROCESS_MAN)
1409 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
1410 $(XSLTPROC_PROCESS_MAN)
1412 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
1413 $(XSLTPROC_PROCESS_HTML)
1416 $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
1422 man/custom-html.xsl \
1425 install-exec-hook: $(INSTALL_EXEC_HOOKS)
1427 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
1429 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
1431 clean-local: $(CLEAN_LOCAL_HOOKS)
1432 rm -rf $(abs_srcdir)/install-tree
1433 rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
1434 $(abs_srcdir)/hwdb/iab.txt
1436 DISTCHECK_CONFIGURE_FLAGS = \
1437 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
1438 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
1439 --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
1440 --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
1441 --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
1442 --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
1443 --with-rootprefix=$$dc_install_base
1446 DISTCHECK_CONFIGURE_FLAGS += \
1449 DISTCHECK_CONFIGURE_FLAGS += \
1453 .PHONY: dist-check-help
1454 dist-check-help: $(rootbin_PROGRAMS)
1455 for i in $(abspath $^); do \
1456 if $$i --help | grep -v 'default:' | grep -E -q '.{80}.' ; then \
1457 echo "$(basename $$i) --help output is too wide:"; \
1458 $$i --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
1462 include_compilers = "$(CC)" "$(CC) -ansi" "$(CC) -std=iso9899:1990"
1463 public_headers = $(filter-out src/systemd/_sd-common.h, $(pkginclude_HEADERS) $(include_HEADERS))
1464 .PHONY: dist-check-includes
1465 dist-check-includes: $(public_headers)
1467 for i in $(abspath $^); do \
1468 for cc in $(include_compilers); do \
1469 echo "$$cc -o/dev/null -c -x c -include "$$i" - </dev/null"; \
1470 $$cc -o/dev/null -c -x c -include "$$i" - </dev/null || res=1; \
1478 git tag -s "v$(PACKAGE_VERSION)" -m "elogind $(PACKAGE_VERSION)"
1482 $(AM_V_at)git archive --format=tar --prefix=elogind-$(PACKAGE_VERSION)-raw/ HEAD | \
1483 (cd /var/tmp/ && tar xf -)
1484 $(AM_V_GEN)(cd /var/tmp && \
1485 rm -rf elogind-$(PACKAGE_VERSION) && \
1486 $(MKDIR_P) elogind-$(PACKAGE_VERSION) && \
1487 for f in `find elogind-$(PACKAGE_VERSION)-raw/ -type f | \
1488 cut -d '/' -f 2-` ; do \
1489 $(MKDIR_P) elogind-$(PACKAGE_VERSION)/`dirname $$f` ; \
1490 $(AWK) 'BEGIN { i=0;e=0 } \
1491 /^#if\s+0.*elogind.*$$/ { i=1;next } \
1493 { if ( i==1 ) e=1; else print }{next} \
1495 /^#endif\s*\/\/\s*0\s*$$/ { \
1496 { if ( i==1 ) { i=0;e=0 } else print }{next} \
1498 /^\s*\/\/\/.*elogind.*$$/{ next } \
1499 /^\s*\/\/\s*#include.+$$/{ next } \
1500 { if ( (i==0) || (e==1) ) print }' \
1501 elogind-$(PACKAGE_VERSION)-raw/$$f \
1502 > elogind-$(PACKAGE_VERSION)/$$f ; \
1503 chmod `stat -c '%a' elogind-$(PACKAGE_VERSION)-raw/$$f` \
1504 elogind-$(PACKAGE_VERSION)/$$f ; \
1506 for l in `find elogind-$(PACKAGE_VERSION)-raw/ -type l | \
1507 cut -d '/' -f 2-` ; do \
1508 $(MKDIR_P) elogind-$(PACKAGE_VERSION)/`dirname $$l` ; \
1509 cp -P elogind-$(PACKAGE_VERSION)-raw/$$l \
1510 elogind-$(PACKAGE_VERSION)/$$l ; \
1512 tar czf elogind-$(PACKAGE_VERSION).tar.gz elogind-$(PACKAGE_VERSION) ; \
1513 rm -rf elogind-$(PACKAGE_VERSION) elogind-$(PACKAGE_VERSION)-raw) ; \
1514 $(AM_V_at)mv /var/tmp/elogind-$(PACKAGE_VERSION).tar.gz ./
1516 .PHONY: install-tree
1518 rm -rf $(abs_srcdir)/install-tree
1519 $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
1520 tree $(abs_srcdir)/install-tree
1522 # Let's run all tests of the test suite, but under valgrind. Let's
1523 # exclude perl/python/shell scripts we have in there
1524 .PHONY: valgrind-tests
1525 valgrind-tests: $(TESTS)
1526 $(AM_V_GEN)for f in $(filter-out %.pl %.py, $^); do \
1527 if $(LIBTOOL) --mode=execute file $$f | grep -q shell; then \
1528 echo -e "$${x}Skipping non-binary $$f"; else \
1529 echo -e "$${x}Running $$f"; \
1530 $(AM_TESTS_ENVIRONMENT) $(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
1535 $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
1537 exported: $(addprefix exported-, $(rootlib_LTLIBRARIES))
1538 $(AM_V_GEN)cat $^ > $@
1540 .PHONY: check-api-docs
1541 check-api-docs: exported man
1542 $(AM_V_GEN)for symbol in `cat exported` ; do \
1543 if test -f $(builddir)/man/$$symbol.html ; then \
1544 echo " Symbol $$symbol() is documented." ; \
1546 echo "‣ Symbol $$symbol() lacks documentation." ; \
1550 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
1551 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
1553 undefined defined: $(ALL_OBJECTS)
1554 $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
1555 $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
1556 done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
1562 .PHONY: check-api-unused
1563 check-api-unused: defined undefined exported
1564 ( cat exported undefined ) | sort -u | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
1566 .PHONY: check-includes
1567 check-includes: $(top_srcdir)/tools/check-includes.pl
1568 $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
1569 | xargs $(top_srcdir)/tools/check-includes.pl
1572 $(top_srcdir)/tools/check-includes.pl
1574 # Stupid test that everything purported to be exported really is
1575 define generate-sym-test
1576 $(AM_V_at)$(MKDIR_P) $(dir $@)
1577 $(AM_V_at)printf '#include <stdio.h>\n' > $@
1578 $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
1579 $(AM_V_at)printf 'void* functions[] = {\n' >> $@
1580 $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
1581 $(AM_V_at)printf '};\nint main(void) {\n' >> $@
1582 $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
1583 $(AM_V_at)printf 'return 0; }\n' >> $@
1586 test-libelogind-sym.c: \
1587 $(top_builddir)/src/libelogind/libelogind.sym \
1588 src/systemd/sd-daemon.h \
1589 src/systemd/sd-login.h \
1590 src/systemd/sd-bus.h \
1591 src/systemd/sd-event.h
1592 $(generate-sym-test)
1594 test_libelogind_sym_SOURCES = \
1595 test-libelogind-sym.c
1596 test_libelogind_sym_LDADD = \
1600 $(test_libelogind_sym_SOURCES)
1605 .PHONY: install-tests
1606 install-tests: $(tests) $(TEST_DATA_FILES)
1607 for f in $(tests); do \
1608 if [ -x $(top_builddir)/.libs/$$f ]; then \
1609 install -D -m 755 $(top_builddir)/.libs/$$f $(DESTDIR)/$(testsdir)/$$f; \
1611 install -D -m 755 $(top_builddir)/$$f $(DESTDIR)/$(testsdir)/$$f; \
1614 for f in $(TEST_DATA_FILES); do \
1615 install -D -m 644 $(top_srcdir)/$$f $(DESTDIR)/$(testsdir)/testdata/$${f#test/}; \
1618 .PHONY: cccc cppcheck
1620 cccc --outdir=$(top_builddir)/cccc \
1621 `find $(top_srcdir)/src/ -name '*.h' -or -name '*.c'`
1624 cppcheck --enable=all -q \
1625 -I $(top_srcdir)/src \
1626 -I $(top_builddir)/src/basic \
1627 -I $(top_srcdir)/src/basic \
1628 -I $(top_srcdir)/src/core \
1629 -I $(top_srcdir)/src/shared \
1630 -I $(top_builddir)/src/shared \
1631 -I $(top_srcdir)/src/login \
1632 -I $(top_srcdir)/src/systemd \
1633 -I $(top_srcdir)/src/libelogind/sd-bus \
1634 -I $(top_srcdir)/src/libelogind/sd-event \
1635 -I $(top_srcdir)/src/libelogind/sd-login \
1636 -I $(top_srcdir)/src/libelogind/sd-id128 \
1637 -I $(top_srcdir)/src/update-utmp \
1638 -I $(top_srcdir)/src/sleep \
1642 # Used to extract compile flags for YCM.
1647 @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | sed 's/ / /g' | awk '{ print $$0 "," }' | sort -u
1650 tools/gdb-sd_dump_hashmaps.py
1653 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
1656 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -