]> Zhao Yanbai Git Server - kernel.git/commitdiff
解决make clean有可能删除不干净object文件的问题
authoracevest <zhaoyanbai@126.com>
Wed, 11 Oct 2023 15:48:27 +0000 (23:48 +0800)
committeracevest <zhaoyanbai@126.com>
Wed, 11 Oct 2023 15:48:27 +0000 (23:48 +0800)
Makefile

index 2779a38ac7b7470cdc505440af7e3e18333984b1..1ef94365a30b83c8789663517e8d7a2b030451a4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -61,11 +61,15 @@ ${KERNELBIN}: ${OBJS}
 c:
        rm -f $(KERNELBIN)
 
-.PHONY: clean
-clean:
-       rm -f $(OBJS)
+.PHONY: clean $(SRC_DIRS)
+clean: $(SRC_DIRS)
        rm -f $(KERNELBIN) $(SYSTEMMAP)
 
+$(SRC_DIRS):
+       @echo "clean *.o files in $@"
+       @find $@ -name "*\.o" -delete
+
+
 .PHONY: install
 install:
        cp -p KERNEL.ELF /boot/