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/udev-util.h \
460 src/shared/udev-util.c \
461 src/shared/bus-util.c \
462 src/shared/bus-util.h \
463 src/shared/clean-ipc.c \
464 src/shared/clean-ipc.h \
465 src/shared/conf-parser.c \
466 src/shared/conf-parser.h \
467 src/shared/musl_missing.h \
468 src/shared/musl_missing.c \
471 src/shared/sleep-config.c \
472 src/shared/sleep-config.h \
473 src/shared/spawn-polkit-agent.c \
474 src/shared/spawn-polkit-agent.h \
477 src/shared/nsflags.h \
481 libshared_la_SOURCES += \
482 src/shared/acl-util.c \
483 src/shared/acl-util.h
486 libshared_la_CFLAGS = \
490 libshared_la_LIBADD = \
491 libelogind-internal.la \
496 noinst_LTLIBRARIES += \
499 libelogind_shared_la_SOURCES = \
500 $(libbasic_la_SOURCES) \
501 $(libshared_la_SOURCES) \
502 $(libelogind_internal_la_SOURCES)
504 libelogind_shared_la_CFLAGS = \
506 $(libbasic_la_CFLAGS) \
507 $(libshared_la_CFLAGS) \
508 $(libelogind_internal_la_CFLAGS) \
509 $(libelogind_journal_internal_la_CFLAGS) \
510 $(libudev_internal_la_CFLAGS) \
516 # We can't use libshared_la_LIBADD here because it would
517 # pull in libelogind*-internal.la
518 libelogind_shared_la_LIBADD = \
519 $(libbasic_la_LIBADD) \
520 $(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 \
612 test/bus-policy/hello.conf \
613 test/bus-policy/methods.conf \
614 test/bus-policy/ownerships.conf \
615 test/bus-policy/signals.conf \
616 test/bus-policy/check-own-rules.conf \
617 test/bus-policy/many-rules.conf \
618 test/bus-policy/test.conf
622 src/test/test-helper.h
624 test_utf8_SOURCES = \
630 test_locale_util_SOURCES = \
631 src/test/test-locale-util.c
633 test_locale_util_LDADD = \
636 test_copy_SOURCES = \
639 # Link statically to ensure file is large
643 test_util_SOURCES = \
649 test_exec_util_SOURCES = \
650 src/test/test-exec-util.c
652 test_exec_util_LDADD = \
655 test_hexdecoct_SOURCES = \
656 src/test/test-hexdecoct.c
658 test_hexdecoct_LDADD = \
661 test_alloc_util_SOURCES = \
662 src/test/test-alloc-util.c
664 test_alloc_util_LDADD = \
667 test_io_util_SOURCES = \
668 src/test/test-io-util.c
670 test_io_util_LDADD = \
673 test_fs_util_SOURCES = \
674 src/test/test-fs-util.c
676 test_fs_util_LDADD = \
679 test_proc_cmdline_SOURCES = \
680 src/test/test-proc-cmdline.c
682 test_proc_cmdline_LDADD = \
685 test_fd_util_SOURCES = \
686 src/test/test-fd-util.c
688 test_fd_util_LDADD = \
691 test_stat_util_SOURCES = \
692 src/test/test-stat-util.c
694 test_stat_util_LDADD = \
697 test_escape_SOURCES = \
698 src/test/test-escape.c
700 test_escape_LDADD = \
703 test_string_util_SOURCES = \
704 src/test/test-string-util.c
706 test_string_util_LDADD = \
709 test_extract_word_SOURCES = \
710 src/test/test-extract-word.c
712 test_extract_word_LDADD = \
715 test_parse_util_SOURCES = \
716 src/test/test-parse-util.c
718 test_parse_util_LDADD = \
721 test_user_util_SOURCES = \
722 src/test/test-user-util.c
724 test_user_util_LDADD = \
727 test_process_util_SOURCES = \
728 src/test/test-process-util.c
730 test_process_util_LDADD = \
733 test_verbs_SOURCES = \
734 src/test/test-verbs.c
739 test_signal_util_SOURCES = \
740 src/test/test-signal-util.c
742 test_signal_util_LDADD = \
745 test_selinux_SOURCES = \
746 src/test/test-selinux.c
748 test_selinux_LDADD = \
751 test_sizeof_SOURCES = \
752 src/test/test-sizeof.c
754 test_sizeof_LDADD = \
758 src/test/test-hashmap-ordered.c
760 src/test/test-hashmap-ordered.c: src/test/test-hashmap-plain.c
761 $(AM_V_at)$(MKDIR_P) $(dir $@)
762 $(AM_V_GEN)$(AWK) 'BEGIN { print "/* GENERATED FILE */\n#define ORDERED" } \
763 { if (!match($$0, "^#include")) \
764 gsub(/hashmap/, "ordered_hashmap"); \
765 gsub(/HASHMAP/, "ORDERED_HASHMAP"); \
766 gsub(/Hashmap/, "OrderedHashmap"); \
769 nodist_test_hashmap_SOURCES = \
770 src/test/test-hashmap-ordered.c
772 test_hashmap_SOURCES = \
773 src/test/test-hashmap.c \
774 src/test/test-hashmap-plain.c
776 test_hashmap_LDADD = \
785 test_list_SOURCES = \
791 test_unaligned_LDADD = \
794 test_unaligned_SOURCES = \
795 src/test/test-unaligned.c
797 test_prioq_SOURCES = \
798 src/test/test-prioq.c
809 test_ipcrm_SOURCES = \
810 src/test/test-ipcrm.c
815 test_ellipsize_SOURCES = \
816 src/test/test-ellipsize.c
818 test_ellipsize_LDADD = \
821 test_strip_tab_ansi_SOURCES = \
822 src/test/test-strip-tab-ansi.c
824 test_strip_tab_ansi_LDADD = \
827 test_cgroup_SOURCES = \
828 src/test/test-cgroup.c
830 test_cgroup_LDADD = \
833 test_path_util_SOURCES = \
834 src/test/test-path-util.c
836 test_path_util_LDADD = \
839 test_siphash24_SOURCES = \
840 src/test/test-siphash24.c
842 test_siphash24_LDADD = \
845 test_conf_files_SOURCES = \
846 src/test/test-conf-files.c
848 test_conf_files_LDADD = \
851 test_conf_parser_SOURCES = \
852 src/test/test-conf-parser.c
854 test_conf_parser_LDADD = \
857 # ------------------------------------------------------------------------------
858 ## .PHONY so it always rebuilds it
859 .PHONY: coverage lcov-run lcov-report coverage-sync
861 # run lcov from scratch, always
866 coverage_dir = coverage
867 coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
870 # reset run coverage tests
872 @rm -rf $(coverage_dir)
873 lcov $(coverage_opts) --zerocounters
876 # generate report based on current coverage data
878 $(MKDIR_P) $(coverage_dir)
879 lcov $(coverage_opts) --compat-libtool --capture --no-external \
880 | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
881 lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*'
882 genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info
883 @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
885 # lcov doesn't work properly with vpath builds, make sure that bad
886 # output is not uploaded by mistake.
887 coverage-sync: coverage
888 test "$(builddir)" = "$(srcdir)"
889 rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
892 lcov-run lcov-report:
893 echo "Need to reconfigure with --enable-coverage"
896 # ------------------------------------------------------------------------------
899 dist_factory_pam_DATA = \
900 factory/etc/pam.d/system-auth \
901 factory/etc/pam.d/other
904 # ------------------------------------------------------------------------------
905 pkglibexec_PROGRAMS += \
906 elogind-cgroups-agent
908 elogind_cgroups_agent_SOURCES = \
909 src/cgroups-agent/cgroups-agent.c
911 elogind_cgroups_agent_LDADD = \
914 # ------------------------------------------------------------------------------
915 libelogind_internal_la_SOURCES = \
916 src/systemd/sd-bus.h \
917 src/systemd/sd-bus-protocol.h \
918 src/systemd/sd-bus-vtable.h \
919 src/systemd/sd-event.h \
920 src/systemd/sd-login.h \
921 src/systemd/sd-id128.h \
922 src/systemd/sd-daemon.h \
923 src/libelogind/libelogind.sym \
924 src/libelogind/sd-bus/sd-bus.c \
925 src/libelogind/sd-bus/bus-control.c \
926 src/libelogind/sd-bus/bus-control.h \
927 src/libelogind/sd-bus/bus-error.c \
928 src/libelogind/sd-bus/bus-error.h \
929 src/libelogind/sd-bus/bus-common-errors.h \
930 src/libelogind/sd-bus/bus-common-errors.c \
931 src/libelogind/sd-bus/bus-internal.c \
932 src/libelogind/sd-bus/bus-internal.h \
933 src/libelogind/sd-bus/bus-socket.c \
934 src/libelogind/sd-bus/bus-socket.h \
935 src/libelogind/sd-bus/bus-kernel.c \
936 src/libelogind/sd-bus/bus-kernel.h \
937 src/libelogind/sd-bus/bus-container.c \
938 src/libelogind/sd-bus/bus-container.h \
939 src/libelogind/sd-bus/bus-message.c \
940 src/libelogind/sd-bus/bus-message.h \
941 src/libelogind/sd-bus/bus-creds.c \
942 src/libelogind/sd-bus/bus-creds.h \
943 src/libelogind/sd-bus/bus-signature.c \
944 src/libelogind/sd-bus/bus-signature.h \
945 src/libelogind/sd-bus/bus-type.c \
946 src/libelogind/sd-bus/bus-type.h \
947 src/libelogind/sd-bus/bus-match.c \
948 src/libelogind/sd-bus/bus-match.h \
949 src/libelogind/sd-bus/bus-bloom.c \
950 src/libelogind/sd-bus/bus-bloom.h \
951 src/libelogind/sd-bus/bus-introspect.c \
952 src/libelogind/sd-bus/bus-introspect.h \
953 src/libelogind/sd-bus/bus-objects.c \
954 src/libelogind/sd-bus/bus-objects.h \
955 src/libelogind/sd-bus/bus-gvariant.c \
956 src/libelogind/sd-bus/bus-gvariant.h \
957 src/libelogind/sd-bus/bus-convenience.c \
958 src/libelogind/sd-bus/bus-track.c \
959 src/libelogind/sd-bus/bus-track.h \
960 src/libelogind/sd-bus/bus-slot.c \
961 src/libelogind/sd-bus/bus-slot.h \
962 src/libelogind/sd-bus/bus-protocol.h \
963 src/libelogind/sd-event/sd-event.c \
964 src/libelogind/sd-id128/sd-id128.c \
965 src/libelogind/sd-id128/id128-util.h \
966 src/libelogind/sd-id128/id128-util.c \
967 src/libelogind/sd-daemon/sd-daemon.c \
968 src/libelogind/sd-login/sd-login.c
970 noinst_LTLIBRARIES += \
971 libelogind-internal.la
974 src/libelogind/libelogind.pc.in \
975 src/libelogind/sd-bus/DIFFERENCES \
976 src/libelogind/sd-bus/GVARIANT-SERIALIZATION
978 libelogind_la_SOURCES =
980 libelogind_la_LDFLAGS = \
982 -version-info $(LIBELOGIND_CURRENT):$(LIBELOGIND_REVISION):$(LIBELOGIND_AGE) \
983 -Wl,--version-script=$(top_srcdir)/src/libelogind/libelogind.sym
985 libelogind_la_LIBADD = \
986 libelogind-internal.la \
989 pkgconfiglib_DATA += \
990 src/libelogind/libelogind.pc
992 pkginclude_HEADERS += \
993 src/systemd/sd-login.h \
994 src/systemd/sd-messages.h \
995 src/systemd/sd-id128.h \
996 src/systemd/_sd-common.h
999 $(MKDIR_P) $(DESTDIR)/$(pkgincludedir)
1000 cd $(DESTDIR)/$(includedir)/elogind && \
1001 for hdr in $(notdir $(pkginclude_HEADERS)) ; do \
1003 $(LN_S) systemd/$$hdr $$hdr ; \
1006 header-uninstall-hook:
1007 m -f $(DESTDIR)/$(includedir)/elogind/*.h
1009 INSTALL_EXEC_HOOKS += header-install-hook
1010 UNINSTALL_EXEC_HOOKS += header-uninstall-hook
1012 rootlib_LTLIBRARIES += \
1016 test-bus-signature \
1019 test-bus-introspect \
1023 test_bus_signature_SOURCES = \
1024 src/libelogind/sd-bus/test-bus-signature.c
1026 test_bus_signature_LDADD = \
1027 libelogind-shared.la
1029 test_bus_server_SOURCES = \
1030 src/libelogind/sd-bus/test-bus-server.c
1032 test_bus_server_LDADD = \
1033 libelogind-shared.la
1035 test_bus_error_SOURCES = \
1036 src/libelogind/sd-bus/test-bus-error.c
1038 # Link statically because this test uses BUS_ERROR_MAP_ELF_REGISTER
1039 test_bus_error_LDADD = \
1042 test_bus_match_SOURCES = \
1043 src/libelogind/sd-bus/test-bus-match.c
1045 test_bus_match_LDADD = \
1046 libelogind-shared.la
1048 test_bus_introspect_SOURCES = \
1049 src/libelogind/sd-bus/test-bus-introspect.c
1051 test_bus_introspect_LDADD = \
1052 libelogind-shared.la
1054 test_event_SOURCES = \
1055 src/libelogind/sd-event/test-event.c
1057 test_event_LDADD = \
1058 libelogind-shared.la
1060 # ------------------------------------------------------------------------------
1061 test_id128_SOURCES = \
1062 src/test/test-id128.c
1064 test_id128_LDADD = \
1065 libelogind-shared.la
1070 # ------------------------------------------------------------------------------
1071 test_hash_SOURCES = \
1072 src/test/test-hash.c
1075 libelogind-shared.la
1080 # ------------------------------------------------------------------------------
1082 src/login/logind.c \
1085 nodist_elogind_SOURCES = \
1086 src/login/logind-gperf.c
1091 libelogind_core_la_SOURCES = \
1094 src/core/mount-setup.h \
1095 src/core/mount-setup.c \
1096 src/login/elogind.c \
1097 src/login/elogind.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 -