automatically link all .cxx files in clang/ into the plugin
This means that just moving sources to the dir will enable the plugin action in that source, without modifying any sources, so those changes would not be accidentally committed when using a rewriter to change LO sources. Change-Id: Ic5a9c52dbf1939a1e78ad39ed6691ce3a1f399df
This commit is contained in:
@@ -8,18 +8,6 @@
|
||||
|
||||
# Make sure variables in this Makefile do not conflict with other variables (e.g. from gbuild).
|
||||
|
||||
# The list of source files.
|
||||
CLANGSRC= \
|
||||
plugin.cxx \
|
||||
pluginhandler.cxx \
|
||||
bodynotinblock.cxx \
|
||||
lclstaticfix.cxx \
|
||||
postfixincrementfix.cxx \
|
||||
removeforwardstringdecl.cxx \
|
||||
sallogareas.cxx \
|
||||
unusedvariablecheck.cxx \
|
||||
|
||||
|
||||
# You may occassionally want to override some of these
|
||||
|
||||
# Compile flags ('make CLANGCXXFLAGS=-g' if you need to debug the plugin)
|
||||
@@ -41,6 +29,24 @@ CLANGINDIR=$(SRCDIR)/compilerplugins/clang
|
||||
# plugin will cause cache misses with ccache.
|
||||
CLANGOUTDIR=$(BUILDDIR)/compilerplugins/obj
|
||||
|
||||
# The list of source files, generated automatically (all files in clang/, but not subdirs).
|
||||
CLANGSRC=$(foreach src,$(wildcard $(CLANGINDIR)/*.cxx), $(notdir $(src)))
|
||||
# Remember the sources and if they have changed, force plugin relinking.
|
||||
CLANGSRCCHANGED= \
|
||||
$(shell echo $(CLANGSRC) | sort > $(CLANGOUTDIR)/sources-new.txt; \
|
||||
if diff $(CLANGOUTDIR)/sources.txt $(CLANGOUTDIR)/sources-new.txt >/dev/null 2>/dev/null; then \
|
||||
echo 0; \
|
||||
else \
|
||||
mv $(CLANGOUTDIR)/sources-new.txt $(CLANGOUTDIR)/sources.txt; \
|
||||
echo 1; \
|
||||
fi; \
|
||||
)
|
||||
ifeq ($(CLANGSRCCHANGED),1)
|
||||
.PHONY: CLANGFORCE
|
||||
CLANGFORCE:
|
||||
$(CLANGOUTDIR)/plugin.so: CLANGFORCE
|
||||
endif
|
||||
|
||||
compilerplugins: $(CLANGOUTDIR) $(CLANGOUTDIR)/plugin.so
|
||||
|
||||
compilerplugins-clean:
|
||||
|
Reference in New Issue
Block a user