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