Fix meaningless texts compression when running make clean or make tag

- reference: https://stackoverflow.com/questions/12857020/gnu-make-clean-target-depends-on-includes
- doc: https://www.gnu.org/software/make/manual/html_node/Goals.html
This commit is contained in:
laqieer 2024-08-17 15:33:42 +08:00
parent db1e85b138
commit 19c30b384b

View File

@ -170,7 +170,11 @@ $(BANIM_OBJECT): $(shell ./scripts/arm_compressing_linker.py -t linker_script_ba
MAKEDEP = mkdir -p $(DEPS_DIR)/$(dir $*) && $(CPP) $(CPPFLAGS) $< -MM -MG -MT $*.o > $(DEPS_DIR)/$*.d
MAKECMDGOALS_NODEP := clean tag
ifeq (,$(filter $(MAKECMDGOALS),$(MAKECMDGOALS_NODEP)))
-include $(addprefix $(DEPS_DIR)/,$(CFILES:.c=.d))
endif
$(DEPS_DIR)/%.d: %.c
@$(MAKEDEP)