mirror of
https://github.com/systemd/systemd.git
synced 2024-12-17 22:23:39 +08:00
build-sys: add make check-api-unused
This commit is contained in:
parent
862e8bf8c6
commit
9070a9c103
20
Makefile.am
20
Makefile.am
@ -4578,3 +4578,23 @@ check-api-docs: $(lib_LTLIBRARIES) man
|
||||
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-
|
||||
|
Loading…
Reference in New Issue
Block a user