summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-02-02 18:26:03 +0100
committerLuboš Luňák <l.lunak@suse.cz>2013-02-02 22:59:44 +0100
commitc6ffe17631cccf11fbe00479d2169116d494a7da (patch)
treec36fa76d67bc409630957a0b8af679e54a0c34a9 /compilerplugins
parenta7c3adb773e5b69601716bda181cc481090a4d59 (diff)
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
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/Makefile-clang.mk30
1 files changed, 18 insertions, 12 deletions
diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk
index ea5d961ff1d5..619e11d57b2b 100644
--- a/compilerplugins/Makefile-clang.mk
+++ b/compilerplugins/Makefile-clang.mk
@@ -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: