summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2024-07-13 18:08:33 +0200
committerTom Smeding <t.j.smeding@uu.nl>2024-07-13 18:08:33 +0200
commit7105b4a2593977f0826c98bd094f0bf8a465e87f (patch)
tree25c3ca399c37b506ea691565aecfbae66ae467cd /Makefile
parentfe429b07f6878cf39c6945868a4199b8404b8e7d (diff)
Fix makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 03de33b..dfa689e 100644
--- a/Makefile
+++ b/Makefile
@@ -2,16 +2,18 @@ CC := gcc
CFLAGS := -Wall -Wextra -std=c11 -O2
LDFLAGS :=
+BINDIR := bin
+
SOURCES := $(wildcard src/*.c)
HEADERS := $(wildcard src/*.h)
-TARGETS := $(patsubst src/%.c,bin/%,$(SOURCES))
+TARGETS := $(patsubst src/%.c,$(BINDIR)/%,$(SOURCES))
.PHONY: all clean
all: $(TARGETS)
clean:
- rm -f $(TARGETS)
+ find $(BINDIR) -maxdepth 1 -type f -delete
$(TARGETS): bin/%: src/%.c $(HEADERS)
@mkdir -p $(dir $@)