Added distclean rule to makefiles

This commit is contained in:
David Benepe
2022-03-26 17:20:19 -04:00
parent 77f165b999
commit 02d7eef0ad
2 changed files with 15 additions and 3 deletions
+12 -2
View File
@@ -47,6 +47,7 @@ COLOR ?= 1
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),clean_lib)
ifneq ($(MAKECMDGOALS),clean_src)
ifneq ($(MAKECMDGOALS),distclean)
ifneq ($(MAKECMDGOALS),reset)
################ Check if a baserom exists ################
@@ -120,6 +121,7 @@ endif
endif
endif
endif
endif
################################
@@ -338,7 +340,15 @@ ifneq ($(wildcard ./build/.*),)
rm -r build
else
@echo "/build/ directory has already been deleted."
endif
endif
distclean:
rm -rf build
rm -rf assets
rm -rf ucode
rm -rf dkr.ld
rm -rf tools/ido-static-recomp/{,.[!.],..?}* # Deletes all files, including hidden ones.
$(MAKE) -C tools distclean
clean_lib:
ifneq ($(wildcard $(BUILD_DIR)/lib/.*),)
@@ -477,7 +487,7 @@ test: $(BUILD_DIR)/$(TARGET).z64
load: $(BUILD_DIR)/$(TARGET).z64
$(LOADER) $(LOADER_FLAGS) $<
.PHONY: all clean default diff test
.PHONY: all clean distclean default diff test
# Remove built-in rules, to improve performance
MAKEFLAGS += --no-builtin-rules
+3 -1
View File
@@ -21,6 +21,8 @@ all: $(PROGRAMS) $(CXX_PROGRAMS)
clean:
rm -Rf $(PROGRAMS) $(CXX_PROGRAMS) $(BUILD_DIR)
distclean: clean
n64crc: n64crc.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
@@ -42,5 +44,5 @@ $(BUILD_DIR)/%.o: %.cpp
dkr_assets_tool: $(dkr_assets_tool_OBJ_FILES)
$(CXX) $^ -o $@ --std=c++17 -lstdc++fs -lcrypto -lssl -lpthread $(LDFLAGS)
.PHONY: all clean default
.PHONY: all clean distclean default