From: acevest Date: Wed, 11 Oct 2023 15:48:27 +0000 (+0800) Subject: 解决make clean有可能删除不干净object文件的问题 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-coverage.html?a=commitdiff_plain;h=63007de376cdac84271bbf5969ebe3d68b01d3f4;p=kernel.git 解决make clean有可能删除不干净object文件的问题 --- diff --git a/Makefile b/Makefile index 2779a38..1ef9436 100644 --- 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/