-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
60 lines (42 loc) · 1.16 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
config ?= release
PACKAGE := msgpack
COMPILE_WITH := ponyc
BUILD_DIR ?= build/$(config)
SRC_DIR ?= $(PACKAGE)
tests_binary := $(BUILD_DIR)/$(PACKAGE)
docs_dir := build/$(PACKAGE)-docs
ifdef config
ifeq (,$(filter $(config),debug release))
$(error Unknown configuration "$(config)")
endif
endif
ifeq ($(config),release)
PONYC = ${COMPILE_WITH}
else
PONYC = ${COMPILE_WITH} --debug
endif
ifeq ($(ci),true)
PONYC += -Dci
endif
SOURCE_FILES := $(shell find $(SRC_DIR) -name \*.pony)
test: unit-tests build-examples
unit-tests: $(tests_binary)
$^ --exclude=integration --sequential
$(tests_binary): $(GEN_FILES) $(SOURCE_FILES) | $(BUILD_DIR)
${PONYC} -o ${BUILD_DIR} $(SRC_DIR)
build-examples:
find examples/*/* -name '*.pony' -print | xargs -n 1 dirname | sort -u | grep -v ffi- | xargs -n 1 -I {} ${PONYC} -s --checktree -o ${BUILD_DIR} {}
clean:
rm -rf $(BUILD_DIR)
realclean:
rm -rf build
$(docs_dir): $(GEN_FILES) $(SOURCE_FILES)
rm -rf $(docs_dir)
${PONYC} --docs-public --pass=docs --output build $(SRC_DIR)
docs: $(docs_dir)
TAGS:
ctags --recurse=yes $(SRC_DIR)
all: test
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
.PHONY: all clean realclean TAGS test