Autodetect tools neccessary for building documentation.
Make distclean remove generated documentation files.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1834 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/Makefile b/Makefile
index 0c2ab09..ff60329 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,11 @@
 ifdef CONFIG_STATIC
 LDFLAGS+=-static
 endif
+ifdef BUILD_DOCS
 DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
+else
+DOCS=
+endif
 
 all: dyngen$(EXESUF) $(TOOLS) $(DOCS)
 	for d in $(TARGET_DIRS); do \
@@ -34,7 +38,7 @@
         done
 
 distclean: clean
-	rm -f config-host.mak config-host.h
+	rm -f config-host.mak config-host.h $(DOCS)
 	for d in $(TARGET_DIRS); do \
 	rm -rf $$d || exit 1 ; \
         done