From e25f56cbe86041d4ab19e474e38032fa7e681ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 18 Sep 2021 01:19:31 +0200 Subject: Improve Makefile --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 37472bd..ad5701d 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ -.SUFFIXES: .c .t .tc -LDFLAGS += -lsqlite3 +LDLIBS += -lsqlite3 +C = $(shell ls *.c) +H = $(shell ls *.h) +TPL = $(shell ls t/*.t | sed 's/$$/c/') -C = cforum.c ctl.c db.c err.c query.c -TPL = t/err.tc t/foot.tc t/front.tc t/head.tc t/post.tc t/user.tc +.SUFFIXES: .t .tc -cforum: $(C) $(TPL) - $(CC) $(CFLAGS) $(LDFLAGS) -o cforum $(C) +cforum: $(C) $(H) $(TPL) + $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o cforum $(C) .t.tc: mktpl/mktpl <$< mktpl/mktpl >$@ -- cgit v1.2.3