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