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')