summarylogtreecommitdiffstats
path: root/0001-Change-Makefile-to-enable-ccache-to-work.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-Change-Makefile-to-enable-ccache-to-work.patch')
-rw-r--r--0001-Change-Makefile-to-enable-ccache-to-work.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/0001-Change-Makefile-to-enable-ccache-to-work.patch b/0001-Change-Makefile-to-enable-ccache-to-work.patch
new file mode 100644
index 000000000000..54dce7897f01
--- /dev/null
+++ b/0001-Change-Makefile-to-enable-ccache-to-work.patch
@@ -0,0 +1,46 @@
+From 67e2fb107fac7370d1efc27dd4b4bbe1ffebca2e Mon Sep 17 00:00:00 2001
+From: Yaohan Chen <yaohan.chen@gmail.com>
+Date: Wed, 12 Aug 2015 19:00:22 -0400
+Subject: [PATCH 1/2] Change Makefile to enable ccache to work
+
+Replace the -MM flag not supported by ccache with -MMD which is
+supported. This also enables simplification of the compilation
+command line.
+
+See
+http://stackoverflow.com/questions/29703938/ccache-doesnt-work-with-gcc-m-flag
+http://www.microhowto.info/howto/automatically_generate_makefile_dependencies.html
+---
+ Makefile | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 04803c8..18ff74f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -137,16 +137,11 @@ INCLUDES := $(addprefix -I,$(SRC_DIR))
+
+ vpath %.cpp $(SRC_DIR)
+
++CPPFLAGS += -MMD -MP
+ define cc-command
+ $1/%.o: %.cpp
+ @echo "Building:" $$<
+ @$(CCACHE) $(CXX) $(BASE_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) $(INCLUDES) -c -o $$@ $$<
+- @$(CXX) $(BASE_CXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(INC) $(INCLUDES) -MM $$< > $$@.d
+- @mv -f $$@.d $$@.d.tmp
+- @sed -e 's|.*:|$$@:|' < $$@.d.tmp > $$@.d
+- @sed -e 's/.*://' -e 's/\\$$$$//' < $$@.d.tmp | fmt -1 | \
+- sed -e 's/^ *//' -e 's/$$$$/:/' >> $$@.d
+- @rm -f $$@.d.tmp
+ endef
+
+ .PHONY: all checkdirs clean
+@@ -180,4 +175,3 @@ $(foreach bdir,$(BUILD_DIR),$(eval $(call cc-command,$(bdir))))
+
+ # pull in dependency info for *existing* .o files
+ -include $(OBJ:.o=.o.d)
+-
+--
+2.5.0
+