[V15,1/9] build: add command check-clean

Submitted by Wayne Xia on Jan. 25, 2013, 2:43 a.m.

Details

Message ID 1359081842-17924-2-git-send-email-xiawenc@linux.vnet.ibm.com
State New
Headers show

Commit Message

Wayne Xia Jan. 25, 2013, 2:43 a.m.
This command will package the clean operations in tests,
to make it easy to be extended. Now root Makefile simply calls
the command and do not care the details of it any more.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
---
 Makefile       |    1 -
 tests/Makefile |   12 +++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/Makefile b/Makefile
index 73adf42..de5ef74 100644
--- a/Makefile
+++ b/Makefile
@@ -226,7 +226,6 @@  clean:
 	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
 	rm -rf qapi-generated
 	rm -rf qga/qapi-generated
-	$(MAKE) -C tests/tcg clean
 	for d in $(ALL_SUBDIRS); do \
 	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
 	rm -f $$d/qemu-options.def; \
diff --git a/tests/Makefile b/tests/Makefile
index d86e95a..c7158f3 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -122,6 +122,10 @@  qtest-obj-y = tests/libqtest.o libqemuutil.a libqemustub.a
 qtest-obj-y += tests/libi2c.o tests/libi2c-omap.o
 $(check-qtest-y): $(qtest-obj-y)
 
+#clean rules
+
+CHECK_CLEAN_TARGETS = $(check-unit-y) $(check-qtest-i386-y) $(check-qtest-x86_64-y) $(check-qtest-sparc64-y) $(check-qtest-sparc-y) tests/*.o
+
 .PHONY: check-help
 check-help:
 	@echo "Regression testing targets:"
@@ -132,6 +136,7 @@  check-help:
 	@echo " make check-unit           Run qobject tests"
 	@echo " make check-block          Run block tests"
 	@echo " make check-report.html    Generates an HTML test report"
+	@echo " make check-clean          Clean the tests"
 	@echo
 	@echo "Please note that HTML reports do not regenerate if the unit tests"
 	@echo "has not changed."
@@ -191,10 +196,15 @@  check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF)
 
 # Consolidated targets
 
-.PHONY: check-qtest check-unit check
+.PHONY: check-qtest check-unit check check-clean
 check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
 check-unit: $(patsubst %,check-%, $(check-unit-y))
 check-block: $(patsubst %,check-%, $(check-block-y))
 check: check-unit check-qtest
 
+check-clean:
+	$(MAKE) -C tests/tcg clean
+	rm -rf $(CHECK_CLEAN_TARGETS)
+
+clean: check-clean
 -include $(wildcard tests/*.d)