summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2f5d478
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
1BIN = build/tb_ml
2SRC = source/tb_ml/tb_ml.c
3
4# CC = gcc
5CC = clang
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
17
18$(BIN): $(SRC)
19 mkdir -p build
20 $(CC) $(CFLAGS) $< -o $@
21
22run: $(BIN)
23 $(BIN)
24
25.PHONY: clean
26clean:
27 rm -rf build