summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 39e9b87..29aa256 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,25 @@
1BIN = build/engine 1BIN = build/engine
2SRC = source/tb_db.c 2SRC = source/tb_db.c
3
4# CC = gcc
3CC = clang 5CC = clang
4CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -Werror 6
7COMPILER := $(shell $(CC) --version | grep -o "gcc\|clang" | head -1)
8
9# check for compile optimizations per compiler
10ifeq ($(COMPILER),gcc)
11 CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -Werror -O0
12else ifeq ($(COMPILER),clang)
13 CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -O0
14else
15 CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -O0
16endif
5 17
6$(BIN): $(SRC) 18$(BIN): $(SRC)
7 mkdir -p build 19 mkdir -p build
8 $(CC) $(CFLAGS) $< -o $@ 20 $(CC) $(CFLAGS) $< -o $@
9 21
10run: 22run: $(BIN)
11 $(BIN) 23 $(BIN)
12 24
13.PHONY: clean 25.PHONY: clean