-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
53 lines (40 loc) · 1.07 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
config ?= debug
ifdef config
ifeq (,$(filter $(config),debug release))
$(error Unknown configuration "$(config)")
endif
endif
ifeq ($(config),debug)
PONYC_FLAGS += --debug
endif
PONYC ?= ponyc
COMPILE_WITH := corral run -- $(PONYC)
PONYC_FLAGS += -V1 -o build/$(config)
ifeq ($(ssl),1.1.x)
PONYC_FLAGS += -Dopenssl_1.1.x
else ifeq ($(ssl),0.9.0)
PONYC_FLAGS += -Dopenssl_0.9.0
else ifeq ($(ssl),3.0.x)
PONYC_FLAGS += -Dopenssl_3.0.x
else
PONYC_FLAGS += -Dopenssl_1.1.x
endif
DEPS = _corral _repos
JENNET_SRCS = $(shell find jennet -name *.pony)
EXAMPLES = $(shell find examples/*/* -name '*.pony' -print | xargs -n 1 dirname)
ALL: test
build:
mkdir -p build/$(config)
${DEPS}: corral.json
corral fetch
build/$(config)/test: ${DEPS} build ${JENNET_SRCS}
${COMPILE_WITH} ${PONYC_FLAGS} --bin-name=test jennet
test: build/$(config)/test
build/$(config)/test $(PONYTEST_ARGS)
examples: ${EXAMPLES}
${EXAMPLES}: ${DEPS} build ${JENNET_SRCS} $(shell find $@ -name *.pony)
${COMPILE_WITH} ${PONYC_FLAGS} $@
clean:
rm -rf build
corral clean
.PHONY: clean test examples