3
3
GHC ?= $(shell which ghc)
4
4
CABAL ?= $(shell which cabal)
5
5
CABAL_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 ?=
8
11
REPOS =$(shell cat REPOS | sed '/^$$/d')
9
12
10
13
.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
12
20
13
21
.PHONY : dev-install
14
22
ifneq (,$(CABAL_DEV ) )
15
- dev-install :
16
- $(CABAL_DEV ) install
23
+ dev-install : $( REPOS )
24
+ $(CABAL_DEV ) install --enable-tests
17
25
else
18
26
dev-install :
19
27
$(error install cabal-dev to proceed)
@@ -24,8 +32,6 @@ ci: travis-install travis-test
24
32
25
33
.PHONY : travis-install
26
34
travis-install : $(REPOS )
27
- $(CABAL ) install QuickCheck-2.6 --force-reinstalls
28
- $(CABAL ) install rematch --force-reinstalls
29
35
$(CABAL ) install --with-ghc=$(GHC ) $(REPOS ) --force-reinstalls
30
36
$(CABAL ) install
31
37
@@ -35,5 +41,22 @@ travis-test:
35
41
$(CABAL ) build
36
42
$(CABAL ) test --show-details=always
37
43
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
+
38
54
$(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
0 commit comments