summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTazyFoundSoup <gardendistrict0x0@outlook.com>2026-02-22 15:21:59 +1100
committerTazyFoundSoup <gardendistrict0x0@outlook.com>2026-02-22 15:22:07 +1100
commitb7567644fd4493eed8e2407a39be1208a883c857 (patch)
tree75abc2dc1f9ccc05479528eb2bfa6797619a3630 /Makefile
parent8894c022753f7344a6c205946b67fa6b25974737 (diff)
git(CI/CD): Fix Makefile folder creation issue
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 6 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 7e8a569..f9413d1 100644
--- a/Makefile
+++ b/Makefile
@@ -8,18 +8,17 @@ OBJ=$(SRC:.c=.o)
LIB=libtinyff.a
OUTDIR=dist
-all: $(LIB)
+all: $(OUTDIR)/$(LIB)
-$(OUTDIR):
- mkdir -p $(OUTDIR)
-
-$(LIB): $(OBJ)
- $(AR) rcs $(OUTDIR)/$(LIB) $(OUTDIR)/$(OBJ)
+$(OUTDIR)/$(LIB): $(OBJ)
+ @mkdir -p $(OUTDIR)
+ $(AR) rcs $@ $(addprefix $(OUTDIR)/,$(OBJ))
%.o: %.c
+ @mkdir -p $(dir $(OUTDIR)/$@)
$(CC) $(CFLAGS) -c $< -o $(OUTDIR)/$@
clean:
- rm -f $(OUTDIR)/$(OBJ) $(LIB)
+ rm -rf $(OUTDIR)
.PHONY: all clean