-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
80 lines (57 loc) · 1.65 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
config ?= release
PACKAGE := lsp
GET_DEPENDENCIES_WITH := corral fetch
CLEAN_DEPENDENCIES_WITH := corral clean
PONYC ?= ponyc
COMPILE_WITH := corral run -- $(PONYC)
BUILD_DIR ?= build/$(config)
SRC_DIR ?= $(PACKAGE)
TEST_SRC_DIR ?= $(PACKAGE)/test
binary := $(BUILD_DIR)/pony-lsp
tests_binary := $(BUILD_DIR)/test
docs_dir := build/$(BUNDLE)-docs
ifdef config
ifeq (,$(filter $(config),debug release))
$(error Unknown configuration "$(config)")
endif
endif
PONYC ?= ponyc
ifeq ($(config),release)
PONYC := $(COMPILE_WITH)
else
PONYC := $(COMPILE_WITH) --debug
endif
ifneq ($(arch),)
arch_arg := --cpu $(arch)
endif
SOURCE_FILES := $(shell find $(SRC_DIR) -name *.pony)
all: language_server test vscode_extension
language_server: $(binary)
vscode_extension: language_server
$(MAKE) -C client_vscode
test: $(tests_binary)
$^ --exclude=integration
$(tests_binary): $(SOURCE_FILES) | $(BUILD_DIR)
$(GET_DEPENDENCIES_WITH)
$(PONYC) -o $(BUILD_DIR) --bin-name $(notdir $(tests_binary)) $(TEST_SRC_DIR)
$(binary): $(SOURCE_FILES) | $(BUILD_DIR)
$(GET_DEPENDENCIES_WITH)
$(PONYC) -o $(BUILD_DIR) --bin-name $(notdir $(binary)) $(SRC_DIR)
clean:
$(CLEAN_DEPENDENCIES_WITH)
rm -rf $(BUILD_DIR)
$(MAKE) -C client_vscode clean
$(docs_dir): $(SOURCE_FILES)
rm -rf $(docs_dir)
$(GET_DEPENDENCIES_WITH)
$(PONYC) --docs-public --pass=docs --output build $(SRC_DIR)
docs: $(docs_dir)
.coverage:
mkdir -p .coverage
coverage: .coverage $(tests_binary)
kcov --include-pattern="$(SRC_DIR)" --exclude-pattern="*/test/*.pony,*/_test.pony" .coverage $(tests_binary)
TAGS:
ctags --recurse=yes $(SRC_DIR)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
.PHONY: all clean TAGS test