generated from FourteenBrush/odin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (25 loc) · 791 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
rwildcard = $(wildcard $1) $(foreach d,$1,$(call rwildcard,$(addsuffix /$(notdir $d),$(wildcard $(dir $d)*))))
PROG = crux
SRC = src
SOURCE_FILES = $(call rwildcard,$(SRC)/*.odin)
TESTS = tests
CC = odin
CFLAGS = -out:$(PROG) -strict-style -vet-semicolon -vet-cast -vet-using-param
all: release
release: CFLAGS += -vet-unused -o:speed -microarch:native
release: $(PROG)
debug: CFLAGS += -debug -o:none
debug: $(PROG)
test: CFLAGS += -define:ODIN_TEST_LOG_LEVEL=warning -debug
test: $(SOURCE_FILES)
$(CC) test $(TESTS) $(CFLAGS)
$(PROG): $(SOURCE_FILES)
$(CC) build $(SRC) $(CFLAGS)
run: debug
./$(PROG)
check: CFLAGS := $(filter-out -out:$(PROG),$(CFLAGS))
check:
$(CC) check $(SRC) $(CFLAGS) -debug
clean:
-@rm $(PROG) 2>/dev/null
.PHONY: release debug clean run test check