From 3f7e34101898d2d0ac29a6e27087882afd413250 Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Sun, 22 Feb 2026 15:28:57 +1100 Subject: just work already D: --- Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b339e87..e8f0229 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ AR=ar CFLAGS=-Wall -Wextra -std=c11 -O2 -Iinclude -Iinclude/tinyff -Iinclude/ext SRC=$(shell find src -name "*.c") -OBJ=$(SRC:.c=.o) +OBJ=$(patsubst src/%.c,$(OUTDIR)/src/%.o,$(SRC)) LIB=libtinyff.a OUTDIR=dist @@ -12,12 +12,11 @@ all: $(OUTDIR)/$(LIB) $(OUTDIR)/$(LIB): $(OBJ) @mkdir -p $(OUTDIR) - $(AR) rcs $@ $(addprefix $(OUTDIR)/,$(OBJ)) + $(AR) rcs $@ $^ - -%.o: %.c - @mkdir -p $(dir $(OUTDIR)/$@) - $(CC) $(CFLAGS) -c $< -o $(OUTDIR)/$@ +$(OUTDIR)/src/%.o: src/%.c + @mkdir -p $(dir $@) + $(CC) $(CFLAGS) -c $< -o $@ clean: rm -rf $(OUTDIR) -- cgit v1.2.3