Try ccache
authorXimin Luo <infinity0@debian.org>
Tue, 4 Jul 2017 18:49:51 +0000 (20:49 +0200)
committerXimin Luo <infinity0@debian.org>
Tue, 4 Jul 2017 18:49:51 +0000 (20:49 +0200)
debian/rules

index 369fb6d1ac54b18bcef3a0e67b26c6562894e975..362d475ebb3c354626f5cde8feffb9a4c766a072 100755 (executable)
@@ -9,6 +9,15 @@ ALL_PACKAGES := $(shell dh_listpackages)
 OCAMLMAJOR := 4.04
 OCAMLMINOR := 0
 
+# Use ccache if pkg.ocaml.ccache build-profile is active.
+# Your rebuilds will be *much quicker*.
+ifneq (,$(filter pkg.ocaml.ccache,$(DEB_BUILD_PROFILES)))
+export PATH := /usr/lib/ccache:$(PATH)
+export CCACHE_DIR := $(CURDIR)/debian/ccache
+#export CCACHE_BASEDIR := $(CURDIR)/debian/build
+$(shell mkdir -p "$(CCACHE_DIR)")
+endif
+
 # Build cache (for Debian debugging)
 BUILDCACHE := $(wildcard ../ocaml.cache)