* doc/ref_guide/Makefile.am: Rename as...
* doc/ref_guide/ref_guide.mk: ...this.
Adjust.
* doc/doc.mk (doc_dir): New variable.
* doc/Makefile.am: Include doc/ref_guide/ref_guide.mk.
(SUBDIRS): Remove ref_guide.
($(srcdir)/ref_guide/ref_guide.hh): Remove target.
(ref-guide-pdf, ref-guide-html): Remove (phony) targets.
---
milena/ChangeLog | 13 ++++
milena/doc/Makefile.am | 29 ++++------
milena/doc/doc.mk | 10 +++-
milena/doc/ref_guide/{Makefile.am => ref_guide.mk} | 61 +++++++++----------
4 files changed, 62 insertions(+), 51 deletions(-)
rename milena/doc/ref_guide/{Makefile.am => ref_guide.mk} (60%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 9c4f57f..b340b00 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,18 @@
2010-03-02 Roland Levillain <roland(a)lrde.epita.fr>
+ Stop make from recurring in doc/ref_guide.
+
+ * doc/ref_guide/Makefile.am: Rename as...
+ * doc/ref_guide/ref_guide.mk: ...this.
+ Adjust.
+ * doc/doc.mk (doc_dir): New variable.
+ * doc/Makefile.am: Include doc/ref_guide/ref_guide.mk.
+ (SUBDIRS): Remove ref_guide.
+ ($(srcdir)/ref_guide/ref_guide.hh): Remove target.
+ (ref-guide-pdf, ref-guide-html): Remove (phony) targets.
+
+2010-03-02 Roland Levillain <roland(a)lrde.epita.fr>
+
Get rid of Make targets `fake-doc' and `void-doc'.
* doc/Makefile.am,
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index 5d80a1c..e79129a 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -22,14 +22,16 @@ include $(top_srcdir)/milena/doc/doc.mk
SUBDIRS = \
examples \
- ref_guide \
technical \
tutorial \
white_paper
-
DOXYGEN = doxygen
+# Initialiaze variables.
+EXTRA_DIST =
+dist_doc_DATA =
+CLEANFILES =
.PHONY: doc \
@@ -39,7 +41,6 @@ DOXYGEN = doxygen
ref-doc-devel-pdf ref-doc-devel-html \
tutorial-pdf tutorial-html \
white-paper-pdf white-paper-html \
- ref-guide-pdf ref-guide-html \
examples data-regen fig-convert
@@ -58,17 +59,15 @@ doc-devel-html: tutorial-html ref-guide-html white-paper-html \
ref-doc-devel-html
-## ----------------------------------------------------------------- ##
-## Shared dependencies on the products of tutorial/ and ref_guide/. ##
-## ----------------------------------------------------------------- ##
+## -------------------------------------------------- ##
+## Shared dependencies on the products of tutorial/. ##
+## -------------------------------------------------- ##
# FIXME: Maintaining dependencies across directories is too
# complicated. Simplify.
EXTRA_DEPS = $(srcdir)/tutorial/tutorial.hh $(srcdir)/ref_guide/ref_guide.hh
$(srcdir)/tutorial/tutorial.hh: fig-convert
cd tutorial && $(MAKE) $(AM_MAKEFLAGS) tutorial-html
-$(srcdir)/ref_guide/ref_guide.hh: fig-convert
- cd ref_guide && $(MAKE) $(AM_MAKEFLAGS) ref-guide-html
## ----------------------- ##
## Doxygen documentation. ##
@@ -142,14 +141,10 @@ white-paper-html:
## Reference Guide. ##
## ----------------- ##
-ref-guide-pdf: fig-convert
- cd ref_guide && $(MAKE) $(AM_MAKEFLAGS) $@
+include $(srcdir)/ref_guide/ref_guide.mk
-ref-guide-html: fig-convert
- cd ref_guide && $(MAKE) $(AM_MAKEFLAGS) $@
-
-# FIXME: Adresse the construction of examples (see examples/Makefile.am).
+# FIXME: Adress the construction of examples (see examples/Makefile.am).
data-regen:
cd examples && $(MAKE) $(AM_MAKEFLAGS) $@
@@ -160,7 +155,7 @@ fix-refdata:
# Make sure the figures are the first files in EXTRA_DIST.
# Make the 'fake-doc' rule works correctly.
-EXTRA_DIST =
+EXTRA_DIST +=
$(srcdir)/figures/figures.mk: $(srcdir)/headers.stamp
include $(srcdir)/figures/figures.mk
@@ -244,7 +239,7 @@ include $(srcdir)/examples/examples.mk
include $(srcdir)/outputs/outputs.mk
-dist_doc_DATA = $(USER_REFMAN_PDF)
+dist_doc_DATA += $(USER_REFMAN_PDF)
# Installing a directory located in the source dir is not supported by
# Automake by default, so we cannot add `USER_REFMAN_HTML' to
@@ -293,7 +288,7 @@ EXTRA_DIST += \
tools/split_sample.sh \
tools/todoxygen.sh
-CLEANFILES = \
+CLEANFILES += \
Doxyfile_user \
Doxyfile_user_pdf \
Doxyfile_devel \
diff --git a/milena/doc/doc.mk b/milena/doc/doc.mk
index eb9290a..161d893 100644
--- a/milena/doc/doc.mk
+++ b/milena/doc/doc.mk
@@ -1,6 +1,6 @@
-# -*- Automake -*-
+# -*- Automake -*-
-# Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+# Copyright (C) 2008, 2009, 2010 EPITA Research and Development Laboratory
# (LRDE).
#
# This file is part of Olena.
@@ -34,3 +34,9 @@ FIGURES_SRCDIR = $(DOC_SRCDIR)/figures
EXAMPLES_SRCDIR = $(DOC_SRCDIR)/examples
SPLIT_EXAMPLES_SRCDIR = $(EXAMPLES_SRCDIR)/split
IMG_SRCDIR = $(DOC_SRCDIR)/img
+
+# FIXME: Adjust when $(DOC_SRCDIR) is renamed or removed.
+#
+# FIXME: Careful, `doc_dir' is close to `docdir', which is reserved by
+# Automake. Change this name?
+doc_dir = $(DOC_SRCDIR)
diff --git a/milena/doc/ref_guide/Makefile.am b/milena/doc/ref_guide/ref_guide.mk
similarity index 60%
rename from milena/doc/ref_guide/Makefile.am
rename to milena/doc/ref_guide/ref_guide.mk
index fa953e4..1a9ff12 100644
--- a/milena/doc/ref_guide/Makefile.am
+++ b/milena/doc/ref_guide/ref_guide.mk
@@ -1,3 +1,5 @@
+# -*- Automake -*-
+
# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
@@ -15,16 +17,16 @@
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
#
-.PHONY: ref-guide ref-guide-html
-
-include $(top_srcdir)/milena/doc/doc.mk
+.PHONY: ref-guide ref-guide-html ref-guide-pdf
-TEXINPUTS ="$(DOC_SRCDIR):$(OUTPUTS_SRCDIR):\
+ref_guide_TEXINPUTS = "$(DOC_SRCDIR):$(OUTPUTS_SRCDIR):\
$(SPLIT_OUTPUTS_SRCDIR):$(IMG_SRCDIR):$(SPLIT_EXAMPLES_SRCDIR):"
ref-guide: ref-guide-html ref-guide-pdf
+ref_guide_dir = $(doc_dir)/ref_guide
+
# FIXME: As in milena/doc/Makefile.am, we should probably strip
# $(srcdir) prefixes from target variables, e.g. instead of:
#
@@ -52,43 +54,38 @@ ref-guide: ref-guide-html ref-guide-pdf
# Intermediate product for the various doc targets of the parent
# directory.
#
-# This is not a bug: REF_GUIDE_HH is meant to have a `.hh'
-# extension, since it is later parsed by Doxygen, which complains
-# about `.html' files.
-REF_GUIDE_HH = $(srcdir)/ref_guide.hh
+# This is not a bug: REF_GUIDE_HH is meant to have a `.hh' extension,
+# since it is later parsed by Doxygen, which complains about `.html'
+# files.
+REF_GUIDE_HH = $(ref_guide_dir)/ref_guide.hh
ref-guide-html: $(REF_GUIDE_HH)
-$(REF_GUIDE_HH): ref_guide.tex $(srcdir)/../figures.stamp
- $(DOC_SRCDIR)/tools/todoxygen.sh \
- $< $(DOC_SRCDIR)/ref_guide $(DOC_SRCDIR)
+$(REF_GUIDE_HH): $(ref_guide_dir)/ref_guide.tex $(doc_dir)/figures.stamp
+ $(doc_dir)/tools/todoxygen.sh $< $(ref_guide_dir) $(doc_dir)
# Final product.
-REF_GUIDE_PDF = $(srcdir)/ref_guide.pdf
+REF_GUIDE_PDF = $(ref_guide_dir)/ref_guide.pdf
ref-guide-pdf: $(REF_GUIDE_PDF)
-$(REF_GUIDE_PDF): ref_guide.tex $(srcdir)/../figures.stamp
- TEXINPUTS=$(TEXINPUTS) pdflatex $<
- TEXINPUTS=$(TEXINPUTS) pdflatex $<
- TEXINPUTS=$(TEXINPUTS) pdflatex $< \
- test "$(top_srcdir)" == "$(top_builddir)" \
- || mv -f $(builddir)/ref_guide.pdf $(srcdir)
+$(REF_GUIDE_PDF): $(ref_guide_dir)/ref_guide.tex $(doc_dir)/figures.stamp
+ TEXINPUTS=$(ref_guide_TEXINPUTS) pdflatex $<
+ TEXINPUTS=$(ref_guide_TEXINPUTS) pdflatex $<
+ TEXINPUTS=$(ref_guide_TEXINPUTS) pdflatex $< \
+ test x"$(ref_guide_dir)" != x. \
+ && mv -f ref_guide.pdf $(ref_guide_dir)
-# FIXME: Regenerating figures.stamp requires make to go back to the
-# parent directory. We already do the opposite (descending from
-# milena/doc/ to milena/doc/tutorial/Makefile in milena/doc/ to update
-# tutorial.hh). This is not sound. We probably want to put together
-# somes of these files, and maybe get rid of some directories, or at
-# least move most of the Makefile machinery into
-# milena/doc/Makefile.am.
-$(srcdir)/../figures.stamp:
- cd .. && $(MAKE) $(AM_MAKEFLAGS) fig-convert
+dist_doc_DATA += $(REF_GUIDE_PDF)
-dist_doc_DATA = $(REF_GUIDE_PDF)
-
-EXTRA_DIST = \
- ref_guide.tex \
+EXTRA_DIST += \
+ $(ref_guide_dir)/ref_guide.tex \
$(REF_GUIDE_HH)
-CLEANFILES = \
+# FIXME: Remove `ref_guide.aux ref_guide.toc ref_guide.log
+# ref_guide.bbl ref_guide.out *blg *.lot' when texi2dvi is used.
+#
+# FIXME: Why is $(REF_GUIDE_PDF) listed here? It should be
+# automatically cleaned. I'm not sure either about the rest of
+# CLEANFILES.
+CLEANFILES += \
ref_guide.aux ref_guide.toc ref_guide.log ref_guide.bbl ref_guide.out \
*blg *.lot \
$(REF_GUIDE_PDF) \
--
1.5.6.5