melunko@249: # Copyright (C) 2004 Oren Ben-Kiki melunko@249: # This file is distributed under the same terms as the Automake macro files. melunko@249: melunko@249: # Generate automatic documentation using Doxygen. Goals and variables values melunko@249: # are controlled by the various DX_COND_??? conditionals set by autoconf. melunko@249: # melunko@249: # The provided goals are: melunko@249: # doxygen-doc: Generate all doxygen documentation. melunko@249: # doxygen-run: Run doxygen, which will generate some of the documentation melunko@249: # (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post melunko@249: # processing required for the rest of it (PS, PDF, and some MAN). melunko@249: # doxygen-man: Rename some doxygen generated man pages. melunko@249: # doxygen-ps: Generate doxygen PostScript documentation. melunko@249: # doxygen-pdf: Generate doxygen PDF documentation. melunko@249: # melunko@249: # Note that by default these are not integrated into the automake goals. If melunko@249: # doxygen is used to generate man pages, you can achieve this integration by melunko@249: # setting man3_MANS to the list of man pages generated and then adding the melunko@249: # dependency: melunko@249: # melunko@249: # $(man3_MANS): doxygen-doc melunko@249: # melunko@249: # This will cause make to run doxygen and generate all the documentation. melunko@249: # melunko@249: # The following variable is intended for use in Makefile.am: melunko@249: # melunko@249: # DX_CLEANFILES = everything to clean. melunko@249: # melunko@249: # This is usually added to MOSTLYCLEANFILES. melunko@249: melunko@249: ## --------------------------------- ## melunko@249: ## Format-independent Doxygen rules. ## melunko@249: ## --------------------------------- ## melunko@249: melunko@249: if DX_COND_doc melunko@249: melunko@249: ## ------------------------------- ## melunko@249: ## Rules specific for HTML output. ## melunko@249: ## ------------------------------- ## melunko@249: melunko@249: if DX_COND_html melunko@249: melunko@249: DX_CLEAN_HTML = @DX_DOCDIR@/html melunko@249: melunko@249: endif DX_COND_html melunko@249: melunko@249: ## ------------------------------ ## melunko@249: ## Rules specific for CHM output. ## melunko@249: ## ------------------------------ ## melunko@249: melunko@249: if DX_COND_chm melunko@249: melunko@249: DX_CLEAN_CHM = @DX_DOCDIR@/chm melunko@249: melunko@249: if DX_COND_chi melunko@249: melunko@249: DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi melunko@249: melunko@249: endif DX_COND_chi melunko@249: melunko@249: endif DX_COND_chm melunko@249: melunko@249: ## ------------------------------ ## melunko@249: ## Rules specific for MAN output. ## melunko@249: ## ------------------------------ ## melunko@249: melunko@249: if DX_COND_man melunko@249: melunko@249: DX_CLEAN_MAN = @DX_DOCDIR@/man melunko@249: melunko@249: endif DX_COND_man melunko@249: melunko@249: ## ------------------------------ ## melunko@249: ## Rules specific for RTF output. ## melunko@249: ## ------------------------------ ## melunko@249: melunko@249: if DX_COND_rtf melunko@249: melunko@249: DX_CLEAN_RTF = @DX_DOCDIR@/rtf melunko@249: melunko@249: endif DX_COND_rtf melunko@249: melunko@249: ## ------------------------------ ## melunko@249: ## Rules specific for XML output. ## melunko@249: ## ------------------------------ ## melunko@249: melunko@249: if DX_COND_xml melunko@249: melunko@249: DX_CLEAN_XML = @DX_DOCDIR@/xml melunko@249: melunko@249: endif DX_COND_xml melunko@249: melunko@249: ## ----------------------------- ## melunko@249: ## Rules specific for PS output. ## melunko@249: ## ----------------------------- ## melunko@249: melunko@249: if DX_COND_ps melunko@249: melunko@249: DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps melunko@249: melunko@249: DX_PS_GOAL = doxygen-ps melunko@249: melunko@249: doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps melunko@249: melunko@249: @DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag melunko@249: cd @DX_DOCDIR@/latex; \ melunko@249: rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ melunko@249: $(DX_LATEX) refman.tex; \ melunko@249: $(MAKEINDEX_PATH) refman.idx; \ melunko@249: $(DX_LATEX) refman.tex; \ melunko@249: countdown=5; \ melunko@249: while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ melunko@249: refman.log > /dev/null 2>&1 \ melunko@249: && test $$countdown -gt 0; do \ melunko@249: $(DX_LATEX) refman.tex; \ melunko@249: countdown=`expr $$countdown - 1`; \ melunko@249: done; \ melunko@249: $(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi melunko@249: melunko@249: endif DX_COND_ps melunko@249: melunko@249: ## ------------------------------ ## melunko@249: ## Rules specific for PDF output. ## melunko@249: ## ------------------------------ ## melunko@249: melunko@249: if DX_COND_pdf melunko@249: melunko@249: DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf melunko@249: melunko@249: DX_PDF_GOAL = doxygen-pdf melunko@249: melunko@249: doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf melunko@249: melunko@249: @DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag melunko@249: cd @DX_DOCDIR@/latex; \ melunko@249: rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \ melunko@249: $(DX_PDFLATEX) refman.tex; \ melunko@249: $(DX_MAKEINDEX) refman.idx; \ melunko@249: $(DX_PDFLATEX) refman.tex; \ melunko@249: countdown=5; \ melunko@249: while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \ melunko@249: refman.log > /dev/null 2>&1 \ melunko@249: && test $$countdown -gt 0; do \ melunko@249: $(DX_PDFLATEX) refman.tex; \ melunko@249: countdown=`expr $$countdown - 1`; \ melunko@249: done; \ melunko@249: mv refman.pdf ../@PACKAGE@.pdf melunko@249: melunko@249: endif DX_COND_pdf melunko@249: melunko@249: ## ------------------------------------------------- ## melunko@249: ## Rules specific for LaTeX (shared for PS and PDF). ## melunko@249: ## ------------------------------------------------- ## melunko@249: melunko@249: if DX_COND_latex melunko@249: melunko@249: DX_CLEAN_LATEX = @DX_DOCDIR@/latex melunko@249: melunko@249: endif DX_COND_latex melunko@249: melunko@249: .PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL) melunko@249: melunko@249: .INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) melunko@249: melunko@249: doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag melunko@249: melunko@249: doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL) melunko@249: melunko@249: @DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS) melunko@249: rm -rf @DX_DOCDIR@ melunko@249: $(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG) melunko@249: melunko@249: DX_CLEANFILES = \ melunko@249: @DX_DOCDIR@/@PACKAGE@.tag \ melunko@249: -r \ melunko@249: $(DX_CLEAN_HTML) \ melunko@249: $(DX_CLEAN_CHM) \ melunko@249: $(DX_CLEAN_CHI) \ melunko@249: $(DX_CLEAN_MAN) \ melunko@249: $(DX_CLEAN_RTF) \ melunko@249: $(DX_CLEAN_XML) \ melunko@249: $(DX_CLEAN_PS) \ melunko@249: $(DX_CLEAN_PDF) \ melunko@249: $(DX_CLEAN_LATEX) melunko@249: melunko@249: endif DX_COND_doc