You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1657 lines
43 KiB

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