aboutsummaryrefslogtreecommitdiffstats
path: root/test/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-12-07 19:40:02 +0100
committerLoïc Hoguin <[email protected]>2018-12-07 19:40:02 +0100
commita3cd50792d0ed1c5dfee66ff79ee7117057e9970 (patch)
tree79c76f50159c7d63fc313628b8b0715831537b42 /test/Makefile
parent1fb70e0d435e5058c558f89d223a0f6ba3bd5342 (diff)
downloaderlang.mk-a3cd50792d0ed1c5dfee66ff79ee7117057e9970.tar.gz
erlang.mk-a3cd50792d0ed1c5dfee66ff79ee7117057e9970.tar.bz2
erlang.mk-a3cd50792d0ed1c5dfee66ff79ee7117057e9970.zip
Autopatch: allow configuring REBAR_GIT and REBAR_COMMIT
And use this in the tests to fetch Rebar only once and then clone from the local repository. This should speed up tests a little.
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/Makefile b/test/Makefile
index a66e9db..39973ce 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -94,17 +94,25 @@ endef
# Main targets.
-.PHONY: all clean build
+.PHONY: all clean init
all:: core
clean::
$t rm -rf erl_crash.dump packages/ test_*/
-build:
+init: clean
+ $i "Prefetch Rebar if necessary"
+ $t if [ ! -d test_rebar_git ]; then \
+ git clone -q -n -- https://github.com/rebar/rebar test_rebar_git; \
+ fi
+
$i "Generate a bleeding edge Erlang.mk"
$t cd .. && $(MAKE) $v
+REBAR_GIT = file://$(CURDIR)/test_rebar_git
+export REBAR_GIT
+
# Core.
.PHONY: core
@@ -139,7 +147,7 @@ packages: $(addprefix pkg-,$(PACKAGES))
define pkg_target
.PHONY: pkg-$1
-pkg-$1: build clean
+pkg-$1: init
# Make sure $@ is defined inside the define.
$(eval @ = pkg-$1)