From cf2458f2efc2499751bd450db01e1ec52efda73f Mon Sep 17 00:00:00 2001
From: Markus Blatt <mblatt@dune-project.org>
Date: Mon, 30 Jul 2007 19:51:29 +0000
Subject: [PATCH] Fixed bug that cleaned generated files from the tarballs.

The trick is to test for doc/doxygen/Doxydep which is only there in
the svn tree!

[[Imported from SVN: r4960]]
---
 doc/Makefile.am             |  4 +++-
 doc/buildsystem/Makefile.am |  7 ++++++-
 doc/devel/Makefile.am       |  5 ++++-
 doc/doxygen/Makefile.am     | 10 +++++++---
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index cd7286a1a..aeff762da 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -27,7 +27,9 @@ EXTRA_DIST = $(PAGES) example.opts
 include $(top_srcdir)/am/webstuff
 
 # remove html pages on ``make  clean''
-CLEANFILES = $(PAGES)
+SVNCLEANFILES = $(PAGES)
+clean-local:
+	if test -e $(top_srcdir)/doc/doxygen/Doxydep; then rm -rf $(SVNCLEANFILES); fi
 
 # include further rules needed by Dune
 include $(top_srcdir)/am/global-rules
diff --git a/doc/buildsystem/Makefile.am b/doc/buildsystem/Makefile.am
index d5eb3c898..440178e5a 100644
--- a/doc/buildsystem/Makefile.am
+++ b/doc/buildsystem/Makefile.am
@@ -25,7 +25,12 @@ include $(top_srcdir)/am/webstuff
 include $(top_srcdir)/am/latex
 
 # remove html pages on ``make  clean''
-CLEANFILES = *.ps *.pdf auto *.aux *.dvi *.log *.out *.toc
+CLEANFILES = auto *.aux *.dvi *.log *.out *.toc
+
+# PDFs and PSs are only clean in svn version not in the tarballs
+SVNCLEANFILES = *.pdf *.ps
+clean-local:
+	if test -e $(top_srcdir)/$(CURDIR)/doxygen/Doxydep; then rm -rf $(SVNCLEANFILES) ; fi
 
 # include further rules needed by Dune
 include $(top_srcdir)/am/global-rules
diff --git a/doc/devel/Makefile.am b/doc/devel/Makefile.am
index 0fa0e673a..61e01290a 100644
--- a/doc/devel/Makefile.am
+++ b/doc/devel/Makefile.am
@@ -18,6 +18,9 @@ EXTRA_DIST= $(PAGES)
 
 include $(top_srcdir)/am/webstuff
 
-CLEANFILES = $(PAGES)
+# remove html pages on ``make  clean'' if we are not a tarball
+SVNCLEANFILES = $(PAGES)
+clean-local:
+	if test -e $(top_srcdir)/doc/doxygen/Doxydep; then rm -rf $(SVNCLEANFILES); fi
 
 include $(top_srcdir)/am/global-rules
diff --git a/doc/doxygen/Makefile.am b/doc/doxygen/Makefile.am
index 495da9516..073329882 100644
--- a/doc/doxygen/Makefile.am
+++ b/doc/doxygen/Makefile.am
@@ -15,6 +15,7 @@ all: $(WHAT) $(DOXYGEN_HTML)
 BASEDIR=../..
 CURDIR=doc/doxygen
 EXTRAINSTALL = doxygen.log
+
 # EXTRAINSTALL in the html subdirectory
 DOXYGENINSTALL = *.html *.css *.png *.gif
 
@@ -33,7 +34,7 @@ endif
 
 
 #we need this in the distribution
-EXTRA_DIST = $(WHAT) $(DOXYGEN_DIST) $(DOXYGENHEADER) doxy-footer.html $(PAGES)
+EXTRA_DIST = $(WHAT) html-dist $(DOXYGENHEADER) doxy-footer.html $(PAGES)
 
 doxygendir = $(datadir)/doc/dune-common/doxygen
 doxygen_DATA = $(WHAT)
@@ -99,10 +100,13 @@ FORCE:
 
 include $(top_srcdir)/am/webstuff
 
+# file to clean only in svn and not in tarball tree
+SVNCLEANFILES = html html-dist $(WHAT) $(DOXYGENHEADER)
+
 clean-local:
-	if test -e Doxydep; then rm -rf html html-dist; fi
+	if test -e $(top_srcdir)/doc/doxygen/Doxydep; then rm -rf $(SVNCLEANFILES);fi
 	rm -rf latex *~
 
-CLEANFILES = $(WHAT) $(DOXYGENTAG) $(DOXYGENHEADER)
+CLEANFILES = $(DOXYGENTAG)
 
 include $(top_srcdir)/am/global-rules
-- 
GitLab