From 9d09d66a273f68fae7efb71504bf40c664b91983 Mon Sep 17 00:00:00 2001 From: nasr Date: Mon, 13 Apr 2026 15:33:05 +0200 Subject: feature(main): init feature(main): init feature(main): init feature(main): init --- Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2f5d478 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +BIN = build/tb_ml +SRC = source/tb_ml/tb_ml.c + +# CC = gcc +CC = clang + +COMPILER := $(shell $(CC) --version | grep -o "gcc\|clang" | head -1) + +# check for compile optimizations per compiler +ifeq ($(COMPILER),gcc) + CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -Werror -O0 +else ifeq ($(COMPILER),clang) + CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -O0 +else + CFLAGS = -Wall -Wextra -Wpedantic -Wno-unused-function -g -O0 +endif + +$(BIN): $(SRC) + mkdir -p build + $(CC) $(CFLAGS) $< -o $@ + +run: $(BIN) + $(BIN) + +.PHONY: clean +clean: + rm -rf build -- cgit v1.3