chiark / gitweb /
bus-util: make sure map_basic() returns EOPNOTSUPP if called for an unknown type
[elogind.git] / Makefile.am
1 #  -*- Mode: makefile; indent-tabs-mode: t -*-
2 #
3 #  This file is part of elogind.
4 #
5 #  Copyright 2010-2012 Lennart Poettering
6 #  Copyright 2010-2012 Kay Sievers
7 #  Copyright 2013 Zbigniew Jędrzejewski-Szmek
8 #  Copyright 2013 David Strauss
9 #
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.
14 #
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.
19 #
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/>.
22
23 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
24 AM_MAKEFLAGS = --no-print-directory
25 AUTOMAKE_OPTIONS = color-tests parallel-tests
26
27 GCC_COLORS ?= 'ooh, shiny!'
28 export GCC_COLORS
29
30 SUBDIRS = . po
31
32 # remove targets if the command fails
33 .DELETE_ON_ERROR:
34
35 # keep intermediate files
36 .SECONDARY:
37
38 # Keep the test-suite.log
39 .PRECIOUS: $(TEST_SUITE_LOG) Makefile
40
41 LIBELOGIND_CURRENT=16
42 LIBELOGIND_REVISION=4
43 LIBELOGIND_AGE=16
44
45 # Dirs of external packages
46 dbuspolicydir=@dbuspolicydir@
47 dbussystemservicedir=@dbussystemservicedir@
48 pamlibdir=@pamlibdir@
49 pamconfdir=@pamconfdir@
50 pkgconfigdatadir=$(datadir)/pkgconfig
51 pkgconfiglibdir=$(libdir)/pkgconfig
52 polkitpolicydir=$(datadir)/polkit-1/actions
53 bashcompletiondir=@bashcompletiondir@
54 zshcompletiondir=@zshcompletiondir@
55
56 CGROUP_CONTROLLER=@cgroup_controller@
57 PKTTYAGENT=$(bindir)/pkttyagent
58
59 # Our own, non-special dirs
60 pkgsysconfdir=$(sysconfdir)/elogind
61 pkgincludedir=$(includedir)/elogind/systemd
62 udevrulesdir=@udevrulesdir@
63 udevbindir=@udevbindir@
64 udevlibexecdir=$(udevbindir)
65 udevhomedir=$(udevlibexecdir)
66 systemshutdowndir=$(rootlibexecdir)/system-shutdown
67 systemsleepdir=$(rootlibexecdir)/system-sleep
68 factory_pamdir = $(datadir)/factory/etc/pam.d
69
70 # And these are the special ones for /
71 rootprefix=@rootprefix@
72 rootbindir=$(rootprefix)/bin
73 rootlibexecdir=$(rootprefix)/lib/elogind
74
75 EXTRA_DIST =
76 BUILT_SOURCES =
77 INSTALL_EXEC_HOOKS =
78 UNINSTALL_EXEC_HOOKS =
79 INSTALL_DATA_HOOKS =
80 UNINSTALL_DATA_HOOKS =
81 DISTCLEAN_LOCAL_HOOKS =
82 CLEAN_LOCAL_HOOKS =
83 pkginclude_HEADERS =
84 noinst_LTLIBRARIES =
85 lib_LTLIBRARIES =
86 noinst_DATA =
87 pkgconfiglib_DATA =
88 polkitpolicy_in_files =
89 polkitpolicy_files =
90 dist_udevrules_DATA =
91 nodist_udevrules_DATA =
92 dist_pkgsysconf_DATA =
93 nodist_pkgsysconf_DATA =
94 dist_dbuspolicy_DATA =
95 dist_dbussystemservice_DATA =
96 check_PROGRAMS =
97 check_DATA =
98 dist_rootlibexec_DATA =
99 tests=
100 manual_tests =
101 if ENABLE_TESTS
102 noinst_PROGRAMS = $(manual_tests) $(tests)
103 TESTS = $(tests)
104 else
105 noinst_PROGRAMS =
106 TESTS =
107 endif
108
109 if ENABLE_BASH_COMPLETION
110 dist_bashcompletion_DATA = $(dist_bashcompletion_data)
111 endif
112 if ENABLE_ZSH_COMPLETION
113 dist_zshcompletion_DATA = $(dist_zshcompletion_data)
114 endif
115
116 in_files = $(filter %.in,$(EXTRA_DIST))
117 in_in_files = $(filter %.in.in, $(in_files))
118 m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
119
120 CLEANFILES = $(BUILT_SOURCES) \
121         $(pkgconfiglib_DATA) \
122         $(in_files:.in=) $(in_in_files:.in.in=) \
123         $(m4_files:.m4=)
124
125 .PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
126         $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
127         $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
128
129 AM_CPPFLAGS = \
130         -include $(top_builddir)/config.h \
131         -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
132         -DSYSTEMD_CGROUP_CONTROLLER=\"$(CGROUP_CONTROLLER)\" \
133         -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/elogind-cgroups-agent\" \
134         -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
135         -DPOLKIT_AGENT_BINARY_PATH=\"$(PKTTYAGENT)\" \
136         -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
137         -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
138         -DHALT=\"$(HALT)\" \
139         -DREBOOT=\"$(REBOOT)\" \
140         -DKEXEC=\"$(KEXEC)\" \
141         -DLIBDIR=\"$(libdir)\" \
142         -DROOTLIBDIR=\"$(rootlibdir)\" \
143         -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
144         -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
145         -I $(top_srcdir)/src \
146         -I $(top_builddir)/src/basic \
147         -I $(top_srcdir)/src/basic \
148         -I $(top_srcdir)/src/core \
149         -I $(top_srcdir)/src/shared \
150         -I $(top_builddir)/src/shared \
151         -I $(top_srcdir)/src/login \
152         -I $(top_srcdir)/src/systemd \
153         -I $(top_srcdir)/src/libelogind/sd-bus \
154         -I $(top_srcdir)/src/libelogind/sd-event \
155         -I $(top_srcdir)/src/libelogind/sd-login \
156         -I $(top_srcdir)/src/libelogind/sd-id128 \
157         -I $(top_srcdir)/src/update-utmp \
158         -I $(top_srcdir)/src/sleep \
159         $(OUR_CPPFLAGS)
160
161 AM_CFLAGS = $(OUR_CFLAGS)
162 AM_LDFLAGS = $(OUR_LDFLAGS)
163
164 # ------------------------------------------------------------------------------
165 define move-to-rootlibdir
166         if test "$(libdir)" != "$(rootlibdir)"; then \
167                 $(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
168                 so_img_name=$$(readlink $(DESTDIR)$(libdir)/$$libname) && \
169                 rm -f $(DESTDIR)$(libdir)/$$libname && \
170                 $(LN_S) --relative -f $(DESTDIR)$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/$$libname && \
171                 mv $(DESTDIR)$(libdir)/$$libname.* $(DESTDIR)$(rootlibdir); \
172         fi
173 endef
174
175 install-touch-usr-hook:
176         touch -c $(DESTDIR)/$(prefix)
177
178 INSTALL_EXEC_HOOKS += \
179         install-touch-usr-hook
180
181
182 # ------------------------------------------------------------------------------
183 AM_V_M4 = $(AM_V_M4_$(V))
184 AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
185 AM_V_M4_0 = @echo "  M4      " $@;
186
187 AM_V_XSLT = $(AM_V_XSLT_$(V))
188 AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
189 AM_V_XSLT_0 = @echo "  XSLT    " $@;
190
191 AM_V_GPERF = $(AM_V_GPERF_$(V))
192 AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
193 AM_V_GPERF_0 = @echo "  GPERF   " $@;
194
195 AM_V_LN = $(AM_V_LN_$(V))
196 AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
197 AM_V_LN_0 = @echo "  LN      " $@;
198
199 AM_V_RM = $(AM_V_RM_$(V))
200 AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
201 AM_V_RM_0 = @echo "  RM      " $@;
202
203 # ------------------------------------------------------------------------------
204 rootbin_PROGRAMS =
205 pkglibexec_PROGRAMS =
206
207 dist_doc_DATA = \
208         README \
209         NEWS \
210         LICENSE.LGPL2.1 \
211         LICENSE.GPL2
212
213 @INTLTOOL_POLICY_RULE@
214
215 # ------------------------------------------------------------------------------
216
217 MANPAGES =
218 MANPAGES_ALIAS =
219
220 include Makefile-man.am
221
222 .PHONY: man update-man-list
223 man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
224
225 XML_FILES = \
226         ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
227 HTML_FILES = \
228         ${XML_FILES:.xml=.html}
229 HTML_ALIAS = \
230         ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
231
232 if ENABLE_MANPAGES
233 man_MANS = \
234         $(MANPAGES) \
235         $(MANPAGES_ALIAS)
236
237 noinst_DATA += \
238         $(HTML_FILES) \
239         $(HTML_ALIAS) \
240         docs/html/man
241 endif
242
243 CLEANFILES += \
244         $(man_MANS) \
245         $(HTML_FILES) \
246         $(HTML_ALIAS) \
247         docs/html/man
248
249 docs/html/man:
250         $(AM_V_at)$(MKDIR_P) $(dir $@)
251         $(AM_V_LN)$(LN_S) -f ../../man $@
252
253 man/index.html: man/elogind.index.html
254         $(AM_V_LN)$(LN_S) -f elogind.index.html $@
255
256 if HAVE_PYTHON
257 noinst_DATA += \
258        man/index.html
259 endif
260
261 CLEANFILES += \
262        man/index.html
263
264 XML_GLOB            := $(wildcard $(top_srcdir)/man/*.xml)
265 DIRECTIVE_FILE      := man/elogind.directives.xml
266 INDEX_XML_FILE      := man/elogind.index.xml
267 NON_INDEX_XML_FILES := $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_FILES))
268 ALL_XML_FILES       := $(INDEX_XML_FILE) $(DIRECTIVE_FILE) $(filter-out $(INDEX_XML_FILE) $(DIRECTIVE_FILE),$(XML_GLOB))
269 SOURCE_XML_FILES    := ${patsubst %,$(top_srcdir)/%,$(filter-out $(DIRECTIVE_FILE),$(NON_INDEX_XML_FILES))}
270
271 # This target should only be run manually. It recreates Makefile-man.am
272 # file in the source directory based on all man/*.xml files. Run it after
273 # adding, removing, or changing the conditional in a man page.
274 update-man-list: $(top_srcdir)/tools/make-man-rules.py $(ALL_XML_FILES) man/custom-entities.ent
275         $(AM_V_GEN)$(PYTHON) $< $(ALL_XML_FILES) > $(top_srcdir)/Makefile-man.tmp
276         $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
277         @echo "Makefile-man.am has been regenerated"
278
279 $(INDEX_XML_FILE): $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
280         $(AM_V_at)$(MKDIR_P) $(dir $@)
281         $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
282
283 $(DIRECTIVE_FILE): $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
284         $(AM_V_at)$(MKDIR_P) $(dir $@)
285         $(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
286
287 CLEANFILES += \
288        $(INDEX_XML_FILE) \
289        $(DIRECTIVE_FILE)
290
291 EXTRA_DIST += \
292         $(filter-out $(DIRECTIVE_FILE) $(INDEX_XML_FILE),$(XML_FILES)) \
293         tools/make-man-index.py \
294         tools/make-man-rules.py \
295         tools/make-directive-index.py \
296         tools/xml_helper.py \
297         man/glib-event-glue.c
298
299 # ------------------------------------------------------------------------------
300 noinst_LTLIBRARIES += \
301         libbasic.la
302
303 libbasic_la_SOURCES = \
304         src/basic/missing.h \
305         src/basic/capability-util.c \
306         src/basic/capability-util.h \
307         src/basic/conf-files.c \
308         src/basic/conf-files.h \
309         src/basic/stdio-util.h \
310         src/basic/hostname-util.h \
311         src/basic/hostname-util.c \
312         src/basic/unit-name.c \
313         src/basic/unit-name.h \
314         src/basic/unaligned.h \
315         src/basic/util.c \
316         src/basic/util.h \
317         src/basic/io-util.c \
318         src/basic/io-util.h \
319         src/basic/string-util.c \
320         src/basic/string-util.h \
321         src/basic/parse-util.c \
322         src/basic/parse-util.h \
323         src/basic/fd-util.c \
324         src/basic/fd-util.h \
325         src/basic/user-util.c \
326         src/basic/user-util.h \
327         src/basic/dirent-util.c \
328         src/basic/dirent-util.h \
329         src/basic/xattr-util.c \
330         src/basic/xattr-util.h \
331         src/basic/proc-cmdline.c \
332         src/basic/proc-cmdline.h \
333         src/basic/fs-util.c \
334         src/basic/fs-util.h \
335         src/basic/syslog-util.c \
336         src/basic/syslog-util.h \
337         src/basic/stat-util.c \
338         src/basic/stat-util.h \
339         src/basic/mount-util.c \
340         src/basic/mount-util.h \
341         src/basic/hexdecoct.c \
342         src/basic/hexdecoct.h \
343         src/basic/extract-word.c \
344         src/basic/extract-word.h \
345         src/basic/escape.c \
346         src/basic/escape.h \
347         src/basic/path-util.c \
348         src/basic/path-util.h \
349         src/basic/parse-printf-format.c \
350         src/basic/parse-printf-format.h \
351         src/basic/time-util.c \
352         src/basic/time-util.h \
353         src/basic/locale-util.c \
354         src/basic/locale-util.h \
355         src/basic/umask-util.h \
356         src/basic/signal-util.c \
357         src/basic/signal-util.h \
358         src/basic/string-table.c \
359         src/basic/string-table.h \
360         src/basic/mempool.c \
361         src/basic/mempool.h \
362         src/basic/hashmap.c \
363         src/basic/hashmap.h \
364         src/basic/hash-funcs.c \
365         src/basic/hash-funcs.h \
366         src/basic/siphash24.c \
367         src/basic/siphash24.h \
368         src/basic/prioq.c \
369         src/basic/prioq.h \
370         src/basic/strv.c \
371         src/basic/strv.h \
372         src/basic/log.c \
373         src/basic/log.h \
374         src/basic/bus-label.c \
375         src/basic/bus-label.h \
376         src/basic/virt.c \
377         src/basic/virt.h \
378         src/basic/smack-util.c \
379         src/basic/smack-util.h \
380         src/basic/utf8.c \
381         src/basic/utf8.h \
382         src/basic/gunicode.c \
383         src/basic/gunicode.h \
384         src/basic/socket-util.c \
385         src/basic/socket-util.h \
386         src/basic/fileio.c \
387         src/basic/fileio.h \
388         src/basic/mkdir.c \
389         src/basic/mkdir.h \
390         src/basic/cgroup-util.c \
391         src/basic/cgroup-util.h \
392         src/basic/errno-list.c \
393         src/basic/errno-list.h \
394         src/basic/terminal-util.c \
395         src/basic/terminal-util.h \
396         src/basic/login-util.h \
397         src/basic/login-util.c \
398         src/basic/audit-util.c \
399         src/basic/audit-util.h \
400         src/basic/memfd-util.c \
401         src/basic/memfd-util.h \
402         src/basic/process-util.c \
403         src/basic/process-util.h \
404         src/basic/random-util.c \
405         src/basic/random-util.h \
406         src/basic/verbs.c \
407         src/basic/verbs.h \
408         src/basic/label.c \
409         src/basic/label.h \
410         src/basic/selinux-util.c \
411         src/basic/selinux-util.h \
412         src/basic/mkdir-label.c \
413         src/basic/fileio-label.c \
414         src/basic/fileio-label.h \
415         src/basic/rm-rf.c \
416         src/basic/rm-rf.h \
417         src/basic/copy.c \
418         src/basic/copy.h \
419         src/basic/alloc-util.h \
420         src/basic/alloc-util.c
421
422 nodist_libbasic_la_SOURCES = \
423         src/basic/errno-from-name.h \
424         src/basic/errno-to-name.h
425
426 libbasic_la_CFLAGS = \
427         $(AM_CFLAGS) \
428         $(SELINUX_CFLAGS) \
429         $(CAP_CFLAGS) \
430         -pthread
431
432 libbasic_la_LDFLAGS = \
433         $(CAP_LDFLAGS)
434
435 libbasic_la_LIBADD = \
436         $(SELINUX_LIBS) \
437         $(CAP_LIBS) \
438         -ldl \
439         -lm
440
441 # -----------------------------------------------------------------------------
442 noinst_LTLIBRARIES += \
443         libshared.la
444
445 libshared_la_SOURCES = \
446         src/shared/bus-util.c \
447         src/shared/bus-util.h \
448         src/shared/clean-ipc.c \
449         src/shared/clean-ipc.h \
450         src/shared/conf-parser.c \
451         src/shared/conf-parser.h \
452         src/shared/musl_missing.h \
453         src/shared/musl_missing.c \
454         src/shared/pager.c \
455         src/shared/pager.h \
456         src/shared/sleep-config.c \
457         src/shared/sleep-config.h \
458         src/shared/spawn-polkit-agent.c \
459         src/shared/spawn-polkit-agent.h
460
461 if HAVE_ACL
462 libshared_la_SOURCES += \
463         src/shared/acl-util.c \
464         src/shared/acl-util.h
465 endif
466
467 libshared_la_CFLAGS = \
468         $(AM_CFLAGS) \
469         $(ACL_CFLAGS)
470
471 libshared_la_LIBADD = \
472         libelogind-internal.la \
473         libbasic.la \
474         $(UDEV_LIBS) \
475         $(ACL_LIBS)
476
477 noinst_LTLIBRARIES += \
478         libelogind-shared.la
479
480 libelogind_shared_la_SOURCES = \
481         $(libbasic_la_SOURCES) \
482         $(libshared_la_SOURCES) \
483         $(libelogind_internal_la_SOURCES)
484
485 libelogind_shared_la_CFLAGS = \
486         $(AM_CFLAGS) \
487         $(libbasic_la_CFLAGS) \
488         $(libshared_la_CFLAGS) \
489         $(libelogind_internal_la_CFLAGS) \
490         $(libelogind_journal_internal_la_CFLAGS) \
491         $(libudev_internal_la_CFLAGS) \
492         $(ACL_CFLAGS) \
493         $(LIBIDN_CFLAGS) \
494         $(SECCOMP_CFLAGS) \
495         -fvisibility=default
496
497 # We can't use libshared_la_LIBADD here because it would
498 # pull in libelogind*-internal.la
499 libelogind_shared_la_LIBADD = \
500         $(libbasic_la_LIBADD) \
501         $(libelogind_internal_la_LIBADD) \
502         $(UDEV_LIBS) \
503         $(ACL_LIBS) \
504         $(LIBIDN_LIBS) \
505         $(SECCOMP_LIBS)
506
507 libelogind_shared_la_LDFLAGS = \
508         $(AM_LDFLAGS) \
509         -release $(PACKAGE_VERSION)
510
511  # -----------------------------------------------------------------------------
512 gperf_txt_sources = \
513         src/basic/errno-list.txt
514
515 BUILT_SOURCES += \
516         $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
517         $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
518         $(gperf_txt_sources:-list.txt=-from-name.h) \
519         $(gperf_txt_sources:-list.txt=-to-name.h)
520
521 CLEANFILES += \
522         $(gperf_txt_sources:-list.txt=-from-name.gperf)
523 DISTCLEANFILES = \
524         $(gperf_txt_sources)
525
526 EXTRA_DIST += \
527         $(gperf_gperf_m4_sources) \
528         $(gperf_gperf_sources)
529
530 CLEANFILES += \
531         $(gperf_txt_sources)
532
533 %-from-name.gperf: %-list.txt
534         $(AM_V_at)$(MKDIR_P) $(dir $@)
535         $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
536
537 %-from-name.h: %-from-name.gperf
538         $(AM_V_at)$(MKDIR_P) $(dir $@)
539         $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
540
541
542 src/basic/errno-list.txt:
543         $(AM_V_at)$(MKDIR_P) $(dir $@)
544         $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
545
546 src/basic/errno-to-name.h: src/basic/errno-list.txt
547         $(AM_V_at)$(MKDIR_P) $(dir $@)
548         $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
549
550
551 # ------------------------------------------------------------------------------
552
553 if HAVE_PAM
554 dist_factory_pam_DATA = \
555         factory/etc/pam.d/system-auth \
556         factory/etc/pam.d/other
557 endif
558
559 # ------------------------------------------------------------------------------
560 pkglibexec_PROGRAMS += \
561        elogind-cgroups-agent
562
563 elogind_cgroups_agent_SOURCES = \
564        src/cgroups-agent/cgroups-agent.c
565
566 elogind_cgroups_agent_LDADD = \
567        libelogind-shared.la
568
569 # ------------------------------------------------------------------------------
570 libelogind_internal_la_SOURCES = \
571         src/systemd/sd-bus.h \
572         src/systemd/sd-bus-protocol.h \
573         src/systemd/sd-bus-vtable.h \
574         src/systemd/sd-event.h \
575         src/systemd/sd-login.h \
576         src/systemd/sd-id128.h \
577         src/systemd/sd-daemon.h \
578         src/libelogind/libelogind.sym \
579         src/libelogind/sd-bus/sd-bus.c \
580         src/libelogind/sd-bus/bus-control.c \
581         src/libelogind/sd-bus/bus-control.h \
582         src/libelogind/sd-bus/bus-error.c \
583         src/libelogind/sd-bus/bus-error.h \
584         src/libelogind/sd-bus/bus-common-errors.h \
585         src/libelogind/sd-bus/bus-common-errors.c \
586         src/libelogind/sd-bus/bus-internal.c \
587         src/libelogind/sd-bus/bus-internal.h \
588         src/libelogind/sd-bus/bus-socket.c \
589         src/libelogind/sd-bus/bus-socket.h \
590         src/libelogind/sd-bus/bus-kernel.c \
591         src/libelogind/sd-bus/bus-kernel.h \
592         src/libelogind/sd-bus/bus-container.c \
593         src/libelogind/sd-bus/bus-container.h \
594         src/libelogind/sd-bus/bus-message.c \
595         src/libelogind/sd-bus/bus-message.h \
596         src/libelogind/sd-bus/bus-creds.c \
597         src/libelogind/sd-bus/bus-creds.h \
598         src/libelogind/sd-bus/bus-signature.c \
599         src/libelogind/sd-bus/bus-signature.h \
600         src/libelogind/sd-bus/bus-type.c \
601         src/libelogind/sd-bus/bus-type.h \
602         src/libelogind/sd-bus/bus-match.c \
603         src/libelogind/sd-bus/bus-match.h \
604         src/libelogind/sd-bus/bus-bloom.c \
605         src/libelogind/sd-bus/bus-bloom.h \
606         src/libelogind/sd-bus/bus-introspect.c \
607         src/libelogind/sd-bus/bus-introspect.h \
608         src/libelogind/sd-bus/bus-objects.c \
609         src/libelogind/sd-bus/bus-objects.h \
610         src/libelogind/sd-bus/bus-gvariant.c \
611         src/libelogind/sd-bus/bus-gvariant.h \
612         src/libelogind/sd-bus/bus-convenience.c \
613         src/libelogind/sd-bus/bus-track.c \
614         src/libelogind/sd-bus/bus-track.h \
615         src/libelogind/sd-bus/bus-slot.c \
616         src/libelogind/sd-bus/bus-slot.h \
617         src/libelogind/sd-bus/bus-protocol.h \
618         src/libelogind/sd-event/sd-event.c \
619         src/libelogind/sd-id128/sd-id128.c \
620         src/libelogind/sd-id128/id128-util.h \
621         src/libelogind/sd-id128/id128-util.c \
622         src/libelogind/sd-daemon/sd-daemon.c \
623         src/libelogind/sd-login/sd-login.c
624
625 noinst_LTLIBRARIES += \
626         libelogind-internal.la
627
628 EXTRA_DIST += \
629         src/libelogind/libelogind.pc.in \
630         src/libelogind/sd-bus/DIFFERENCES \
631         src/libelogind/sd-bus/GVARIANT-SERIALIZATION
632
633 libelogind_la_SOURCES =
634
635 libelogind_la_LDFLAGS = \
636         $(AM_LDFLAGS) \
637         -version-info $(LIBELOGIND_CURRENT):$(LIBELOGIND_REVISION):$(LIBELOGIND_AGE) \
638         -Wl,--version-script=$(top_srcdir)/src/libelogind/libelogind.sym
639
640 libelogind_la_LIBADD = \
641         libelogind-internal.la \
642         libbasic.la
643
644 libelogind-install-hook:
645         libname=libelogind.so && $(move-to-rootlibdir)
646
647 libelogind-uninstall-hook:
648         rm -f $(DESTDIR)$(rootlibdir)/libelogind.so*
649
650 INSTALL_EXEC_HOOKS += libelogind-install-hook
651 UNINSTALL_EXEC_HOOKS += libelogind-uninstall-hook
652
653 pkgconfiglib_DATA += \
654         src/libelogind/libelogind.pc
655
656 pkginclude_HEADERS += \
657         src/systemd/sd-login.h \
658         src/systemd/sd-messages.h \
659         src/systemd/sd-id128.h \
660         src/systemd/_sd-common.h
661
662 header-install-hook:
663         $(MKDIR_P) $(DESTDIR)/$(pkgincludedir)
664         cd $(DESTDIR)/$(includedir)/elogind && \
665                 for hdr in $(notdir $(pkginclude_HEADERS)) ; do \
666                         rm -f $$hdr ; \
667                         $(LN_S) systemd/$$hdr $$hdr ; \
668                 done
669
670 header-uninstall-hook:
671         m -f $(DESTDIR)/$(includedir)/elogind/*.h
672
673 INSTALL_EXEC_HOOKS += header-install-hook
674 UNINSTALL_EXEC_HOOKS += header-uninstall-hook
675
676 lib_LTLIBRARIES += \
677         libelogind.la
678
679 # ------------------------------------------------------------------------------
680 elogind_SOURCES = \
681         src/login/logind.c \
682         src/login/logind.h
683
684 nodist_elogind_SOURCES = \
685         src/login/logind-gperf.c
686
687 elogind_LDADD = \
688         libelogind-core.la
689
690 libelogind_core_la_SOURCES = \
691         src/core/cgroup.h \
692         src/core/cgroup.c \
693         src/core/mount-setup.h \
694         src/core/mount-setup.c \
695         src/login/elogind.c \
696         src/login/elogind.h \
697         src/login/elogind-action.c \
698         src/login/elogind-action.h \
699         src/login/elogind-dbus.c \
700         src/login/elogind-dbus.h \
701         src/login/logind-core.c \
702         src/login/logind-device.c \
703         src/login/logind-device.h \
704         src/login/logind-button.c \
705         src/login/logind-button.h \
706         src/login/logind-action.c \
707         src/login/logind-action.h \
708         src/login/logind-seat.c \
709         src/login/logind-seat.h \
710         src/login/logind-session.c \
711         src/login/logind-session.h \
712         src/login/logind-session-device.c \
713         src/login/logind-session-device.h \
714         src/login/logind-user.c \
715         src/login/logind-user.h \
716         src/login/logind-inhibit.c \
717         src/login/logind-inhibit.h \
718         src/login/logind-dbus.c \
719         src/login/logind-session-dbus.c \
720         src/login/logind-seat-dbus.c \
721         src/login/logind-user-dbus.c \
722         src/login/logind-utmp.c \
723         src/login/logind-acl.h \
724         src/sleep/sleep.c \
725         src/sleep/sleep.h
726
727 if HAVE_UTMP
728 libelogind_core_la_SOURCES += \
729         src/shared/utmp-wtmp.c \
730         src/update-utmp/update-utmp.c
731 endif
732
733 libelogind_core_la_LIBADD = \
734         libelogind-shared.la
735
736 if HAVE_ACL
737 libelogind_core_la_SOURCES += \
738         src/login/logind-acl.c
739 endif
740
741 noinst_LTLIBRARIES += \
742         libelogind-core.la
743
744 pkglibexec_PROGRAMS += \
745         elogind
746
747 loginctl_SOURCES = \
748         src/login/eloginctl.c \
749         src/login/eloginctl.h \
750         src/login/loginctl.c \
751         src/login/sysfs-show.h \
752         src/login/sysfs-show.c
753
754 loginctl_LDADD = \
755         libelogind-shared.la
756
757 rootbin_PROGRAMS += \
758         loginctl
759
760 dist_bashcompletion_data = \
761         shell-completion/bash/loginctl
762
763 dist_zshcompletion_data = \
764         shell-completion/zsh/_loginctl \
765         shell-completion/zsh/_elogind-inhibit
766
767 elogind_inhibit_SOURCES = \
768         src/login/inhibit.c
769
770 elogind_inhibit_LDADD = \
771         libelogind-shared.la
772
773 rootbin_PROGRAMS += \
774         elogind-inhibit
775
776 test_login_SOURCES = \
777         src/libelogind/sd-login/test-login.c
778
779 test_login_LDADD = \
780         libelogind-shared.la
781
782 test_login_shared_SOURCES = \
783         src/login/test-login-shared.c
784
785 test_login_shared_LDADD = \
786         libelogind-shared.la
787
788 test_inhibit_SOURCES = \
789         src/login/test-inhibit.c
790
791 test_inhibit_LDADD = \
792         libelogind-shared.la
793
794 test_login_tables_SOURCES = \
795         src/login/test-login-tables.c
796
797 test_login_tables_LDADD = \
798         libelogind-core.la
799
800 manual_tests += \
801         test-login \
802         test-inhibit
803
804 tests += \
805         test-login-tables \
806         test-login-shared
807
808 if HAVE_PAM
809 pam_elogind_la_SOURCES = \
810         src/login/pam_elogind.sym \
811         src/login/pam_elogind.c
812
813 pam_elogind_la_CFLAGS = \
814         $(AM_CFLAGS) \
815         $(PAM_CFLAGS)
816
817 pam_elogind_la_LDFLAGS = \
818         $(AM_LDFLAGS) \
819         -module \
820         -export-dynamic \
821         -avoid-version \
822         -shared \
823         -Wl,--version-script=$(top_srcdir)/src/login/pam_elogind.sym
824
825 pam_elogind_la_LIBADD = \
826         libshared.la \
827         $(PAM_LIBS)
828
829 pamlib_LTLIBRARIES = \
830         pam_elogind.la
831
832 dist_pamconf_DATA = \
833         src/login/elogind-user
834
835 EXTRA_DIST += \
836         src/login/elogind-user.m4
837 endif
838
839 dist_dbussystemservice_DATA += \
840         src/login/org.freedesktop.login1.service
841
842 dist_dbuspolicy_DATA += \
843         src/login/org.freedesktop.login1.conf
844
845 nodist_pkgsysconf_DATA += \
846         src/login/logind.conf
847
848 polkitpolicy_files += \
849         src/login/org.freedesktop.login1.policy
850
851 dist_udevrules_DATA += \
852         src/login/70-uaccess.rules \
853         src/login/70-power-switch.rules
854
855 nodist_udevrules_DATA += \
856         src/login/71-seat.rules \
857         src/login/73-seat-late.rules
858
859 polkitpolicy_in_files += \
860         src/login/org.freedesktop.login1.policy.in
861
862 gperf_gperf_sources = \
863         src/login/logind-gperf.gperf
864
865 EXTRA_DIST += \
866         src/login/71-seat.rules.in \
867         src/login/73-seat-late.rules.in \
868         src/login/logind.conf.in
869
870 # ------------------------------------------------------------------------------
871 substitutions = \
872        '|rootlibexecdir=$(rootlibexecdir)|' \
873        '|rootbindir=$(rootbindir)|' \
874        '|bindir=$(bindir)|' \
875        '|pkgsysconfdir=$(pkgsysconfdir)|' \
876        '|pkgdatadir=$(pkgdatadir)|' \
877        '|udevrulesdir=$(udevrulesdir)|' \
878        '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
879        '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
880        '|PACKAGE_URL=$(PACKAGE_URL)|' \
881        '|prefix=$(prefix)|' \
882        '|exec_prefix=$(exec_prefix)|' \
883        '|libdir=$(libdir)|' \
884        '|includedir=$(includedir)|' \
885        '|VERSION=$(VERSION)|' \
886        '|rootprefix=$(rootprefix)|' \
887        '|udevlibexecdir=$(udevlibexecdir)|' \
888        '|KILL=$(KILL)|' \
889        '|MKDIR_P=$(MKDIR_P)|' \
890        '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
891        '|systemuidmax=$(SYSTEM_UID_MAX)|' \
892        '|systemgidmax=$(SYSTEM_GID_MAX)|' \
893        '|TTY_GID=$(TTY_GID)|'
894
895 SED_PROCESS = \
896         $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
897         $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
898                 < $< > $@
899
900 man/%: man/%.in
901         $(SED_PROCESS)
902
903 sysctl.d/%: sysctl.d/%.in
904         $(SED_PROCESS)
905
906 %.pc: %.pc.in
907         $(SED_PROCESS)
908
909 shell-completion/%: shell-completion/%.in
910         $(SED_PROCESS)
911
912 %.rules: %.rules.in
913         $(SED_PROCESS)
914
915 %.conf: %.conf.in
916         $(SED_PROCESS)
917
918 %.sh: %.sh.in
919         $(SED_PROCESS)
920         $(AM_V_GEN)chmod +x $@
921
922 src/%.c: src/%.gperf
923         $(AM_V_at)$(MKDIR_P) $(dir $@)
924         $(AM_V_GPERF)$(GPERF) < $< > $@
925
926 src/%: src/%.m4
927         $(AM_V_at)$(MKDIR_P) $(dir $@)
928         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
929
930 sysusers.d/%: sysusers.d/%.m4
931         $(AM_V_at)$(MKDIR_P) $(dir $@)
932         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
933
934 tmpfiles.d/%: tmpfiles.d/%.m4
935         $(AM_V_at)$(MKDIR_P) $(dir $@)
936         $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
937
938
939 units/%: units/%.m4
940         $(AM_V_at)$(MKDIR_P) $(dir $@)
941         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
942
943 units/user/%: units/user/%.m4
944         $(AM_V_at)$(MKDIR_P) $(dir $@)
945         $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
946
947 if ENABLE_POLKIT
948 nodist_polkitpolicy_DATA = \
949         $(polkitpolicy_files)
950 endif
951
952 EXTRA_DIST += \
953         $(polkitpolicy_in_files)
954
955 # ------------------------------------------------------------------------------
956 if ENABLE_MANPAGES
957 man/custom-entities.ent: configure.ac
958         $(AM_V_GEN)$(MKDIR_P) $(dir $@)
959         $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
960          printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
961          > $@ # '
962
963 CLEANFILES += \
964         man/custom-entities.ent
965
966 XSLTPROC_FLAGS = \
967         --nonet \
968         --xinclude \
969         --stringparam man.output.quietly 1 \
970         --stringparam funcsynopsis.style ansi \
971         --stringparam man.authors.section.enabled 0 \
972         --stringparam man.copyright.section.enabled 0 \
973         --stringparam elogind.version $(VERSION) \
974         --path '$(builddir)/man:$(srcdir)/man'
975
976 XSLTPROC_PROCESS_MAN = \
977         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
978
979 XSLTPROC_PROCESS_HTML = \
980         $(AM_V_XSLT)$(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
981
982 man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
983         $(XSLTPROC_PROCESS_MAN)
984
985 man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
986         $(XSLTPROC_PROCESS_MAN)
987
988 man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
989         $(XSLTPROC_PROCESS_MAN)
990
991 man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
992         $(XSLTPROC_PROCESS_MAN)
993
994 man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
995         $(XSLTPROC_PROCESS_MAN)
996
997 man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
998         $(XSLTPROC_PROCESS_HTML)
999
1000 define html-alias
1001         $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
1002 endef
1003
1004 endif
1005
1006 EXTRA_DIST += \
1007         man/custom-html.xsl \
1008         man/custom-man.xsl
1009
1010 install-exec-hook: $(INSTALL_EXEC_HOOKS)
1011
1012 uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
1013
1014 install-data-hook: $(INSTALL_DATA_HOOKS)
1015
1016 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
1017
1018 clean-local: $(CLEAN_LOCAL_HOOKS)
1019         rm -rf $(abs_srcdir)/install-tree
1020         rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
1021               $(abs_srcdir)/hwdb/iab.txt
1022
1023 DISTCHECK_CONFIGURE_FLAGS = \
1024         --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
1025         --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
1026         --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
1027         --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
1028         --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
1029         --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
1030         --with-rootprefix=$$dc_install_base
1031
1032 if ENABLE_SPLIT_USR
1033 DISTCHECK_CONFIGURE_FLAGS += \
1034         --enable-split-usr
1035 else
1036 DISTCHECK_CONFIGURE_FLAGS += \
1037         --disable-split-usr
1038 endif
1039
1040 .PHONY: dist-check-help
1041 dist-check-help: $(rootbin_PROGRAMS)
1042         for i in $(abspath $^); do                                             \
1043             if $$i  --help | grep -v 'default:' | grep -E -q '.{80}.' ; then   \
1044                 echo "$(basename $$i) --help output is too wide:";             \
1045                 $$i  --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
1046                 exit 1;                                                        \
1047             fi; done
1048
1049 include_compilers = "$(CC)" "$(CC) -ansi" "$(CC) -std=iso9899:1990"
1050 public_headers = $(filter-out src/systemd/_sd-common.h, $(pkginclude_HEADERS) $(include_HEADERS))
1051 .PHONY: dist-check-includes
1052 dist-check-includes: $(public_headers)
1053         @res=0;                                                                 \
1054         for i in $(abspath $^); do                                              \
1055             for cc in $(include_compilers); do                                  \
1056                 echo "$$cc -o/dev/null -c -x c -include "$$i" - </dev/null";    \
1057                 $$cc -o/dev/null -c -x c -include "$$i" - </dev/null || res=1;  \
1058             done;                                                               \
1059         done; exit $$res
1060
1061 dist:
1062
1063 .PHONY: git-tag
1064 git-tag:
1065         git tag -s "v$(VERSION)" -m "elogind $(VERSION)"
1066
1067 .PHONY: git-tar
1068 git-tar:
1069         $(AM_V_at)git archive --format=tar --prefix=elogind-$(VERSION)-raw/ HEAD | \
1070                 (cd /var/tmp/ && tar xf -)
1071         $(AM_V_GEN)(cd /var/tmp && rm -rf elogind-$(VERSION) && $(MKDIR_P) elogind-$(VERSION) && \
1072          for f in `find elogind-$(VERSION)-raw/ -type f | cut -d '/' -f 2-` ; do \
1073                 $(MKDIR_P) elogind-$(VERSION)/`dirname $$f` ;            \
1074                 $(AWK) 'BEGIN                    { i=0;e=0      }        \
1075                         /^#if\s+0.*elogind.*$$/  { i=1;next     }        \
1076                         /^#else\s*$$/            {                       \
1077                             { if ( i==1 ) e=1; else print }{next}        \
1078                         }                                                \
1079                         /^#endif\s*\/\/\s*0\s*$$/ {                      \
1080                             { if ( i==1 ) { i=0;e=0 } else print }{next} \
1081                         }                                                \
1082                         /^\s*\/\/\/.*elogind.*$$/{ next         }        \
1083                         /^\s*\/\/\s*#include.+$$/{ next         }        \
1084                         { if ( (i==0) || (e==1) ) print         }'       \
1085                           elogind-$(VERSION)-raw/$$f                     \
1086                         > elogind-$(VERSION)/$$f ;                       \
1087                         chmod `stat -c '%a' elogind-$(VERSION)-raw/$$f`  \
1088                                             elogind-$(VERSION)/$$f ;     \
1089          done ; \
1090          for l in `find elogind-$(VERSION)-raw/ -type l | cut -d '/' -f 2-` ; do \
1091                 $(MKDIR_P) elogind-$(VERSION)/`dirname $$l` ; \
1092                 cp -P elogind-$(VERSION)-raw/$$l elogind-$(VERSION)/$$l ; \
1093          done ; \
1094          tar czf elogind-$(VERSION).tar.gz elogind-$(VERSION) ; \
1095          rm -rf elogind-$(VERSION) elogind-$(VERSION)-raw) ; \
1096         $(AM_V_at)mv /var/tmp/elogind-$(VERSION).tar.gz ./
1097
1098 .PHONY: install-tree
1099 install-tree: all
1100         rm -rf $(abs_srcdir)/install-tree
1101         $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
1102         tree $(abs_srcdir)/install-tree
1103
1104 # Let's run all tests of the test suite, but under valgrind. Let's
1105 # exclude the one perl script we have in there
1106 .PHONY: valgrind-tests
1107 valgrind-tests: $(TESTS)
1108         $(AM_V_GEN)for f in $(filter-out %.pl, $^); do \
1109                 if $(LIBTOOL) --mode=execute file $$f | grep -q shell; then \
1110                 echo -e "$${x}Skipping non-binary $$f"; else \
1111                 echo -e "$${x}Running $$f"; \
1112                 libtool --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
1113                 x="\n\n"; \
1114         done
1115
1116 exported-%: %
1117         $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
1118
1119 exported: $(addprefix exported-, $(lib_LTLIBRARIES))
1120         $(AM_V_GEN)cat $^ > $@
1121
1122 .PHONY: check-api-docs
1123 check-api-docs: exported man
1124         $(AM_V_GEN)for symbol in `cat exported` ; do \
1125                 if test -f $(builddir)/man/$$symbol.html ; then \
1126                         echo "  Symbol $$symbol() is documented." ; \
1127                 else \
1128                         echo "‣ Symbol $$symbol() lacks documentation." ; \
1129                 fi ; \
1130         done
1131
1132 OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
1133 ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
1134
1135 undefined defined: $(ALL_OBJECTS)
1136         $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
1137                 $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
1138         done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
1139
1140 CLEANFILES += \
1141         defined \
1142         undefined
1143
1144 .PHONY: check-api-unused
1145 check-api-unused: defined undefined exported
1146         ( cat exported undefined ) | sort -u  | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
1147
1148 .PHONY: check-includes
1149 check-includes: $(top_srcdir)/tools/check-includes.pl
1150         $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
1151                 | xargs $(top_srcdir)/tools/check-includes.pl
1152
1153 EXTRA_DIST += \
1154         $(top_srcdir)/tools/check-includes.pl
1155
1156 # Stupid test that everything purported to be exported really is
1157 define generate-sym-test
1158         $(AM_V_at)$(MKDIR_P) $(dir $@)
1159         $(AM_V_at)printf '#include <stdio.h>\n' > $@
1160         $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
1161         $(AM_V_at)printf 'void* functions[] = {\n' >> $@
1162         $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
1163         $(AM_V_at)printf '};\nint main(void) {\n' >> $@
1164         $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
1165         $(AM_V_at)printf 'return 0; }\n' >> $@
1166 endef
1167
1168 test-libelogind-sym.c: \
1169                 $(top_builddir)/src/libelogind/libelogind.sym \
1170                 src/systemd/sd-daemon.h \
1171                 src/systemd/sd-login.h \
1172                 src/systemd/sd-bus.h \
1173                 src/systemd/sd-event.h
1174         $(generate-sym-test)
1175
1176 test_libelogind_sym_SOURCES = \
1177         test-libelogind-sym.c
1178 test_libelogind_sym_LDADD = \
1179         libelogind.la
1180
1181 BUILT_SOURCES += \
1182         $(test_libelogind_sym_SOURCES)
1183
1184 tests += \
1185         test-libelogind-sym
1186
1187 .PHONY: cppcheck
1188 cppcheck:
1189         cppcheck --enable=all -q $(top_srcdir)
1190
1191 # Used to extract compile flags for YCM.
1192 print-%:
1193         @echo $($*)
1194
1195 git-contrib:
1196         @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | awk '{ print $$0 "," }' | sort -u
1197
1198 EXTRA_DIST += \
1199         tools/gdb-sd_dump_hashmaps.py
1200
1201 list-keys:
1202         gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
1203
1204 add-key:
1205         gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -