chiark / gitweb /
build-sys: add make check-api-unused
[elogind.git] / Makefile.am
index 5c3cbc18761d8b4682be6e226efa4ba119e5bbd0..a67f18b77a5eeb574bcb5dd9633ff0076f0d703d 100644 (file)
@@ -1783,14 +1783,10 @@ systemd_cgroups_agent_LDADD = \
 systemctl_SOURCES = \
        src/systemctl/systemctl.c
 
-systemctl_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 systemctl_LDADD = \
        libsystemd-units.la \
        libsystemd-label.la \
-       libsystemd-dbus.la \
+       libsystemd-bus-internal.la \
        libsystemd-logs.la \
        libsystemd-login-internal.la \
        libsystemd-journal-internal.la \
@@ -2024,7 +2020,7 @@ tests += \
        test-bus-objects \
        test-event
 
-noinst_PROGRAMS += \
+bin_PROGRAMS += \
        busctl
 
 test_bus_marshal_SOURCES = \
@@ -3847,14 +3843,12 @@ loginctl_SOURCES = \
        src/login/loginctl.c \
        src/login/sysfs-show.c
 
-loginctl_CFLAGS = \
-       $(AM_CFLAGS) \
-       $(DBUS_CFLAGS)
-
 loginctl_LDADD = \
-       libsystemd-dbus.la \
+       libsystemd-bus-internal.la \
        libudev-internal.la \
-       libsystemd-shared.la
+       libsystemd-shared.la \
+       libsystemd-id128-internal.la \
+       libsystemd-daemon-internal.la
 
 rootbin_PROGRAMS += \
        loginctl
@@ -4572,4 +4566,35 @@ install-tree: all
 # Let's run all tests of the test suite, but under valgrind. Let's
 # exclude the one perl script we have in there
 valgrind-tests: $(TESTS)
-       for f in $(TESTS) ; do [ "$$f" == "$${f/.pl/}" ] && libtool --mode=execute valgrind --leak-check=full --error-exitcode=55 $(builddir)/$$f ; done
+       for f in $(TESTS) ; do \
+               [ "$$f" == "$${f/.pl/}" ] && libtool --mode=execute valgrind --leak-check=full --error-exitcode=55 $(builddir)/$$f ; \
+       done
+
+check-api-docs: $(lib_LTLIBRARIES) man
+       for symbol in `for f in $(lib_LTLIBRARIES) ; do nm -g --defined-only $(builddir)/.libs/"$${f/.la/.so}" 2>&1 /dev/null | grep " T " | cut -d" " -f3 ; done` ; do \
+               if test -f $(builddir)/man/$$symbol.html ; then \
+                       echo "  Symbol $$symbol() is documented." ; \
+               else \
+                       echo "‣ Symbol $$symbol() lacks documentation." ; \
+               fi ; \
+        done
+
+OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
+ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
+
+defined: $(ALL_OBJECTS)
+       $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
+               nm -g --undefined-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
+       done | cut -c 20- | cut -d @ -f 1 | sort -u > $(builddir)/undefined
+
+undefined:
+       $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
+               nm -g --defined-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
+       done | cut -c 20- | cut -d @ -f 1 | sort -u > $(builddir)/defined
+
+CLEANFILES += \
+       defined \
+       undefined
+
+check-api-unused: defined undefined
+       diff -u undefined defined | grep ^+ | grep -v ^+++ | cut -c2-