Module: check_mk
Branch: master
Commit: ce9ddfd792a6fb1fe9559409bf57b7ee78895e00
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ce9ddfd792a6fb…
Author: Alex Zurhake <az(a)mathias-kettner.de>
Date: Fri Oct 26 14:55:42 2018 +0200
CMK-1134: rework re2 Makefile -> enable incremental builds
Change-Id: If4dfa7401b88c2f7f8bbe8a92ff70f3d9faf1dd2
---
omd/packages/re2/Makefile | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/omd/packages/re2/Makefile b/omd/packages/re2/Makefile
index c8401a8..bdd585a 100644
--- a/omd/packages/re2/Makefile
+++ b/omd/packages/re2/Makefile
@@ -3,13 +3,24 @@ include ../../Makefile.omd
# We use a released version from
https://github.com/google/re2/, but in
# principle we could use any tag by exporting it manually via:
# ( TAG=2018-02-01; git archive --prefix=re2-$TAG/ --output=re2-$TAG.tar.gz $TAG )
-NAME = re2
-VERSION = 2018-10-01
-DIR = $(NAME)-$(VERSION)
+NAME := re2
+VERSION := 2018-10-01
+DIR := $(NAME)-$(VERSION)
+
+BUILD-HELPER-DIR := .$(NAME)-build-helper
+
+TARXZ := $(shell which tar) xzf
+TOUCH := $(shell which touch)
+MKDIR := $(shell which mkdir) -p
.PHONY: build unpacks install skel clean
-build: unpack
+build: $(BUILD-HELPER-DIR)/build
+
+unpack: $(BUILD-HELPER-DIR)/unpack
+
+
+$(BUILD-HELPER-DIR)/build: $(BUILD-HELPER-DIR)/unpack
# basically what part of AC_PROC_CXX does
@CXX="" ; \
for PROG in g++-8 clang++-7 g++-7 clang++-6.0 clang++-5.0 g++-6 clang++-4.0 g++-5
clang++-3.9 clang++-3.8 clang++-3.7 clang++-3.6 clang++-3.5 g++-4.9 g++ clang++; do \
@@ -28,18 +39,21 @@ build: unpack
# TODO(sp): What should we do about RE2_ON_VALGRIND?
# Massage paths a bit by moving things around.
mv $(PACKAGE_RE2_DESTDIR)/$(OMD_ROOT)/include $(PACKAGE_RE2_DESTDIR)/$(OMD_ROOT)/lib
$(PACKAGE_RE2_DESTDIR)
- rm -rf $(PACKAGE_RE2_DESTDIR)/$(OMD_BASE)
+ $(RM) -r $(PACKAGE_RE2_DESTDIR)/$(OMD_BASE)
# To link statically against RE2, we must *only* see the static library at link
# time. It is a bit wasteful to build the dynamic library, too, but RE2's
# Makefile doesn't offer an easy way around that.
$(RM) $(PACKAGE_RE2_DESTDIR)/lib/*.so*
+ $(TOUCH) $@
-unpack:
- tar xzf $(DIR).tar.gz
+$(BUILD-HELPER-DIR)/unpack: $(DIR).tar.gz
+ $(MKDIR) $(BUILD-HELPER-DIR)
+ $(TARXZ) $<
+ $(TOUCH) $@
install:
skel:
clean:
- rm -rf $(DIR) $(PACKAGE_RE2_DESTDIR)
+ $(RM) -r $(DIR) $(PACKAGE_RE2_DESTDIR) $(BUILD-HELPER-DIR)