Skip to contentSkip to conversation

build: add disclean target to docs, tools and xen directories

PATCH New Horms 1 participant 1 message Jun 23, 2006 Kbuild

lore
Share & tools
lore

Horms

author
#0 lore raw

PATCH 1/1 build: add disclean target to docs, tools and xen directories

The primary purpose of this patch is to make sure that the tags file and friends are cleaned out of xen/ on make distclean. It seemed clean to do this by adding a distclean target to that directory.

In order to do this vaugely efficiently, the toplevel Makefile should use the distclean target instead of clean for the xen directory, and in order to make this consistent I implemented disclean targets for docs and tools that just do the same things as clean.

 Makefile       |    5 ++++-
 docs/Makefile  |    3 +++
 tools/Makefile |    3 +++
 xen/Makefile   |    8 ++++++--
 4 files changed, 16 insertions(+), 3 deletions(-)
Makefile +4 -1
@@ -123,7 +123,10 @@ clean:: 
 
 # clean, but blow away kernel build tree plus local tarballs
 .PHONY: distclean
-distclean: clean kdelete
+distclean: kdelete
+	$(MAKE) -C xen distclean
+	$(MAKE) -C tools distclean
+	$(MAKE) -C docs distclean
 	rm -rf dist patches/tmp
 	for i in $(ALLSPARSETREES) ; do $(MAKE) $$i-mrproper ; done
 	rm -rf patches/*/.makedep
docs/Makefile +3 -0
@@ -80,6 +80,9 @@ clean:
 	rm -rf man5
 	rm -rf man1
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: install
 install: all
 	rm -rf $(DESTDIR)$(pkgdocdir)
tools/Makefile +3 -0
@@ -45,6 +45,9 @@ clean: check_clean
 	done
 	$(MAKE) ioemuclean
 
+.PHONY: distclean
+distclean: clean
+
 .PHONY: check
 check:
 	$(MAKE) -C check
xen/Makefile +6 -2
@@ -14,8 +14,8 @@ default: build
 .PHONY: dist
 dist: install
 
-.PHONY: build install clean cscope TAGS tags
-build install debug clean cscope TAGS tags::
+.PHONY: build install clean distclean cscope TAGS tags
+build install debug clean distclean cscope TAGS tags::
 	make -f Rules.mk _$@
 
 .PHONY: _build
@@ -50,6 +50,10 @@ _clean: delete-unfresh-files
 	rm -f include/asm-*/asm-offsets.h
 	rm -f include/xen/acm_policy.h
 
+.PHONY: _distclean
+_distclean: clean
+	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
+
 $(TARGET).gz: $(TARGET)
 	gzip -f -9 < $< > [email protected]
 	mv [email protected] $@