diff options
| author | nasr <nsrddyn@gmail.com> | 2026-04-13 15:33:05 +0200 |
|---|---|---|
| committer | nasr <nsrddyn@gmail.com> | 2026-04-13 15:36:24 +0200 |
| commit | 9d09d66a273f68fae7efb71504bf40c664b91983 (patch) | |
| tree | 41a46c52a01338bf22d5f3ebdf0bb27dc3d33cc1 /Makefile | |
feature(main): init
feature(main): init
feature(main): init
feature(main): init
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 27 |
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 @@ | |||
| 1 | BIN = build/tb_ml | ||
| 2 | SRC = source/tb_ml/tb_ml.c | ||
| 3 | |||
| 4 | # CC = gcc | ||
| 5 | CC = clang | ||
| 6 | |||
| 7 | COMPILER := $(shell $(CC) --version | grep -o "gcc\|clang" | head -1) | ||
| 8 | |||
| 9 | # check for compile optimizations per compiler | ||
| 10 | ifeq ($(COMPILER),gcc) | ||
| 11 | CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -Werror -O0 | ||
| 12 | else ifeq ($(COMPILER),clang) | ||
| 13 | CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -O0 | ||
| 14 | else | ||
| 15 | CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -O0 | ||
| 16 | endif | ||
| 17 | |||
| 18 | $(BIN): $(SRC) | ||
| 19 | mkdir -p build | ||
| 20 | $(CC) $(CFLAGS) $< -o $@ | ||
| 21 | |||
| 22 | run: $(BIN) | ||
| 23 | $(BIN) | ||
| 24 | |||
| 25 | .PHONY: clean | ||
| 26 | clean: | ||
| 27 | rm -rf build | ||
