diff options
author | Tom Smeding <t.j.smeding@uu.nl> | 2024-07-13 18:08:33 +0200 |
---|---|---|
committer | Tom Smeding <t.j.smeding@uu.nl> | 2024-07-13 18:08:33 +0200 |
commit | 7105b4a2593977f0826c98bd094f0bf8a465e87f (patch) | |
tree | 25c3ca399c37b506ea691565aecfbae66ae467cd | |
parent | fe429b07f6878cf39c6945868a4199b8404b8e7d (diff) |
Fix makefile
-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 $@) |