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 $@
270 XML_GLOB := $(wildcard $(top_srcdir)/man/*.xml)
271 DIRECTIVE_FILE := man/elogind.directives.xml
272 INDEX_XML_FILE := man/elogind.index.xml
273 NON_INDEX_XML_FILES := $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_FILES))
274 ALL_XML_FILES := $(INDEX_XML_FILE) $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_GLOB))
275 SOURCE_XML_FILES := ${patsubst %,$(top_srcdir)/%,$(filter-out $(DIRECTIVE_FILE),$(NON_INDEX_XML_FILES))}
277 # This target should only be run manually. It recreates Makefile-man.am
278 # file in the source directory based on all man/*.xml files. Run it after
279 # adding, removing, or changing the conditional in a man page.
280 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(ALL_XML_FILES) man/custom-entities.ent
281 $(AM_V_GEN)$(PYTHON) $< $(ALL_XML_FILES) > $(top_srcdir)/Makefile-man.tmp
282 $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
283 @echo "Makefile-man.am has been regenerated"
285 $(INDEX_XML_FILE): $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
286 $(AM_V_at)$(MKDIR_P) $(dir $@)
287 $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
289 $(DIRECTIVE_FILE): $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
290 $(AM_V_at)$(MKDIR_P) $(dir $@)
291 $(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
298 $(filter-out $(DIRECTIVE_FILE) $(INDEX_XML_FILE),$(XML_FILES)) \
299 tools/make-man-index.py \
300 tools/make-man-rules.py \
301 tools/make-directive-index.py \
302 tools/xml_helper.py \
303 man/glib-event-glue.c
305 # ------------------------------------------------------------------------------
306 noinst_LTLIBRARIES += \
309 libbasic_la_SOURCES = \
310 src/basic/missing.h \
311 src/basic/capability-util.c \
312 src/basic/capability-util.h \
313 src/basic/conf-files.c \
314 src/basic/conf-files.h \
315 src/basic/stdio-util.h \
316 src/basic/hostname-util.h \
317 src/basic/hostname-util.c \
318 src/basic/unit-name.c \
319 src/basic/unit-name.h \
320 src/basic/unaligned.h \
323 src/basic/io-util.c \
324 src/basic/io-util.h \
325 src/basic/string-util.c \
326 src/basic/string-util.h \
327 src/basic/parse-util.c \
328 src/basic/parse-util.h \
329 src/basic/fd-util.c \
330 src/basic/fd-util.h \
331 src/basic/user-util.c \
332 src/basic/user-util.h \
333 src/basic/dirent-util.c \
334 src/basic/dirent-util.h \
335 src/basic/xattr-util.c \
336 src/basic/xattr-util.h \
337 src/basic/proc-cmdline.c \
338 src/basic/proc-cmdline.h \
339 src/basic/fs-util.c \
340 src/basic/fs-util.h \
341 src/basic/syslog-util.c \
342 src/basic/syslog-util.h \
343 src/basic/stat-util.c \
344 src/basic/stat-util.h \
345 src/basic/mount-util.c \
346 src/basic/mount-util.h \
347 src/basic/hexdecoct.c \
348 src/basic/hexdecoct.h \
349 src/basic/extract-word.c \
350 src/basic/extract-word.h \
353 src/basic/path-util.c \
354 src/basic/path-util.h \
355 src/basic/parse-printf-format.c \
356 src/basic/parse-printf-format.h \
357 src/basic/time-util.c \
358 src/basic/time-util.h \
359 src/basic/locale-util.c \
360 src/basic/locale-util.h \
361 src/basic/umask-util.h \
362 src/basic/signal-util.c \
363 src/basic/signal-util.h \
364 src/basic/string-table.c \
365 src/basic/string-table.h \
366 src/basic/mempool.c \
367 src/basic/mempool.h \
368 src/basic/hashmap.c \
369 src/basic/hashmap.h \
370 src/basic/hash-funcs.c \
371 src/basic/hash-funcs.h \
372 src/basic/siphash24.c \
373 src/basic/siphash24.h \
378 src/basic/env-util.c \
379 src/basic/env-util.h \
382 src/basic/bus-label.c \
383 src/basic/bus-label.h \
384 src/basic/exec-util.c \
385 src/basic/exec-util.h \
388 src/basic/smack-util.c \
389 src/basic/smack-util.h \
392 src/basic/gunicode.c \
393 src/basic/gunicode.h \
394 src/basic/socket-util.c \
395 src/basic/socket-util.h \
400 src/basic/cgroup-util.c \
401 src/basic/cgroup-util.h \
402 src/basic/errno-list.c \
403 src/basic/errno-list.h \
404 src/basic/terminal-util.c \
405 src/basic/terminal-util.h \
406 src/basic/login-util.h \
407 src/basic/login-util.c \
408 src/basic/audit-util.c \
409 src/basic/audit-util.h \
410 src/basic/memfd-util.c \
411 src/basic/memfd-util.h \
412 src/basic/process-util.c \
413 src/basic/process-util.h \
414 src/basic/random-util.c \
415 src/basic/random-util.h \
420 src/basic/selinux-util.c \
421 src/basic/selinux-util.h \
422 src/basic/mkdir-label.c \
423 src/basic/fileio-label.c \
424 src/basic/fileio-label.h \
429 src/basic/alloc-util.h \
430 src/basic/alloc-util.c \
431 src/basic/format-util.h \
435 nodist_libbasic_la_SOURCES = \
436 src/basic/errno-from-name.h \
437 src/basic/errno-to-name.h
439 libbasic_la_CFLAGS = \
445 libbasic_la_LDFLAGS = \
448 libbasic_la_LIBADD = \
454 # -----------------------------------------------------------------------------
455 noinst_LTLIBRARIES += \
458 libshared_la_SOURCES = \
459 src/shared/bus-util.c \
460 src/shared/bus-util.h \
461 src/shared/clean-ipc.c \
462 src/shared/clean-ipc.h \
463 src/shared/conf-parser.c \
464 src/shared/conf-parser.h \
465 src/shared/musl_missing.h \
466 src/shared/musl_missing.c \
469 src/shared/sleep-config.c \
470 src/shared/sleep-config.h \
471 src/shared/spawn-polkit-agent.c \
472 src/shared/spawn-polkit-agent.h \
475 src/shared/nsflags.h \
479 libshared_la_SOURCES += \
480 src/shared/acl-util.c \
481 src/shared/acl-util.h
484 libshared_la_CFLAGS = \
488 libshared_la_LIBADD = \
489 libelogind-internal.la \
494 noinst_LTLIBRARIES += \
497 libelogind_shared_la_SOURCES = \
498 $(libbasic_la_SOURCES) \
499 $(libshared_la_SOURCES) \
500 $(libelogind_internal_la_SOURCES)
502 libelogind_shared_la_CFLAGS = \
504 $(libbasic_la_CFLAGS) \
505 $(libshared_la_CFLAGS) \
506 $(libelogind_internal_la_CFLAGS) \
507 $(libelogind_journal_internal_la_CFLAGS) \
508 $(libudev_internal_la_CFLAGS) \
514 # We can't use libshared_la_LIBADD here because it would
515 # pull in libelogind*-internal.la
516 libelogind_shared_la_LIBADD = \
517 $(libbasic_la_LIBADD) \
518 $(libelogind_internal_la_LIBADD) \
524 libelogind_shared_la_LDFLAGS = \
526 # -----------------------------------------------------------------------------
527 gperf_txt_sources = \
528 src/basic/errno-list.txt
531 $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
532 $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
533 $(gperf_txt_sources:-list.txt=-from-name.h) \
534 $(gperf_txt_sources:-list.txt=-to-name.h)
537 $(gperf_txt_sources:-list.txt=-from-name.gperf)
542 $(gperf_gperf_m4_sources) \
543 $(gperf_gperf_sources)
548 %-from-name.gperf: %-list.txt
549 $(AM_V_at)$(MKDIR_P) $(dir $@)
550 $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
552 %-from-name.h: %-from-name.gperf
553 $(AM_V_at)$(MKDIR_P) $(dir $@)
554 $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
557 src/basic/errno-list.txt:
558 $(AM_V_at)$(MKDIR_P) $(dir $@)
559 $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
561 src/basic/errno-to-name.h: src/basic/errno-list.txt
562 $(AM_V_at)$(MKDIR_P) $(dir $@)
563 $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
565 # ------------------------------------------------------------------------------
594 test-strip-tab-ansi \
610 test/bus-policy/hello.conf \
611 test/bus-policy/methods.conf \
612 test/bus-policy/ownerships.conf \
613 test/bus-policy/signals.conf \
614 test/bus-policy/check-own-rules.conf \
615 test/bus-policy/many-rules.conf \
616 test/bus-policy/test.conf
620 src/test/test-helper.h
622 test_utf8_SOURCES = \
628 test_locale_util_SOURCES = \
629 src/test/test-locale-util.c
631 test_locale_util_LDADD = \
634 test_copy_SOURCES = \
637 # Link statically to ensure file is large
641 test_util_SOURCES = \
647 test_exec_util_SOURCES = \
648 src/test/test-exec-util.c
650 test_exec_util_LDADD = \
653 test_hexdecoct_SOURCES = \
654 src/test/test-hexdecoct.c
656 test_hexdecoct_LDADD = \
659 test_alloc_util_SOURCES = \
660 src/test/test-alloc-util.c
662 test_alloc_util_LDADD = \
665 test_io_util_SOURCES = \
666 src/test/test-io-util.c
668 test_io_util_LDADD = \
671 test_fs_util_SOURCES = \
672 src/test/test-fs-util.c
674 test_fs_util_LDADD = \
677 test_proc_cmdline_SOURCES = \
678 src/test/test-proc-cmdline.c
680 test_proc_cmdline_LDADD = \
683 test_fd_util_SOURCES = \
684 src/test/test-fd-util.c
686 test_fd_util_LDADD = \
689 test_stat_util_SOURCES = \
690 src/test/test-stat-util.c
692 test_stat_util_LDADD = \
695 test_escape_SOURCES = \
696 src/test/test-escape.c
698 test_escape_LDADD = \
701 test_string_util_SOURCES = \
702 src/test/test-string-util.c
704 test_string_util_LDADD = \
707 test_extract_word_SOURCES = \
708 src/test/test-extract-word.c
710 test_extract_word_LDADD = \
713 test_parse_util_SOURCES = \
714 src/test/test-parse-util.c
716 test_parse_util_LDADD = \
719 test_user_util_SOURCES = \
720 src/test/test-user-util.c
722 test_user_util_LDADD = \
725 test_process_util_SOURCES = \
726 src/test/test-process-util.c
728 test_process_util_LDADD = \
731 test_verbs_SOURCES = \
732 src/test/test-verbs.c
737 test_signal_util_SOURCES = \
738 src/test/test-signal-util.c
740 test_signal_util_LDADD = \
743 test_selinux_SOURCES = \
744 src/test/test-selinux.c
746 test_selinux_LDADD = \
749 test_sizeof_SOURCES = \
750 src/test/test-sizeof.c
752 test_sizeof_LDADD = \
756 src/test/test-hashmap-ordered.c
758 src/test/test-hashmap-ordered.c: src/test/test-hashmap-plain.c
759 $(AM_V_at)$(MKDIR_P) $(dir $@)
760 $(AM_V_GEN)$(AWK) 'BEGIN { print "/* GENERATED FILE */\n#define ORDERED" } \
761 { if (!match($$0, "^#include")) \
762 gsub(/hashmap/, "ordered_hashmap"); \
763 gsub(/HASHMAP/, "ORDERED_HASHMAP"); \
764 gsub(/Hashmap/, "OrderedHashmap"); \
767 nodist_test_hashmap_SOURCES = \
768 src/test/test-hashmap-ordered.c
770 test_hashmap_SOURCES = \
771 src/test/test-hashmap.c \
772 src/test/test-hashmap-plain.c
774 test_hashmap_LDADD = \
783 test_list_SOURCES = \
789 test_unaligned_LDADD = \
792 test_unaligned_SOURCES = \
793 src/test/test-unaligned.c
795 test_prioq_SOURCES = \
796 src/test/test-prioq.c
807 test_ipcrm_SOURCES = \
808 src/test/test-ipcrm.c
813 test_ellipsize_SOURCES = \
814 src/test/test-ellipsize.c
816 test_ellipsize_LDADD = \
819 test_strip_tab_ansi_SOURCES = \
820 src/test/test-strip-tab-ansi.c
822 test_strip_tab_ansi_LDADD = \
825 test_cgroup_SOURCES = \
826 src/test/test-cgroup.c
828 test_cgroup_LDADD = \
831 test_path_util_SOURCES = \
832 src/test/test-path-util.c
834 test_path_util_LDADD = \
837 test_siphash24_SOURCES = \
838 src/test/test-siphash24.c
840 test_siphash24_LDADD = \
843 test_conf_files_SOURCES = \
844 src/test/test-conf-files.c
846 test_conf_files_LDADD = \
849 test_conf_parser_SOURCES = \
850 src/test/test-conf-parser.c
852 test_conf_parser_LDADD = \
855 # ------------------------------------------------------------------------------
856 ## .PHONY so it always rebuilds it
857 .PHONY: coverage lcov-run lcov-report coverage-sync
859 # run lcov from scratch, always
864 coverage_dir = coverage
865 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
868 # reset run coverage tests
870 @rm -rf $(coverage_dir)
871 lcov $(coverage_opts) --zerocounters
874 # generate report based on current coverage data
876 $(MKDIR_P) $(coverage_dir)
877 lcov $(coverage_opts) --compat-libtool --capture --no-external \
878 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
879 lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*'
880 genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info
881 @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
883 # lcov doesn't work properly with vpath builds, make sure that bad
884 # output is not uploaded by mistake.
885 coverage-sync: coverage
886 test "$(builddir)" = "$(srcdir)"
887 rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
890 lcov-run lcov-report:
891 echo "Need to reconfigure with --enable-coverage"
894 # ------------------------------------------------------------------------------
897 dist_factory_pam_DATA = \
898 factory/etc/pam.d/system-auth \
899 factory/etc/pam.d/other
902 # ------------------------------------------------------------------------------
903 pkglibexec_PROGRAMS += \
904 elogind-cgroups-agent
906 elogind_cgroups_agent_SOURCES = \
907 src/cgroups-agent/cgroups-agent.c
909 elogind_cgroups_agent_LDADD = \
912 # ------------------------------------------------------------------------------
913 libelogind_internal_la_SOURCES = \
914 src/systemd/sd-bus.h \
915 src/systemd/sd-bus-protocol.h \
916 src/systemd/sd-bus-vtable.h \
917 src/systemd/sd-event.h \
918 src/systemd/sd-login.h \
919 src/systemd/sd-id128.h \
920 src/systemd/sd-daemon.h \
921 src/libelogind/libelogind.sym \
922 src/libelogind/sd-bus/sd-bus.c \
923 src/libelogind/sd-bus/bus-control.c \
924 src/libelogind/sd-bus/bus-control.h \
925 src/libelogind/sd-bus/bus-error.c \
926 src/libelogind/sd-bus/bus-error.h \
927 src/libelogind/sd-bus/bus-common-errors.h \
928 src/libelogind/sd-bus/bus-common-errors.c \
929 src/libelogind/sd-bus/bus-internal.c \
930 src/libelogind/sd-bus/bus-internal.h \
931 src/libelogind/sd-bus/bus-socket.c \
932 src/libelogind/sd-bus/bus-socket.h \
933 src/libelogind/sd-bus/bus-kernel.c \
934 src/libelogind/sd-bus/bus-kernel.h \
935 src/libelogind/sd-bus/bus-container.c \
936 src/libelogind/sd-bus/bus-container.h \
937 src/libelogind/sd-bus/bus-message.c \
938 src/libelogind/sd-bus/bus-message.h \
939 src/libelogind/sd-bus/bus-creds.c \
940 src/libelogind/sd-bus/bus-creds.h \
941 src/libelogind/sd-bus/bus-signature.c \
942 src/libelogind/sd-bus/bus-signature.h \
943 src/libelogind/sd-bus/bus-type.c \
944 src/libelogind/sd-bus/bus-type.h \
945 src/libelogind/sd-bus/bus-match.c \
946 src/libelogind/sd-bus/bus-match.h \
947 src/libelogind/sd-bus/bus-bloom.c \
948 src/libelogind/sd-bus/bus-bloom.h \
949 src/libelogind/sd-bus/bus-introspect.c \
950 src/libelogind/sd-bus/bus-introspect.h \
951 src/libelogind/sd-bus/bus-objects.c \
952 src/libelogind/sd-bus/bus-objects.h \
953 src/libelogind/sd-bus/bus-gvariant.c \
954 src/libelogind/sd-bus/bus-gvariant.h \
955 src/libelogind/sd-bus/bus-convenience.c \
956 src/libelogind/sd-bus/bus-track.c \
957 src/libelogind/sd-bus/bus-track.h \
958 src/libelogind/sd-bus/bus-slot.c \
959 src/libelogind/sd-bus/bus-slot.h \
960 src/libelogind/sd-bus/bus-protocol.h \
961 src/libelogind/sd-event/sd-event.c \
962 src/libelogind/sd-id128/sd-id128.c \
963 src/libelogind/sd-id128/id128-util.h \
964 src/libelogind/sd-id128/id128-util.c \
965 src/libelogind/sd-daemon/sd-daemon.c \
966 src/libelogind/sd-login/sd-login.c
968 noinst_LTLIBRARIES += \
969 libelogind-internal.la
972 src/libelogind/libelogind.pc.in \
973 src/libelogind/sd-bus/DIFFERENCES \
974 src/libelogind/sd-bus/GVARIANT-SERIALIZATION
976 libelogind_la_SOURCES =
978 libelogind_la_LDFLAGS = \
980 -version-info $(LIBELOGIND_CURRENT):$(LIBELOGIND_REVISION):$(LIBELOGIND_AGE) \
981 -Wl,--version-script=$(top_srcdir)/src/libelogind/libelogind.sym
983 libelogind_la_LIBADD = \
984 libelogind-internal.la \
987 pkgconfiglib_DATA += \
988 src/libelogind/libelogind.pc
990 pkginclude_HEADERS += \
991 src/systemd/sd-login.h \
992 src/systemd/sd-messages.h \
993 src/systemd/sd-id128.h \
994 src/systemd/_sd-common.h
997 $(MKDIR_P) $(DESTDIR)/$(pkgincludedir)
998 cd $(DESTDIR)/$(includedir)/elogind && \
999 for hdr in $(notdir $(pkginclude_HEADERS)) ; do \
1001 $(LN_S) systemd/$$hdr $$hdr ; \
1004 header-uninstall-hook:
1005 m -f $(DESTDIR)/$(includedir)/elogind/*.h
1007 INSTALL_EXEC_HOOKS += header-install-hook
1008 UNINSTALL_EXEC_HOOKS += header-uninstall-hook
1010 rootlib_LTLIBRARIES += \
1014 test-bus-signature \
1017 test-bus-introspect \
1021 test_bus_signature_SOURCES = \
1022 src/libelogind/sd-bus/test-bus-signature.c
1024 test_bus_signature_LDADD = \
1025 libelogind-shared.la
1027 test_bus_server_SOURCES = \
1028 src/libelogind/sd-bus/test-bus-server.c
1030 test_bus_server_LDADD = \
1031 libelogind-shared.la
1033 test_bus_error_SOURCES = \
1034 src/libelogind/sd-bus/test-bus-error.c
1036 # Link statically because this test uses BUS_ERROR_MAP_ELF_REGISTER
1037 test_bus_error_LDADD = \
1040 test_bus_match_SOURCES = \
1041 src/libelogind/sd-bus/test-bus-match.c
1043 test_bus_match_LDADD = \
1044 libelogind-shared.la
1046 test_bus_introspect_SOURCES = \
1047 src/libelogind/sd-bus/test-bus-introspect.c
1049 test_bus_introspect_LDADD = \
1050 libelogind-shared.la
1052 test_event_SOURCES = \
1053 src/libelogind/sd-event/test-event.c
1055 test_event_LDADD = \
1056 libelogind-shared.la
1058 # ------------------------------------------------------------------------------
1059 test_id128_SOURCES = \
1060 src/test/test-id128.c
1062 test_id128_LDADD = \
1063 libelogind-shared.la
1068 # ------------------------------------------------------------------------------
1069 test_hash_SOURCES = \
1070 src/test/test-hash.c
1073 libelogind-shared.la
1078 # ------------------------------------------------------------------------------
1080 src/login/logind.c \
1083 nodist_elogind_SOURCES = \
1084 src/login/logind-gperf.c
1089 libelogind_core_la_SOURCES = \
1092 src/core/mount-setup.h \
1093 src/core/mount-setup.c \
1094 src/login/elogind.c \
1095 src/login/elogind.h \
1096 src/login/elogind-action.c \
1097 src/login/elogind-action.h \
1098 src/login/elogind-dbus.c \
1099 src/login/elogind-dbus.h \
1100 src/login/logind-core.c \
1101 src/login/logind-device.c \
1102 src/login/logind-device.h \
1103 src/login/logind-button.c \
1104 src/login/logind-button.h \
1105 src/login/logind-action.c \
1106 src/login/logind-action.h \
1107 src/login/logind-seat.c \
1108 src/login/logind-seat.h \
1109 src/login/logind-session.c \
1110 src/login/logind-session.h \
1111 src/login/logind-session-device.c \
1112 src/login/logind-session-device.h \
1113 src/login/logind-user.c \
1114 src/login/logind-user.h \
1115 src/login/logind-inhibit.c \
1116 src/login/logind-inhibit.h \
1117 src/login/logind-dbus.c \
1118 src/login/logind-session-dbus.c \
1119 src/login/logind-seat-dbus.c \
1120 src/login/logind-user-dbus.c \
1121 src/login/logind-utmp.c \
1122 src/login/logind-acl.h \
1127 libelogind_core_la_SOURCES += \
1128 src/shared/utmp-wtmp.c \
1129 src/update-utmp/update-utmp.c
1132 libelogind_core_la_LIBADD = \
1133 libelogind-shared.la
1136 libelogind_core_la_SOURCES += \
1137 src/login/logind-acl.c
1140 noinst_LTLIBRARIES += \
1143 pkglibexec_PROGRAMS += \
1146 loginctl_SOURCES = \
1147 src/login/eloginctl.c \
1148 src/login/eloginctl.h \
1149 src/login/loginctl.c \
1150 src/login/sysfs-show.h \
1151 src/login/sysfs-show.c
1154 libelogind-shared.la
1156 rootbin_PROGRAMS += \
1159 dist_bashcompletion_data = \
1160 shell-completion/bash/loginctl
1162 dist_zshcompletion_data = \
1163 shell-completion/zsh/_loginctl \
1164 shell-completion/zsh/_elogind-inhibit
1166 elogind_inhibit_SOURCES = \
1169 elogind_inhibit_LDADD = \
1170 libelogind-shared.la
1172 rootbin_PROGRAMS += \
1175 test_login_SOURCES = \
1176 src/libelogind/sd-login/test-login.c
1178 test_login_LDADD = \
1179 libelogind-shared.la
1181 test_login_shared_SOURCES = \
1182 src/login/test-login-shared.c
1184 test_login_shared_LDADD = \
1185 libelogind-shared.la
1187 test_inhibit_SOURCES = \
1188 src/login/test-inhibit.c
1190 test_inhibit_LDADD = \
1191 libelogind-shared.la
1193 test_login_tables_SOURCES = \
1194 src/login/test-login-tables.c
1196 test_login_tables_LDADD = \
1208 pam_elogind_la_SOURCES = \
1209 src/login/pam_elogind.sym \
1210 src/login/pam_elogind.c
1212 pam_elogind_la_CFLAGS = \
1216 pam_elogind_la_LDFLAGS = \
1222 -Wl,--version-script=$(top_srcdir)/src/login/pam_elogind.sym
1224 pam_elogind_la_LIBADD = \
1228 pamlib_LTLIBRARIES = \
1231 if ENABLE_PAM_CONFIG
1232 dist_pamconf_DATA = \
1233 src/login/elogind-user
1237 src/login/elogind-user.m4
1240 dist_dbussystemservice_DATA += \
1241 src/login/org.freedesktop.login1.service
1243 dist_dbuspolicy_DATA += \
1244 src/login/org.freedesktop.login1.conf
1246 nodist_pkgsysconf_DATA += \
1247 src/login/logind.conf
1249 polkitpolicy_files += \
1250 src/login/org.freedesktop.login1.policy
1252 dist_udevrules_DATA += \
1253 src/login/70-uaccess.rules \
1254 src/login/70-power-switch.rules
1256 nodist_udevrules_DATA += \
1257 src/login/71-seat.rules \
1258 src/login/73-seat-late.rules
1260 polkitpolicy_in_files += \
1261 src/login/org.freedesktop.login1.policy.in
1263 gperf_gperf_sources = \
1264 src/login/logind-gperf.gperf
1267 src/login/71-seat.rules.in \
1268 src/login/73-seat-late.rules.in \
1269 src/login/logind.conf.in
1271 # ------------------------------------------------------------------------------
1273 '|rootlibdir=$(rootlibdir)|' \
1274 '|rootlibexecdir=$(rootlibexecdir)|' \
1275 '|rootbindir=$(rootbindir)|' \
1276 '|bindir=$(bindir)|' \
1277 '|pkgsysconfdir=$(pkgsysconfdir)|' \
1278 '|pkgdatadir=$(pkgdatadir)|' \
1279 '|udevrulesdir=$(udevrulesdir)|' \
1280 '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
1281 '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
1282 '|PACKAGE_URL=$(PACKAGE_URL)|' \
1283 '|prefix=$(prefix)|' \
1284 '|exec_prefix=$(exec_prefix)|' \
1285 '|libdir=$(libdir)|' \
1286 '|includedir=$(includedir)|' \
1287 '|VERSION=$(VERSION)|' \
1288 '|rootprefix=$(rootprefix)|' \
1289 '|udevlibexecdir=$(udevlibexecdir)|' \
1291 '|MKDIR_P=$(MKDIR_P)|' \
1292 '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
1293 '|systemuidmax=$(SYSTEM_UID_MAX)|' \
1294 '|systemgidmax=$(SYSTEM_GID_MAX)|' \
1295 '|TTY_GID=$(TTY_GID)|'
1298 $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
1299 $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
1306 sysctl.d/%: sysctl.d/%.in
1312 shell-completion/%: shell-completion/%.in
1323 $(AM_V_GEN)chmod +x $@
1325 src/%.c: src/%.gperf
1326 $(AM_V_at)$(MKDIR_P) $(dir $@)
1327 $(AM_V_GPERF)$(GPERF) < $< > $@
1330 $(AM_V_at)$(MKDIR_P) $(dir $@)
1331 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1333 sysusers.d/%: sysusers.d/%.m4
1334 $(AM_V_at)$(MKDIR_P) $(dir $@)
1335 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1337 tmpfiles.d/%: tmpfiles.d/%.m4
1338 $(AM_V_at)$(MKDIR_P) $(dir $@)
1339 $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
1343 $(AM_V_at)$(MKDIR_P) $(dir $@)
1344 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
1346 units/user/%: units/user/%.m4
1347 $(AM_V_at)$(MKDIR_P) $(dir $@)
1348 $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
1351 nodist_polkitpolicy_DATA = \
1352 $(polkitpolicy_files)
1353 polkitrules_DATA = $(polkitrules_files)
1354 polkitpkla_DATA = $(polkitpkla_files)
1358 $(polkitpolicy_in_files)
1360 # ------------------------------------------------------------------------------
1362 man/custom-entities.ent: configure.ac
1363 $(AM_V_GEN)$(MKDIR_P) $(dir $@)
1364 $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
1365 printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
1369 man/custom-entities.ent
1374 --stringparam man.output.quietly 1 \
1375 --stringparam funcsynopsis.style ansi \
1376 --stringparam man.authors.section.enabled 0 \
1377 --stringparam man.copyright.section.enabled 0 \
1378 --stringparam elogind.version $(VERSION) \
1379 --path '$(builddir)/man:$(srcdir)/man'
1381 XSLTPROC_PROCESS_MAN = \
1382 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
1384 XSLTPROC_PROCESS_HTML = \
1385 $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
1387 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
1388 $(XSLTPROC_PROCESS_MAN)
1390 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
1391 $(XSLTPROC_PROCESS_MAN)
1393 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
1394 $(XSLTPROC_PROCESS_MAN)
1396 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
1397 $(XSLTPROC_PROCESS_MAN)
1399 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
1400 $(XSLTPROC_PROCESS_MAN)
1402 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
1403 $(XSLTPROC_PROCESS_HTML)
1406 $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
1412 man/custom-html.xsl \
1415 install-exec-hook: $(INSTALL_EXEC_HOOKS)
1417 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
1419 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
1421 clean-local: $(CLEAN_LOCAL_HOOKS)
1422 rm -rf $(abs_srcdir)/install-tree
1423 rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
1424 $(abs_srcdir)/hwdb/iab.txt
1426 DISTCHECK_CONFIGURE_FLAGS = \
1427 --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
1428 --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
1429 --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
1430 --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
1431 --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
1432 --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
1433 --with-rootprefix=$$dc_install_base
1436 DISTCHECK_CONFIGURE_FLAGS += \
1439 DISTCHECK_CONFIGURE_FLAGS += \
1443 .PHONY: dist-check-help
1444 dist-check-help: $(rootbin_PROGRAMS)
1445 for i in $(abspath $^); do \
1446 if $$i --help | grep -v 'default:' | grep -E -q '.{80}.' ; then \
1447 echo "$(basename $$i) --help output is too wide:"; \
1448 $$i --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
1452 include_compilers = "$(CC)" "$(CC) -ansi" "$(CC) -std=iso9899:1990"
1453 public_headers = $(filter-out src/systemd/_sd-common.h, $(pkginclude_HEADERS) $(include_HEADERS))
1454 .PHONY: dist-check-includes
1455 dist-check-includes: $(public_headers)
1457 for i in $(abspath $^); do \
1458 for cc in $(include_compilers); do \
1459 echo "$$cc -o/dev/null -c -x c -include "$$i" - </dev/null"; \
1460 $$cc -o/dev/null -c -x c -include "$$i" - </dev/null || res=1; \
1468 git tag -s "v$(VERSION)" -m "elogind $(VERSION)"
1472 $(AM_V_at)git archive --format=tar --prefix=elogind-$(VERSION)-raw/ HEAD | \
1473 (cd /var/tmp/ && tar xf -)
1474 $(AM_V_GEN)(cd /var/tmp && rm -rf elogind-$(VERSION) && $(MKDIR_P) elogind-$(VERSION) && \
1475 for f in `find elogind-$(VERSION)-raw/ -type f | cut -d '/' -f 2-` ; do \
1476 $(MKDIR_P) elogind-$(VERSION)/`dirname $$f` ; \
1477 $(AWK) 'BEGIN { i=0;e=0 } \
1478 /^#if\s+0.*elogind.*$$/ { i=1;next } \
1480 { if ( i==1 ) e=1; else print }{next} \
1482 /^#endif\s*\/\/\s*0\s*$$/ { \
1483 { if ( i==1 ) { i=0;e=0 } else print }{next} \
1485 /^\s*\/\/\/.*elogind.*$$/{ next } \
1486 /^\s*\/\/\s*#include.+$$/{ next } \
1487 { if ( (i==0) || (e==1) ) print }' \
1488 elogind-$(VERSION)-raw/$$f \
1489 > elogind-$(VERSION)/$$f ; \
1490 chmod `stat -c '%a' elogind-$(VERSION)-raw/$$f` \
1491 elogind-$(VERSION)/$$f ; \
1493 for l in `find elogind-$(VERSION)-raw/ -type l | cut -d '/' -f 2-` ; do \
1494 $(MKDIR_P) elogind-$(VERSION)/`dirname $$l` ; \
1495 cp -P elogind-$(VERSION)-raw/$$l elogind-$(VERSION)/$$l ; \
1497 tar czf elogind-$(VERSION).tar.gz elogind-$(VERSION) ; \
1498 rm -rf elogind-$(VERSION) elogind-$(VERSION)-raw) ; \
1499 $(AM_V_at)mv /var/tmp/elogind-$(VERSION).tar.gz ./
1501 .PHONY: install-tree
1503 rm -rf $(abs_srcdir)/install-tree
1504 $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
1505 tree $(abs_srcdir)/install-tree
1507 # Let's run all tests of the test suite, but under valgrind. Let's
1508 # exclude perl/python/shell scripts we have in there
1509 .PHONY: valgrind-tests
1510 valgrind-tests: $(TESTS)
1511 $(AM_V_GEN)for f in $(filter-out %.pl %.py, $^); do \
1512 if $(LIBTOOL) --mode=execute file $$f | grep -q shell; then \
1513 echo -e "$${x}Skipping non-binary $$f"; else \
1514 echo -e "$${x}Running $$f"; \
1515 $(AM_TESTS_ENVIRONMENT) $(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
1520 $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
1522 exported: $(addprefix exported-, $(rootlib_LTLIBRARIES))
1523 $(AM_V_GEN)cat $^ > $@
1525 .PHONY: check-api-docs
1526 check-api-docs: exported man
1527 $(AM_V_GEN)for symbol in `cat exported` ; do \
1528 if test -f $(builddir)/man/$$symbol.html ; then \
1529 echo " Symbol $$symbol() is documented." ; \
1531 echo "‣ Symbol $$symbol() lacks documentation." ; \
1535 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
1536 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
1538 undefined defined: $(ALL_OBJECTS)
1539 $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
1540 $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
1541 done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
1547 .PHONY: check-api-unused
1548 check-api-unused: defined undefined exported
1549 ( cat exported undefined ) | sort -u | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
1551 .PHONY: check-includes
1552 check-includes: $(top_srcdir)/tools/check-includes.pl
1553 $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
1554 | xargs $(top_srcdir)/tools/check-includes.pl
1557 $(top_srcdir)/tools/check-includes.pl
1559 # Stupid test that everything purported to be exported really is
1560 define generate-sym-test
1561 $(AM_V_at)$(MKDIR_P) $(dir $@)
1562 $(AM_V_at)printf '#include <stdio.h>\n' > $@
1563 $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
1564 $(AM_V_at)printf 'void* functions[] = {\n' >> $@
1565 $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
1566 $(AM_V_at)printf '};\nint main(void) {\n' >> $@
1567 $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
1568 $(AM_V_at)printf 'return 0; }\n' >> $@
1571 test-libelogind-sym.c: \
1572 $(top_builddir)/src/libelogind/libelogind.sym \
1573 src/systemd/sd-daemon.h \
1574 src/systemd/sd-login.h \
1575 src/systemd/sd-bus.h \
1576 src/systemd/sd-event.h
1577 $(generate-sym-test)
1579 test_libelogind_sym_SOURCES = \
1580 test-libelogind-sym.c
1581 test_libelogind_sym_LDADD = \
1585 $(test_libelogind_sym_SOURCES)
1590 .PHONY: install-tests
1591 install-tests: $(tests) $(TEST_DATA_FILES)
1592 for f in $(tests); do \
1593 if [ -x $(top_builddir)/.libs/$$f ]; then \
1594 install -D -m 755 $(top_builddir)/.libs/$$f $(DESTDIR)/$(testsdir)/$$f; \
1596 install -D -m 755 $(top_builddir)/$$f $(DESTDIR)/$(testsdir)/$$f; \
1599 for f in $(TEST_DATA_FILES); do \
1600 install -D -m 644 $(top_srcdir)/$$f $(DESTDIR)/$(testsdir)/testdata/$${f#test/}; \
1603 .PHONY: cccc cppcheck
1605 cccc --outdir=$(top_builddir)/cccc \
1606 `find $(top_srcdir)/src/ -name '*.h' -or -name '*.c'`
1609 cppcheck --enable=all -q \
1610 -I $(top_srcdir)/src \
1611 -I $(top_builddir)/src/basic \
1612 -I $(top_srcdir)/src/basic \
1613 -I $(top_srcdir)/src/core \
1614 -I $(top_srcdir)/src/shared \
1615 -I $(top_builddir)/src/shared \
1616 -I $(top_srcdir)/src/login \
1617 -I $(top_srcdir)/src/systemd \
1618 -I $(top_srcdir)/src/libelogind/sd-bus \
1619 -I $(top_srcdir)/src/libelogind/sd-event \
1620 -I $(top_srcdir)/src/libelogind/sd-login \
1621 -I $(top_srcdir)/src/libelogind/sd-id128 \
1622 -I $(top_srcdir)/src/update-utmp \
1623 -I $(top_srcdir)/src/sleep \
1627 # Used to extract compile flags for YCM.
1632 @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | sed 's/ / /g' | awk '{ print $$0 "," }' | sort -u
1635 tools/gdb-sd_dump_hashmaps.py
1638 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
1641 gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -