@@ -1,62 +1,6 @@
1−# CI build
21
3−GHC ?= $(shell which ghc)
4−CABAL ?= $(shell which cabal)
5−CABAL_DEV ?= $(shell which cabal-dev)
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 ?=
11−REPOS=$(shell cat REPOS | sed '/^$$/d')
12−
13−.PHONY: all
14−all:
15− $(info branch = ${BRANCH})
16−
17−.PHONY: clean
18−clean:
19− rm -rf ${REPOS} ./dist ./cabal-dev
20−
21−.PHONY: dev-install
22−ifneq (,$(CABAL_DEV))
23−dev-install: $(REPOS)
24− $(CABAL_DEV) install --enable-tests
2+ifneq (,$(BASE_DIR))
3+include $(BASE_DIR)/build.mk
254else
26−dev-install:
27− $(error install cabal-dev to proceed)
5+include ../build.mk
286endif
29−
30−.PHONY: ci
31−ci: travis-install travis-test
32−
33−.PHONY: travis-install
34−travis-install: $(REPOS)
35− $(CABAL) install --with-ghc=$(GHC) $(REPOS) --force-reinstalls
36− $(CABAL) install
37−
38−.PHONY: travis-test
39−travis-test:
40− $(CABAL) configure --enable-tests
41− $(CABAL) build
42− $(CABAL) test --show-details=always
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−
54−$(REPOS):
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