diff options
-rw-r--r-- | Makefile | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 $@) |