forked from nominolo/scion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (32 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
default: install
# Create a file config.mk to customise some of these options. This
# can be useful for example to compile with the HEAD branch of GHC.
# See config.mk.sample for an example.
-include config.mk
TOP := $(shell pwd)
DIST ?= dist
HC ?= ghc
RUNHC ?= runghc -f $(HC)
#HC = ghc-6.12.1
#RUNHC = runghc -f$(HC)
boot:
mkdir -p $(DIST)
.PHONY: inplace
inplace:
$(HC) --make -outputdir $(DIST) -isrc -package ghc Scion.Session
$(HC) --make -outputdir $(DIST) -isrc -package ghc Scion.Worker.Main
$(HC) --make -outputdir $(DIST) -isrc -package ghc src/Worker.hs -o $(DIST)/scion-worker
# cp src/Worker.hs $(DIST)/Worker.hs
echo "#!/bin/sh\n$(DIST)/scion-worker \$${1+\"\$$@\"}" > inplace/scion-worker
chmod +x inplace/scion-worker
echo "#!/bin/sh\n$(RUNHC) -i\"$(TOP)/src\" -package --ghc-arg=ghc -i\"$(DIST)\" \"$(TOP)/src/Server.hs\"" > inplace/scion-server
chmod +x inplace/scion-server
.PHONY: install
install:
time cabal -v install --builddir=$(DIST)/cabal --with-compiler=$(HC)
.PHONY: test
test:
$(RUNHC) test/TestSuite.hs
.PHONY: docs
docs:
cabal -v haddock --builddir=$(DIST)/cabal