mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
makefiles: use single target
Possibly easier to follow - to have just a single dependency line and use if() within rule. Also replace $(words) with $(firstword) which is more commonly used.
This commit is contained in:
parent
fe00b163d6
commit
bf2b1986c2
22
make.tmpl.in
22
make.tmpl.in
@ -475,32 +475,30 @@ distclean: cleandir $(SUBDIRS.distclean)
|
|||||||
.exported_symbols_generated: $(EXPORTED_HEADER) .exported_symbols $(DEPS)
|
.exported_symbols_generated: $(EXPORTED_HEADER) .exported_symbols $(DEPS)
|
||||||
set -e; \
|
set -e; \
|
||||||
( cat $(srcdir)/.exported_symbols; \
|
( cat $(srcdir)/.exported_symbols; \
|
||||||
if test x$(EXPORTED_HEADER) != x; then \
|
if test -n "$(EXPORTED_HEADER)"; then \
|
||||||
$(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \
|
$(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \
|
||||||
$(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
|
$(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
|
||||||
fi \
|
fi \
|
||||||
) > $@
|
) > $@
|
||||||
|
|
||||||
EXPORTED_UC := $(shell echo $(EXPORTED_FN_PREFIX) | tr '[a-z]' '[A-Z]')
|
EXPORTED_UC := $(shell echo $(EXPORTED_FN_PREFIX) | tr '[a-z]' '[A-Z]')
|
||||||
EXPORTED_FILES := $(wildcard $(srcdir)/.exported_symbols.Base $(srcdir)/.exported_symbols.$(EXPORTED_UC)_[0-9_]*[0-9])
|
EXPORTED_SYMBOLS := $(wildcard $(srcdir)/.exported_symbols.Base $(srcdir)/.exported_symbols.$(EXPORTED_UC)_[0-9_]*[0-9])
|
||||||
|
|
||||||
ifeq (0,$(words $(EXPORTED_FILES)))
|
.export.sym: .exported_symbols_generated $(EXPORTED_SYMBOLS)
|
||||||
.export.sym: .exported_symbols_generated
|
ifeq (,$(firstword $(EXPORTED_SYMBOLS)))
|
||||||
set -e; (echo "Base {"; echo " global:"; \
|
set -e; (echo "Base {"; echo " global:";\
|
||||||
$(SED) "s/^/ /;s/$$/;/" < $<; \
|
$(SED) "s/^/ /;s/$$/;/" $<;\
|
||||||
echo " local:"; echo " *;"; echo "};") > $@
|
echo " local:"; echo " *;"; echo "};") > $@
|
||||||
|
|
||||||
else
|
else
|
||||||
.export.sym: .exported_symbols_generated $(EXPORTED_FILES)
|
set -e;\
|
||||||
set -e; \
|
|
||||||
R=$(shell sort $^ | uniq -u);\
|
R=$(shell sort $^ | uniq -u);\
|
||||||
test -z "$$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $$R"; false; } ;\
|
test -z "$$R" || { echo "Mismatch between symbols in shared library and lists in .exported_symbols.* files: $$R"; false; } ;\
|
||||||
(for i in $(EXPORTED_FILES) ; do\
|
for i in $(EXPORTED_SYMBOLS); do\
|
||||||
echo "$${i##*.} {"; echo " global:";\
|
echo "$${i##*.} {"; echo " global:";\
|
||||||
$(SED) "s/^/ /;s/$$/;/" < $$i;\
|
$(SED) "s/^/ /;s/$$/;/" $$i;\
|
||||||
test "$$i" = Base && { echo " local:"; echo " *;"; };\
|
test "$$i" = Base && { echo " local:"; echo " *;"; };\
|
||||||
echo "};";\
|
echo "};";\
|
||||||
done ) > $@
|
done > $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (,$(findstring $(MAKECMDGOALS),cscope.out cflow clean distclean lcov \
|
ifeq (,$(findstring $(MAKECMDGOALS),cscope.out cflow clean distclean lcov \
|
||||||
|
Loading…
Reference in New Issue
Block a user