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