-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (26 loc) · 809 Bytes
/
Makefile
File metadata and controls
36 lines (26 loc) · 809 Bytes
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
PROJECT:=TestFramework
CC:=clang
CERROR:= -Wall -Wextra -Werror -Walloca -Wcast-qual -Wconversion -Wdouble-promotion -Wfloat-equal -Wswitch-default -Wswitch-enum -g
CFLAGS:=-std=c2x -O3 -ffast-math $(CERROR)
LDFLAGS:=
SRC_DIR:=src
INC_DIR:=lib
OUT_DIR:=build
DEBUG_DIR:=debug
SRC_FILES=$(wildcard $(SRC_DIR)/*.c)
$(PROJECT): $(SRC_FILES)
mkdir -p build
mkdir -p debug
$(CC) $(CFLAGS) -I$(INC_DIR)/ -o $(OUT_DIR)/$(PROJECT) $(SRC_FILES) $(LDFLAGS)
make run
.PHONY: run update check clean
run:
./$(OUT_DIR)/$(PROJECT)
update:
bear --output $(DEBUG_DIR)/compile_commands.json -- make
clang-format -style=google -dump-config > $(DEBUG_DIR)/.clang-format
check:
clang-format -style=file:$(DEBUG_DIR)/.clang-format -i $(SRC_FILES)
clang-tidy $(SRC_FILES) -p $(DEBUG_DIR)/
clean:
rm $(OUT_DIR)/*