From cae6aafd1bff694c2563531cdfc0e1f513e153c9 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Tue, 11 Nov 2025 10:35:18 +0100 Subject: Add build system --- Makefile | 16 ++++++++++++++++ src/Makefile | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Makefile create mode 100644 src/Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2619f92 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +export PROG ?= ftag +export CFLAGS ?= -O0 -g3 +export __CFLAGS := -std=c99 -Wall +export __LIBS := $(shell pkg-config --libs sqlite3) +export FTAG_ROOT := $(shell pwd) + +all: $(PROG) + +$(PROG): + make -C src + +clean: + make -C src clean + rm -f $(PROG) + +.PHONY: all clean diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..c75db54 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,11 @@ +$(PROG): main.o + $(CC) -o $@ $^ $(__LIBS) $(LDFLAGS) $(LIBS) + +main.o: main.c +.c.o: + $(CC) $(__CFLAGS) $(CFLAGS) -c $< + +clean: + rm -f *.o $(PROG) + +.PHONY: clean -- cgit v1.2.3