-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (39 loc) · 944 Bytes
/
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
# Interesting flags
# NAME=<test name> (example: cmd_async)
# TARGET=<target> (example: windows_amd64, linux_amd64)
# ODIN=<odin executable>
ifeq ($(OS),Windows_NT)
IS_WINDOWS = 1
endif
ifneq ($(filter windows_%, $(TARGET)),)
IS_WINDOWS = 1
endif
REPO_ROOT := $(realpath ./.)
ODIN ?= odin
ARGS += -vet
ARGS += -vet-packages:subprocess
ARGS += -disallow-do
ARGS += -warnings-as-errors
ARGS += -use-separate-modules
ARGS += -o:speed
ifdef TARGET
ARGS += -target:$(TARGET)
endif
ifdef NAME
ARGS += -define:ODIN_TEST_NAMES=tests._init,tests.$(NAME)
endif
ARGS += -define:ODIN_TEST_ALWAYS_REPORT_MEMORY=true
ARGS += -define:ODIN_TEST_FAIL_ON_BAD_MEMORY=true
ifdef TARGET
DEMO_ARGS += TARGET=$(TARGET)
endif
ifdef NAME
DEMO_ARGS += NAME=$(NAME)
endif
.PHONY: test demo docs
test:
$(ODIN) test tests $(ARGS) -define:REPO_ROOT="$(REPO_ROOT)"
demo:
make -B -C "$(REPO_ROOT)/demos" run $(DEMO_ARGS)
docs:
make -B -C "$(REPO_ROOT)/docs"