OSDN Git Service

don't create docs when target is all
[ccunit/ccunit.git] / doc / Makefile.am
index 8ec4846..d8bfb15 100644 (file)
@@ -1,70 +1,55 @@
-EXTRA_DIST = $(doxygen_input) $(static_pages)
+EXTRA_DIST = $(doxygen_input) $(static_pages) $(DOXYSRCS)
 
+DOXYGEN=@DOXYGEN@
 doxygen_input = header.html footer.html
-#static_pages = FAQ
-static_pages =
-
-# DOC is defined if installer requests doc generation.
-# For now, we only install HTML documentation.  We could install manpages
-# using the following
-#   man_MANS = man/man3/CppUnit.3
-#   man/man3/CppUnit.3: dox
-# and an extra copy or two in the install-data-hook.  
-# However, the manpages do not appear to be tremendously useful, so
-# let's not bother.
+static_pages = FAQ
+DOXYSRCS=mainpage.dox cookbook.dox
+
+CCUNITSRCS=$(top_srcdir)/src/ccunit/*.[ch] $(top_srcdir)/src/tools/*.c
 
 if DOC
 
 htmldir = $(pkgdatadir)/html
-html_DATA = $(static_pages) html/index.html
-
-man_MANS = man/man3/CCUnit.3
-man/man3/CCUnit.3: dox
 
 install-data-hook:
-       cp -dpR html/* $(DESTDIR)$(htmldir)
+       -test -d html && cp -p $(static_pages) html
+       -test -d html && cp -dpR html/* $(DESTDIR)$(htmldir) 
 
-# Automake's "distcheck" is sensitive to having files left over
-# after "make uninstall", so we have to clean up the install hook.
 uninstall-local:
-       rm -rf $(DESTDIR)$(htmldir)
+       $(RM) -rf $(DESTDIR)$(htmldir)
 
-dox: html/index.html
+docs: $(static_pages) html/index.html
 
-else
+doc-dist-hook:
+       cp -p $(static_pages) $(distdir)/html
 
-# We repeat the three targets in both the "if" and "else" clauses
-# of the conditional, because the generated makefile will contain
-# references to the targets (target "install" depends on target
-# "install-datahook", for example), and some make programs get upset
-# if no target exists.
+else
 
 install-data-hook:
 uninstall-local:
-dox:
+docs:
 
 endif
 
 
-all-local: dox
+CMNTST=<span class="comment">/
+CMNTED=/</span>
 
-
-html/index.html: Doxyfile $(doxygen_input)
-       @DOXYGEN@
-
-
-# Make tarfile to distribute the HTML documentation.
-doc-dist: dox
-       cp $(static_pages) html
-       tar -czf $(PACKAGE)-docs-$(VERSION).tar.gz -C html .
+html/index.html: Doxyfile $(doxygen_input) $(CCUNITSRCS) $(DOXYSRCS)
+       $(DOXYGEN)
+       sed -e 's!\($(CMNTST)\)/\(\*.*\*\)\\\($(CMNTED)\)!\1\2\3!g' \
+               html/cookbook.html > cookbook-cmntfix.html
+       mv cookbook-cmntfix.html html/cookbook.html
 
 pdf: @PACKAGE@.pdf
 @PACKAGE@.pdf:
        $(MAKE) -C ./latex pdf
-       ln -s ./latex/refman.ps  @PACKAGE@.ps
-       ln -s ./latex/refman.pdf @PACKAGE@.pdf
+       $(LN_S) ./latex/refman.ps @PACKAGE@.ps
+       $(LN_S) ./latex/refman.pdf @PACKAGE@.pdf
 
 
 clean-local:
        $(RM) -r latex
        $(RM) -r html man @PACKAGE@.ps @PACKAGE@.pdf
+
+CLEANFILES=*~ .*~ ./\#*\# *.log