summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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 $@)