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