ax_prog_doxygen.m4 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_prog_doxygen.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # DX_INIT_DOXYGEN(PROJECT-NAME, [DOXYFILE-PATH], [OUTPUT-DIR], ...)
  8. # DX_DOXYGEN_FEATURE(ON|OFF)
  9. # DX_DOT_FEATURE(ON|OFF)
  10. # DX_HTML_FEATURE(ON|OFF)
  11. # DX_CHM_FEATURE(ON|OFF)
  12. # DX_CHI_FEATURE(ON|OFF)
  13. # DX_MAN_FEATURE(ON|OFF)
  14. # DX_RTF_FEATURE(ON|OFF)
  15. # DX_XML_FEATURE(ON|OFF)
  16. # DX_PDF_FEATURE(ON|OFF)
  17. # DX_PS_FEATURE(ON|OFF)
  18. #
  19. # DESCRIPTION
  20. #
  21. # The DX_*_FEATURE macros control the default setting for the given
  22. # Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for
  23. # generating graphics, 'HTML' for plain HTML, 'CHM' for compressed HTML
  24. # help (for MS users), 'CHI' for generating a separate .chi file by the
  25. # .chm file, and 'MAN', 'RTF', 'XML', 'PDF' and 'PS' for the appropriate
  26. # output formats. The environment variable DOXYGEN_PAPER_SIZE may be
  27. # specified to override the default 'a4wide' paper size.
  28. #
  29. # By default, HTML, PDF and PS documentation is generated as this seems to
  30. # be the most popular and portable combination. MAN pages created by
  31. # Doxygen are usually problematic, though by picking an appropriate subset
  32. # and doing some massaging they might be better than nothing. CHM and RTF
  33. # are specific for MS (note that you can't generate both HTML and CHM at
  34. # the same time). The XML is rather useless unless you apply specialized
  35. # post-processing to it.
  36. #
  37. # The macros mainly control the default state of the feature. The use can
  38. # override the default by specifying --enable or --disable. The macros
  39. # ensure that contradictory flags are not given (e.g.,
  40. # --enable-doxygen-html and --enable-doxygen-chm,
  41. # --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each
  42. # feature will be automatically disabled (with a warning) if the required
  43. # programs are missing.
  44. #
  45. # Once all the feature defaults have been specified, call DX_INIT_DOXYGEN
  46. # with the following parameters: a one-word name for the project for use
  47. # as a filename base etc., an optional configuration file name (the
  48. # default is '$(srcdir)/Doxyfile', the same as Doxygen's default), and an
  49. # optional output directory name (the default is 'doxygen-doc'). To run
  50. # doxygen multiple times for different configuration files and output
  51. # directories provide more parameters: the second, forth, sixth, etc
  52. # parameter are configuration file names and the third, fifth, seventh,
  53. # etc parameter are output directories. No checking is done to catch
  54. # duplicates.
  55. #
  56. # Automake Support
  57. #
  58. # The DX_RULES substitution can be used to add all needed rules to the
  59. # Makefile. Note that this is a substitution without being a variable:
  60. # only the @DX_RULES@ syntax will work.
  61. #
  62. # The provided targets are:
  63. #
  64. # doxygen-doc: Generate all doxygen documentation.
  65. #
  66. # doxygen-run: Run doxygen, which will generate some of the
  67. # documentation (HTML, CHM, CHI, MAN, RTF, XML)
  68. # but will not do the post processing required
  69. # for the rest of it (PS, PDF).
  70. #
  71. # doxygen-ps: Generate doxygen PostScript documentation.
  72. #
  73. # doxygen-pdf: Generate doxygen PDF documentation.
  74. #
  75. # Note that by default these are not integrated into the automake targets.
  76. # If doxygen is used to generate man pages, you can achieve this
  77. # integration by setting man3_MANS to the list of man pages generated and
  78. # then adding the dependency:
  79. #
  80. # $(man3_MANS): doxygen-doc
  81. #
  82. # This will cause make to run doxygen and generate all the documentation.
  83. #
  84. # The following variable is intended for use in Makefile.am:
  85. #
  86. # DX_CLEANFILES = everything to clean.
  87. #
  88. # Then add this variable to MOSTLYCLEANFILES.
  89. #
  90. # LICENSE
  91. #
  92. # Copyright (c) 2009 Oren Ben-Kiki <oren@ben-kiki.org>
  93. # Copyright (c) 2015 Olaf Mandel <olaf@mandel.name>
  94. #
  95. # Copying and distribution of this file, with or without modification, are
  96. # permitted in any medium without royalty provided the copyright notice
  97. # and this notice are preserved. This file is offered as-is, without any
  98. # warranty.
  99. #serial 24
  100. ## ----------##
  101. ## Defaults. ##
  102. ## ----------##
  103. DX_ENV=""
  104. AC_DEFUN([DX_FEATURE_doc], ON)
  105. AC_DEFUN([DX_FEATURE_dot], OFF)
  106. AC_DEFUN([DX_FEATURE_man], OFF)
  107. AC_DEFUN([DX_FEATURE_html], ON)
  108. AC_DEFUN([DX_FEATURE_chm], OFF)
  109. AC_DEFUN([DX_FEATURE_chi], OFF)
  110. AC_DEFUN([DX_FEATURE_rtf], OFF)
  111. AC_DEFUN([DX_FEATURE_xml], OFF)
  112. AC_DEFUN([DX_FEATURE_pdf], ON)
  113. AC_DEFUN([DX_FEATURE_ps], ON)
  114. ## --------------- ##
  115. ## Private macros. ##
  116. ## --------------- ##
  117. # DX_ENV_APPEND(VARIABLE, VALUE)
  118. # ------------------------------
  119. # Append VARIABLE="VALUE" to DX_ENV for invoking doxygen and add it
  120. # as a substitution (but not a Makefile variable). The substitution
  121. # is skipped if the variable name is VERSION.
  122. AC_DEFUN([DX_ENV_APPEND],
  123. [AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])dnl
  124. m4_if([$1], [VERSION], [], [AC_SUBST([$1], [$2])dnl
  125. AM_SUBST_NOTMAKE([$1])])dnl
  126. ])
  127. # DX_DIRNAME_EXPR
  128. # ---------------
  129. # Expand into a shell expression prints the directory part of a path.
  130. AC_DEFUN([DX_DIRNAME_EXPR],
  131. [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']])
  132. # DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF)
  133. # -------------------------------------
  134. # Expands according to the M4 (static) status of the feature.
  135. AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])])
  136. # DX_REQUIRE_PROG(VARIABLE, PROGRAM)
  137. # ----------------------------------
  138. # Require the specified program to be found for the DX_CURRENT_FEATURE to work.
  139. AC_DEFUN([DX_REQUIRE_PROG], [
  140. AC_PATH_TOOL([$1], [$2])
  141. if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then
  142. AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION])
  143. AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0)
  144. fi
  145. ])
  146. # DX_TEST_FEATURE(FEATURE)
  147. # ------------------------
  148. # Expand to a shell expression testing whether the feature is active.
  149. AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1])
  150. # DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE)
  151. # -------------------------------------------------
  152. # Verify that a required features has the right state before trying to turn on
  153. # the DX_CURRENT_FEATURE.
  154. AC_DEFUN([DX_CHECK_DEPEND], [
  155. test "$DX_FLAG_$1" = "$2" \
  156. || AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1,
  157. requires, contradicts) doxygen-$1])
  158. ])
  159. # DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE)
  160. # ----------------------------------------------------------
  161. # Turn off the DX_CURRENT_FEATURE if the required feature is off.
  162. AC_DEFUN([DX_CLEAR_DEPEND], [
  163. test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0)
  164. ])
  165. # DX_FEATURE_ARG(FEATURE, DESCRIPTION,
  166. # CHECK_DEPEND, CLEAR_DEPEND,
  167. # REQUIRE, DO-IF-ON, DO-IF-OFF)
  168. # --------------------------------------------
  169. # Parse the command-line option controlling a feature. CHECK_DEPEND is called
  170. # if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND),
  171. # otherwise CLEAR_DEPEND is called to turn off the default state if a required
  172. # feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional
  173. # requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and
  174. # DO-IF-ON or DO-IF-OFF are called according to the final state of the feature.
  175. AC_DEFUN([DX_ARG_ABLE], [
  176. AC_DEFUN([DX_CURRENT_FEATURE], [$1])
  177. AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2])
  178. AC_ARG_ENABLE(doxygen-$1,
  179. [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1],
  180. [--enable-doxygen-$1]),
  181. DX_IF_FEATURE([$1], [don't $2], [$2]))],
  182. [
  183. case "$enableval" in
  184. #(
  185. y|Y|yes|Yes|YES)
  186. AC_SUBST([DX_FLAG_$1], 1)
  187. $3
  188. ;; #(
  189. n|N|no|No|NO)
  190. AC_SUBST([DX_FLAG_$1], 0)
  191. ;; #(
  192. *)
  193. AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1])
  194. ;;
  195. esac
  196. ], [
  197. AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)])
  198. $4
  199. ])
  200. if DX_TEST_FEATURE([$1]); then
  201. $5
  202. :
  203. fi
  204. if DX_TEST_FEATURE([$1]); then
  205. $6
  206. :
  207. else
  208. $7
  209. :
  210. fi
  211. ])
  212. ## -------------- ##
  213. ## Public macros. ##
  214. ## -------------- ##
  215. # DX_XXX_FEATURE(DEFAULT_STATE)
  216. # -----------------------------
  217. AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])])
  218. AC_DEFUN([DX_DOT_FEATURE], [AC_DEFUN([DX_FEATURE_dot], [$1])])
  219. AC_DEFUN([DX_MAN_FEATURE], [AC_DEFUN([DX_FEATURE_man], [$1])])
  220. AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])])
  221. AC_DEFUN([DX_CHM_FEATURE], [AC_DEFUN([DX_FEATURE_chm], [$1])])
  222. AC_DEFUN([DX_CHI_FEATURE], [AC_DEFUN([DX_FEATURE_chi], [$1])])
  223. AC_DEFUN([DX_RTF_FEATURE], [AC_DEFUN([DX_FEATURE_rtf], [$1])])
  224. AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
  225. AC_DEFUN([DX_XML_FEATURE], [AC_DEFUN([DX_FEATURE_xml], [$1])])
  226. AC_DEFUN([DX_PDF_FEATURE], [AC_DEFUN([DX_FEATURE_pdf], [$1])])
  227. AC_DEFUN([DX_PS_FEATURE], [AC_DEFUN([DX_FEATURE_ps], [$1])])
  228. # DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR], ...)
  229. # --------------------------------------------------------------
  230. # PROJECT also serves as the base name for the documentation files.
  231. # The default CONFIG-FILE is "$(srcdir)/Doxyfile" and OUTPUT-DOC-DIR is
  232. # "doxygen-doc".
  233. # More arguments are interpreted as interleaved CONFIG-FILE and
  234. # OUTPUT-DOC-DIR values.
  235. AC_DEFUN([DX_INIT_DOXYGEN], [
  236. # Files:
  237. AC_SUBST([DX_PROJECT], [$1])
  238. AC_SUBST([DX_CONFIG], ['ifelse([$2], [], [$(srcdir)/Doxyfile], [$2])'])
  239. AC_SUBST([DX_DOCDIR], ['ifelse([$3], [], [doxygen-doc], [$3])'])
  240. m4_if(m4_eval(3 < m4_count($@)), 1, [m4_for([DX_i], 4, m4_count($@), 2,
  241. [AC_SUBST([DX_CONFIG]m4_eval(DX_i[/2]),
  242. 'm4_default_nblank_quoted(m4_argn(DX_i, $@),
  243. [$(srcdir)/Doxyfile])')])])dnl
  244. m4_if(m4_eval(3 < m4_count($@)), 1, [m4_for([DX_i], 5, m4_count($@,), 2,
  245. [AC_SUBST([DX_DOCDIR]m4_eval([(]DX_i[-1)/2]),
  246. 'm4_default_nblank_quoted(m4_argn(DX_i, $@),
  247. [doxygen-doc])')])])dnl
  248. m4_define([DX_loop], m4_dquote(m4_if(m4_eval(3 < m4_count($@)), 1,
  249. [m4_for([DX_i], 4, m4_count($@), 2, [, m4_eval(DX_i[/2])])],
  250. [])))dnl
  251. # Environment variables used inside doxygen.cfg:
  252. DX_ENV_APPEND(SRCDIR, $srcdir)
  253. DX_ENV_APPEND(PROJECT, $DX_PROJECT)
  254. DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
  255. # Doxygen itself:
  256. DX_ARG_ABLE(doc, [generate any doxygen documentation],
  257. [],
  258. [],
  259. [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen)
  260. DX_REQUIRE_PROG([DX_PERL], perl)],
  261. [DX_ENV_APPEND(PERL_PATH, $DX_PERL)])
  262. # Dot for graphics:
  263. DX_ARG_ABLE(dot, [generate graphics for doxygen documentation],
  264. [DX_CHECK_DEPEND(doc, 1)],
  265. [DX_CLEAR_DEPEND(doc, 1)],
  266. [DX_REQUIRE_PROG([DX_DOT], dot)],
  267. [DX_ENV_APPEND(HAVE_DOT, YES)
  268. DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])],
  269. [DX_ENV_APPEND(HAVE_DOT, NO)])
  270. # Man pages generation:
  271. DX_ARG_ABLE(man, [generate doxygen manual pages],
  272. [DX_CHECK_DEPEND(doc, 1)],
  273. [DX_CLEAR_DEPEND(doc, 1)],
  274. [],
  275. [DX_ENV_APPEND(GENERATE_MAN, YES)],
  276. [DX_ENV_APPEND(GENERATE_MAN, NO)])
  277. # RTF file generation:
  278. DX_ARG_ABLE(rtf, [generate doxygen RTF documentation],
  279. [DX_CHECK_DEPEND(doc, 1)],
  280. [DX_CLEAR_DEPEND(doc, 1)],
  281. [],
  282. [DX_ENV_APPEND(GENERATE_RTF, YES)],
  283. [DX_ENV_APPEND(GENERATE_RTF, NO)])
  284. # XML file generation:
  285. DX_ARG_ABLE(xml, [generate doxygen XML documentation],
  286. [DX_CHECK_DEPEND(doc, 1)],
  287. [DX_CLEAR_DEPEND(doc, 1)],
  288. [],
  289. [DX_ENV_APPEND(GENERATE_XML, YES)],
  290. [DX_ENV_APPEND(GENERATE_XML, NO)])
  291. # (Compressed) HTML help generation:
  292. DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation],
  293. [DX_CHECK_DEPEND(doc, 1)],
  294. [DX_CLEAR_DEPEND(doc, 1)],
  295. [DX_REQUIRE_PROG([DX_HHC], hhc)],
  296. [DX_ENV_APPEND(HHC_PATH, $DX_HHC)
  297. DX_ENV_APPEND(GENERATE_HTML, YES)
  298. DX_ENV_APPEND(GENERATE_HTMLHELP, YES)],
  299. [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)])
  300. # Separate CHI file generation.
  301. DX_ARG_ABLE(chi, [generate doxygen separate compressed HTML help index file],
  302. [DX_CHECK_DEPEND(chm, 1)],
  303. [DX_CLEAR_DEPEND(chm, 1)],
  304. [],
  305. [DX_ENV_APPEND(GENERATE_CHI, YES)],
  306. [DX_ENV_APPEND(GENERATE_CHI, NO)])
  307. # Plain HTML pages generation:
  308. DX_ARG_ABLE(html, [generate doxygen plain HTML documentation],
  309. [DX_CHECK_DEPEND(doc, 1) DX_CHECK_DEPEND(chm, 0)],
  310. [DX_CLEAR_DEPEND(doc, 1) DX_CLEAR_DEPEND(chm, 0)],
  311. [],
  312. [DX_ENV_APPEND(GENERATE_HTML, YES)],
  313. [DX_TEST_FEATURE(chm) || DX_ENV_APPEND(GENERATE_HTML, NO)])
  314. # PostScript file generation:
  315. DX_ARG_ABLE(ps, [generate doxygen PostScript documentation],
  316. [DX_CHECK_DEPEND(doc, 1)],
  317. [DX_CLEAR_DEPEND(doc, 1)],
  318. [DX_REQUIRE_PROG([DX_LATEX], latex)
  319. DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
  320. DX_REQUIRE_PROG([DX_DVIPS], dvips)
  321. DX_REQUIRE_PROG([DX_EGREP], egrep)])
  322. # PDF file generation:
  323. DX_ARG_ABLE(pdf, [generate doxygen PDF documentation],
  324. [DX_CHECK_DEPEND(doc, 1)],
  325. [DX_CLEAR_DEPEND(doc, 1)],
  326. [DX_REQUIRE_PROG([DX_PDFLATEX], pdflatex)
  327. DX_REQUIRE_PROG([DX_MAKEINDEX], makeindex)
  328. DX_REQUIRE_PROG([DX_EGREP], egrep)])
  329. # LaTeX generation for PS and/or PDF:
  330. if DX_TEST_FEATURE(ps) || DX_TEST_FEATURE(pdf); then
  331. DX_ENV_APPEND(GENERATE_LATEX, YES)
  332. else
  333. DX_ENV_APPEND(GENERATE_LATEX, NO)
  334. fi
  335. # Paper size for PS and/or PDF:
  336. AC_ARG_VAR(DOXYGEN_PAPER_SIZE,
  337. [a4wide (default), a4, letter, legal or executive])
  338. case "$DOXYGEN_PAPER_SIZE" in
  339. #(
  340. "")
  341. AC_SUBST(DOXYGEN_PAPER_SIZE, "")
  342. ;; #(
  343. a4wide|a4|letter|legal|executive)
  344. DX_ENV_APPEND(PAPER_SIZE, $DOXYGEN_PAPER_SIZE)
  345. ;; #(
  346. *)
  347. AC_MSG_ERROR([unknown DOXYGEN_PAPER_SIZE='$DOXYGEN_PAPER_SIZE'])
  348. ;;
  349. esac
  350. # Rules:
  351. AS_IF([[test $DX_FLAG_html -eq 1]],
  352. [[DX_SNIPPET_html="## ------------------------------- ##
  353. ## Rules specific for HTML output. ##
  354. ## ------------------------------- ##
  355. DX_CLEAN_HTML = \$(DX_DOCDIR)/html]dnl
  356. m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\
  357. \$(DX_DOCDIR]DX_i[)/html]])[
  358. "]],
  359. [[DX_SNIPPET_html=""]])
  360. AS_IF([[test $DX_FLAG_chi -eq 1]],
  361. [[DX_SNIPPET_chi="
  362. DX_CLEAN_CHI = \$(DX_DOCDIR)/\$(PACKAGE).chi]dnl
  363. m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\
  364. \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).chi]])["]],
  365. [[DX_SNIPPET_chi=""]])
  366. AS_IF([[test $DX_FLAG_chm -eq 1]],
  367. [[DX_SNIPPET_chm="## ------------------------------ ##
  368. ## Rules specific for CHM output. ##
  369. ## ------------------------------ ##
  370. DX_CLEAN_CHM = \$(DX_DOCDIR)/chm]dnl
  371. m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\
  372. \$(DX_DOCDIR]DX_i[)/chm]])[\
  373. ${DX_SNIPPET_chi}
  374. "]],
  375. [[DX_SNIPPET_chm=""]])
  376. AS_IF([[test $DX_FLAG_man -eq 1]],
  377. [[DX_SNIPPET_man="## ------------------------------ ##
  378. ## Rules specific for MAN output. ##
  379. ## ------------------------------ ##
  380. DX_CLEAN_MAN = \$(DX_DOCDIR)/man]dnl
  381. m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\
  382. \$(DX_DOCDIR]DX_i[)/man]])[
  383. "]],
  384. [[DX_SNIPPET_man=""]])
  385. AS_IF([[test $DX_FLAG_rtf -eq 1]],
  386. [[DX_SNIPPET_rtf="## ------------------------------ ##
  387. ## Rules specific for RTF output. ##
  388. ## ------------------------------ ##
  389. DX_CLEAN_RTF = \$(DX_DOCDIR)/rtf]dnl
  390. m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\
  391. \$(DX_DOCDIR]DX_i[)/rtf]])[
  392. "]],
  393. [[DX_SNIPPET_rtf=""]])
  394. AS_IF([[test $DX_FLAG_xml -eq 1]],
  395. [[DX_SNIPPET_xml="## ------------------------------ ##
  396. ## Rules specific for XML output. ##
  397. ## ------------------------------ ##
  398. DX_CLEAN_XML = \$(DX_DOCDIR)/xml]dnl
  399. m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\
  400. \$(DX_DOCDIR]DX_i[)/xml]])[
  401. "]],
  402. [[DX_SNIPPET_xml=""]])
  403. AS_IF([[test $DX_FLAG_ps -eq 1]],
  404. [[DX_SNIPPET_ps="## ----------------------------- ##
  405. ## Rules specific for PS output. ##
  406. ## ----------------------------- ##
  407. DX_CLEAN_PS = \$(DX_DOCDIR)/\$(PACKAGE).ps]dnl
  408. m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\
  409. \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).ps]])[
  410. DX_PS_GOAL = doxygen-ps
  411. doxygen-ps: \$(DX_CLEAN_PS)
  412. ]m4_foreach([DX_i], [DX_loop],
  413. [[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).ps: \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag
  414. \$(DX_V_LATEX)cd \$(DX_DOCDIR]DX_i[)/latex; \\
  415. rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\
  416. \$(DX_LATEX) refman.tex; \\
  417. \$(DX_MAKEINDEX) refman.idx; \\
  418. \$(DX_LATEX) refman.tex; \\
  419. countdown=5; \\
  420. while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\
  421. refman.log > /dev/null 2>&1 \\
  422. && test \$\$countdown -gt 0; do \\
  423. \$(DX_LATEX) refman.tex; \\
  424. countdown=\`expr \$\$countdown - 1\`; \\
  425. done; \\
  426. \$(DX_DVIPS) -o ../\$(PACKAGE).ps refman.dvi
  427. ]])["]],
  428. [[DX_SNIPPET_ps=""]])
  429. AS_IF([[test $DX_FLAG_pdf -eq 1]],
  430. [[DX_SNIPPET_pdf="## ------------------------------ ##
  431. ## Rules specific for PDF output. ##
  432. ## ------------------------------ ##
  433. DX_CLEAN_PDF = \$(DX_DOCDIR)/\$(PACKAGE).pdf]dnl
  434. m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\
  435. \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).pdf]])[
  436. DX_PDF_GOAL = doxygen-pdf
  437. doxygen-pdf: \$(DX_CLEAN_PDF)
  438. ]m4_foreach([DX_i], [DX_loop],
  439. [[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).pdf: \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag
  440. \$(DX_V_LATEX)cd \$(DX_DOCDIR]DX_i[)/latex; \\
  441. rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \\
  442. \$(DX_PDFLATEX) refman.tex; \\
  443. \$(DX_MAKEINDEX) refman.idx; \\
  444. \$(DX_PDFLATEX) refman.tex; \\
  445. countdown=5; \\
  446. while \$(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \\
  447. refman.log > /dev/null 2>&1 \\
  448. && test \$\$countdown -gt 0; do \\
  449. \$(DX_PDFLATEX) refman.tex; \\
  450. countdown=\`expr \$\$countdown - 1\`; \\
  451. done; \\
  452. mv refman.pdf ../\$(PACKAGE).pdf
  453. ]])["]],
  454. [[DX_SNIPPET_pdf=""]])
  455. AS_IF([[test $DX_FLAG_ps -eq 1 -o $DX_FLAG_pdf -eq 1]],
  456. [[DX_SNIPPET_latex="## ------------------------------------------------- ##
  457. ## Rules specific for LaTeX (shared for PS and PDF). ##
  458. ## ------------------------------------------------- ##
  459. DX_V_LATEX = \$(_DX_v_LATEX_\$(V))
  460. _DX_v_LATEX_ = \$(_DX_v_LATEX_\$(AM_DEFAULT_VERBOSITY))
  461. _DX_v_LATEX_0 = @echo \" LATEX \" \$][@;
  462. DX_CLEAN_LATEX = \$(DX_DOCDIR)/latex]dnl
  463. m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\
  464. \$(DX_DOCDIR]DX_i[)/latex]])[
  465. "]],
  466. [[DX_SNIPPET_latex=""]])
  467. AS_IF([[test $DX_FLAG_doc -eq 1]],
  468. [[DX_SNIPPET_doc="## --------------------------------- ##
  469. ## Format-independent Doxygen rules. ##
  470. ## --------------------------------- ##
  471. ${DX_SNIPPET_html}\
  472. ${DX_SNIPPET_chm}\
  473. ${DX_SNIPPET_man}\
  474. ${DX_SNIPPET_rtf}\
  475. ${DX_SNIPPET_xml}\
  476. ${DX_SNIPPET_ps}\
  477. ${DX_SNIPPET_pdf}\
  478. ${DX_SNIPPET_latex}\
  479. DX_V_DXGEN = \$(_DX_v_DXGEN_\$(V))
  480. _DX_v_DXGEN_ = \$(_DX_v_DXGEN_\$(AM_DEFAULT_VERBOSITY))
  481. _DX_v_DXGEN_0 = @echo \" DXGEN \" \$<;
  482. .PHONY: doxygen-run doxygen-doc \$(DX_PS_GOAL) \$(DX_PDF_GOAL)
  483. .INTERMEDIATE: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL)
  484. doxygen-run:]m4_foreach([DX_i], [DX_loop],
  485. [[ \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag]])[
  486. doxygen-doc: doxygen-run \$(DX_PS_GOAL) \$(DX_PDF_GOAL)
  487. ]m4_foreach([DX_i], [DX_loop],
  488. [[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag: \$(DX_CONFIG]DX_i[) \$(pkginclude_HEADERS)
  489. \$(A""M_V_at)rm -rf \$(DX_DOCDIR]DX_i[)
  490. \$(DX_V_DXGEN)\$(DX_ENV) DOCDIR=\$(DX_DOCDIR]DX_i[) \$(DX_DOXYGEN) \$(DX_CONFIG]DX_i[)
  491. \$(A""M_V_at)echo Timestamp >\$][@
  492. ]])dnl
  493. [DX_CLEANFILES = \\]
  494. m4_foreach([DX_i], [DX_loop],
  495. [[ \$(DX_DOCDIR]DX_i[)/doxygen_sqlite3.db \\
  496. \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag \\
  497. ]])dnl
  498. [ -r \\
  499. \$(DX_CLEAN_HTML) \\
  500. \$(DX_CLEAN_CHM) \\
  501. \$(DX_CLEAN_CHI) \\
  502. \$(DX_CLEAN_MAN) \\
  503. \$(DX_CLEAN_RTF) \\
  504. \$(DX_CLEAN_XML) \\
  505. \$(DX_CLEAN_PS) \\
  506. \$(DX_CLEAN_PDF) \\
  507. \$(DX_CLEAN_LATEX)"]],
  508. [[DX_SNIPPET_doc=""]])
  509. AC_SUBST([DX_RULES],
  510. ["${DX_SNIPPET_doc}"])dnl
  511. AM_SUBST_NOTMAKE([DX_RULES])
  512. #For debugging:
  513. #echo DX_FLAG_doc=$DX_FLAG_doc
  514. #echo DX_FLAG_dot=$DX_FLAG_dot
  515. #echo DX_FLAG_man=$DX_FLAG_man
  516. #echo DX_FLAG_html=$DX_FLAG_html
  517. #echo DX_FLAG_chm=$DX_FLAG_chm
  518. #echo DX_FLAG_chi=$DX_FLAG_chi
  519. #echo DX_FLAG_rtf=$DX_FLAG_rtf
  520. #echo DX_FLAG_xml=$DX_FLAG_xml
  521. #echo DX_FLAG_pdf=$DX_FLAG_pdf
  522. #echo DX_FLAG_ps=$DX_FLAG_ps
  523. #echo DX_ENV=$DX_ENV
  524. ])