-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
121 lines (102 loc) · 3.43 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
SRC_DIR=src
RUNTIME_DIR=$(SRC_DIR)/runtime
CONFIG=debug
CONFIG=release
RELEASE_DIR=release
INC_DIR=$(RELEASE_DIR)/inc
LIB_DIR=$(RELEASE_DIR)/lib
all: encorec
typecheck:
cabal build --ghc-option=-fno-code
encorec: dirs pony stack-setup
export ENCORE_MODULES="$(CURDIR)/modules/" && \
stack install --system-ghc --local-bin-path $(RELEASE_DIR)
stack-setup:
stack setup --system-ghc
test: encorec
make -C $(SRC_DIR) test
stress: encorec
make -C $(SRC_DIR) stress
coverage: dirs pony
rm -rf coverage dist/hpc;
find src -name "*.tix" -print0 | xargs -0 rm -rf;
cabal clean;
cabal configure --enable-tests --enable-coverage;
ENCORE_MODULES="$(CURDIR)/modules/" cabal build;
cp dist/build/encorec/encorec $(RELEASE_DIR);
-make -C $(SRC_DIR) test;
mkdir -p coverage;
find src -name "*.tix" -print0 | xargs -0 hpc sum > coverage/coverage.tix;
hpc markup coverage/coverage.tix --hpcdir=dist/hpc/vanilla/mix/encorec/ --destdir=coverage;
rm -rf coverage/coverage.tix dist/hpc;
find src -name "*.tix" -print0 | xargs -0 rm -rf;
echo "Open 'coverage/hpc_index.html' to see coverage results.";
SET_DIR=$(RUNTIME_DIR)/set
FUTURE_DIR=$(RUNTIME_DIR)/future
ENCORE_DIR=$(RUNTIME_DIR)/encore
dirs: $(INC_DIR) $(LIB_DIR)
$(INC_DIR):
mkdir -p $(INC_DIR)
$(LIB_DIR):
mkdir -p $(LIB_DIR)
COMMON_INC=$(RUNTIME_DIR)/common/*
POOL_INC=$(RUNTIME_DIR)/pony/libponyrt/mem/pool.h
PONY_INC=$(RUNTIME_DIR)/pony/libponyrt/*.h
PONY_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/libponyrt.a
FUTURE_INC=$(FUTURE_DIR)/future.h
FUTURE_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/libfuture.a
OPTION_INC=$(RUNTIME_DIR)/adt/option.h
OPTION_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/liboptiontype.a
ENCORE_INC=$(ENCORE_DIR)/encore.h
ENCORE_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/libencore.a
CLOSURE_INC=$(RUNTIME_DIR)/closure/closure.h
CLOSURE_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/libclosure.a
TASK_INC=$(RUNTIME_DIR)/task/task.h
TASK_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/libtask.a
PARTY_INC=$(RUNTIME_DIR)/party/party.h
PARTY_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/libparty.a
STREAM_INC=$(RUNTIME_DIR)/stream/stream.h
STREAM_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/libstream.a
ARRAY_INC=$(RUNTIME_DIR)/array/array.h
ARRAY_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/libarray.a
TUPLE_INC=$(RUNTIME_DIR)/tuple/tuple.h
TUPLE_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/libtuple.a
RANGE_INC=$(RUNTIME_DIR)/range/range.h
RANGE_LIB=$(RUNTIME_DIR)/pony/bin/$(CONFIG)/librange.a
pony: dirs $(PONY_INC)
make -C $(SRC_DIR) pony use=$(use)
cp -r $(COMMON_INC) $(INC_DIR)
cp -r $(POOL_INC) $(INC_DIR)
cp -r $(PONY_INC) $(INC_DIR)
cp -r $(FUTURE_INC) $(INC_DIR)
cp -r $(OPTION_INC) $(INC_DIR)
cp -r $(CLOSURE_INC) $(INC_DIR)
cp -r $(TASK_INC) $(INC_DIR)
cp -r $(PARTY_INC) $(INC_DIR)
cp -r $(STREAM_INC) $(INC_DIR)
cp -r $(ENCORE_INC) $(INC_DIR)
cp -r $(ARRAY_INC) $(INC_DIR)
cp -r $(TUPLE_INC) $(INC_DIR)
cp -r $(RANGE_INC) $(INC_DIR)
cp -r $(PONY_LIB) $(LIB_DIR)
cp -r $(FUTURE_LIB) $(LIB_DIR)
cp -r $(CLOSURE_LIB) $(LIB_DIR)
cp -r $(TASK_LIB) $(LIB_DIR)
cp -r $(OPTION_LIB) $(LIB_DIR)
cp -r $(PARTY_LIB) $(LIB_DIR)
cp -r $(ENCORE_LIB) $(LIB_DIR)
cp -r $(STREAM_LIB) $(LIB_DIR)
cp -r $(ARRAY_LIB) $(LIB_DIR)
cp -r $(TUPLE_LIB) $(LIB_DIR)
cp -r $(RANGE_LIB) $(LIB_DIR)
clean:
rm -rf .stack-work/dist
rm -rf dist
make -C $(SRC_DIR) clean
rm -rf $(RELEASE_DIR)
rm -rf $(INC_DIR)
rm -rf $(LIB_DIR)
rm -rf coverage
vagrant:
-@vagrant up
.PHONY: all encorec typecheck fetch-hs-deps test stress dirs pony clean vagrant coverage