From bf9677f2ae2292251eea511646b8b6fb2138e7fa Mon Sep 17 00:00:00 2001 From: Vftdan Date: Wed, 23 Oct 2024 14:01:58 +0200 Subject: [PATCH] Fix Makefile - Pass INCPATH to CPP - Delete whole build dir --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5578972..818fe94 100644 --- a/Makefile +++ b/Makefile @@ -16,17 +16,18 @@ $(BUILD_DIR)/%.c.deps.mk: $(SRC_DIR)/%.c echo include common.mk > $@ @printf '%s: ' "$@" >> $@ @# SIC: not `read -r` - @$(CPP) $(CPPFLAGS) -M $(SRC_DIR)/$*.c | { read target deps; echo "$$deps" ;} >> $@ + @$(CPP) $(CPPFLAGS) $(INCPATH) -M $(SRC_DIR)/$*.c | { read target deps; echo "$$deps" ;} >> $@ @echo ' rm $@' >> $@ @echo ' $$(MAKE) -f Makefile $$(MFLAGS) $$(MAKEOVERRIDES) $@' >> $@ @printf '%s/%s' "$(BUILD_DIR)" "$(dir $*)" >> $@ - $(CPP) $(CPPFLAGS) -M $(SRC_DIR)/$*.c >> $@ + $(CPP) $(CPPFLAGS) $(INCPATH) -M $(SRC_DIR)/$*.c >> $@ echo ' $(CC) -c $$< $$(CPPFLAGS) $$(CFLAGS) $$(INCPATH) -o $$@' >> $@ ifneq ($(BUILD_DIR),) # Avoid `rm /` clean: - -rm main $(BUILD_DIR)/*.o $(BUILD_DIR)/*.deps.mk + -rm server + -rm -r $(BUILD_DIR) endif .PHONY: $(shell find $(BUILD_DIR) -name '*.deps.mk')