@@ -3,17 +3,25 @@
33GHC ?= $(shell which ghc)
44CABAL ?= $(shell which cabal)
55CABAL_DEV ?= $(shell which cabal-dev)
6−
7−BASE_GIT := git://github.com/haskell-distributed
6+PWD = $(shell pwd)
7+SANDBOX ?= $(PWD)/cabal-dev
8+BRANCH ?= $(shell git branch | grep '*' | awk '/.*/ { print $NF }')
9+GIT_BASE ?= git://github.com/haskell-distributed
10+USE_LOCAL_UMBRELLA ?=
811REPOS=$(shell cat REPOS | sed '/^$$/d')
912
1013.PHONY: all
11−all: dev-install
14+all:
15+ $(info branch = ${BRANCH})
16+
17+.PHONY: clean
18+clean:
19+ rm -rf ${REPOS} ./dist ./cabal-dev
1220
1321.PHONY: dev-install
1422ifneq (,$(CABAL_DEV))
15−dev-install:
16− $(CABAL_DEV) install
23+dev-install: $(REPOS)
24+ $(CABAL_DEV) install --enable-tests
1725else
1826dev-install:
1927 $(error install cabal-dev to proceed)
@@ -24,8 +32,6 @@ ci: travis-install travis-test
2432
2533.PHONY: travis-install
2634travis-install: $(REPOS)
27− $(CABAL) install QuickCheck-2.6 --force-reinstalls
28− $(CABAL) install rematch --force-reinstalls
2935 $(CABAL) install --with-ghc=$(GHC) $(REPOS) --force-reinstalls
3036 $(CABAL) install
3137
@@ -35,5 +41,22 @@ travis-test:
3541 $(CABAL) build
3642 $(CABAL) test --show-details=always
3743
44+ifneq (,$(USE_LOCAL_UMBRELLA))
45+define clone
46+ git clone $(GIT_BASE)/$1 $1
47+endef
48+else
49+define clone
50+ git clone $(GIT_BASE)/$1.git $1
51+endef
52+endif
53+
3854$(REPOS):
39− git clone $(BASE_GIT)/$@.git
55+ $(call clone,$@)
56+ git --git-dir=$@/.git \
57+ --work-tree=$@ \
58+ checkout $(BRANCH)
59+ cd $@ && $(CABAL_DEV) install --sandbox=$(SANDBOX)
60+
61+./build:
62+ mkdir -p build