Skip to content

Commit 1f81f07

Browse files
committed
add doxygen support
1 parent e564b54 commit 1f81f07

File tree

6 files changed

+754
-2
lines changed

6 files changed

+754
-2
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ config.*
3636
configure
3737
depcomp
3838
*.swp
39-
m4
4039
install-sh
4140
libtool
4241
ltmain.sh

Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ACLOCAL_AMFLAGS=-I m4
2525
AM_CPPFLAGS = \
2626
-I$(top_srcdir)/include
2727

28+
include m4/aminclude.am
2829

2930
if WIN32
3031
AM_CPPFLAGS+=-I$(top_srcdir)/include/mega/win32
@@ -47,6 +48,7 @@ SUBDIRS = include
4748

4849
EXTRA_DIST=autogen.sh
4950
EXTRA_DIST+=libmega.pc.in
51+
EXTRA_DIST+=$(DX_CONFIG)
5052

5153
pkgconfigdir=$(libdir)/pkgconfig
5254
pkgconfig_DATA=libmega.pc

autogen.sh

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/bin/sh
2-
mkdir m4
32
autoreconf -fiv || exit 1;

configure.ac

+18
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# -*- Autoconf -*-
2323
# Process this file with autoconf to produce a configure script.
2424

25+
m4_include([m4/ax_prog_doxygen.m4])
26+
2527
AC_PREREQ([2.61])
2628

2729
# The Mega SDK version number is generated into config.h.
@@ -470,6 +472,22 @@ fi
470472
AM_CONDITIONAL([BUILD_TESTS], [test "$enable_tests" = "yes"])
471473
AC_MSG_RESULT([$enable_tests])
472474

475+
dnl #########################################################################
476+
dnl Doxygen settings
477+
dnl #########################################################################
478+
479+
DX_INIT_DOXYGEN($PACKAGE_NAME, doc/sphinx_doxy.cfg, doc/output)
480+
DX_DOXYGEN_FEATURE(ON)
481+
DX_DOT_FEATURE(ON)
482+
DX_HTML_FEATURE(ON)
483+
DX_CHM_FEATURE(OFF)
484+
DX_CHI_FEATURE(OFF)
485+
DX_MAN_FEATURE(OFF)
486+
DX_RTF_FEATURE(OFF)
487+
DX_XML_FEATURE(OFF)
488+
DX_PDF_FEATURE(OFF)
489+
DX_PS_FEATURE(OFF)
490+
473491
# Output
474492
AC_CONFIG_FILES([
475493
Makefile

m4/aminclude.am

+202
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
# Automake Support
2+
# From git://git.sv.gnu.org/autoconf-archive.git m4/ax_prog_doxygen.m4
3+
#
4+
# LICENSE
5+
#
6+
# Copyright (c) 2009 Oren Ben-Kiki <[email protected]>
7+
#
8+
# Copying and distribution of this file, with or without modification, are
9+
# permitted in any medium without royalty provided the copyright notice
10+
# and this notice are preserved. This file is offered as-is, without any
11+
# warranty.
12+
#
13+
# The following is a template aminclude.am file for use with Automake.
14+
# Make targets and variables values are controlled by the various
15+
# DX_COND_* conditionals set by autoconf.
16+
#
17+
# The provided targets are:
18+
#
19+
# doxygen-doc: Generate all doxygen documentation.
20+
#
21+
# doxygen-run: Run doxygen, which will generate some of the
22+
# documentation (HTML, CHM, CHI, MAN, RTF, XML)
23+
# but will not do the post processing required
24+
# for the rest of it (PS, PDF, and some MAN).
25+
#
26+
# doxygen-man: Rename some doxygen generated man pages.
27+
#
28+
# doxygen-ps: Generate doxygen PostScript documentation.
29+
#
30+
# doxygen-pdf: Generate doxygen PDF documentation.
31+
#
32+
# Note that by default these are not integrated into the automake targets.
33+
# If doxygen is used to generate man pages, you can achieve this
34+
# integration by setting man3_MANS to the list of man pages generated and
35+
# then adding the dependency:
36+
#
37+
# $(man3_MANS): doxygen-doc
38+
#
39+
# This will cause make to run doxygen and generate all the documentation.
40+
#
41+
# The following variable is intended for use in Makefile.am:
42+
#
43+
# DX_CLEANFILES = everything to clean.
44+
#
45+
# Then add this variable to MOSTLYCLEANFILES.
46+
47+
## --------------------------------- ##
48+
## Format-independent Doxygen rules. ##
49+
## --------------------------------- ##
50+
51+
if DX_COND_doc
52+
53+
## ------------------------------- ##
54+
## Rules specific for HTML output. ##
55+
## ------------------------------- ##
56+
57+
if DX_COND_html
58+
59+
DX_CLEAN_HTML = @DX_DOCDIR@/html
60+
61+
endif DX_COND_html
62+
63+
## ------------------------------ ##
64+
## Rules specific for CHM output. ##
65+
## ------------------------------ ##
66+
67+
if DX_COND_chm
68+
69+
DX_CLEAN_CHM = @DX_DOCDIR@/chm
70+
71+
if DX_COND_chi
72+
73+
DX_CLEAN_CHI = @DX_DOCDIR@/@[email protected]
74+
75+
endif DX_COND_chi
76+
77+
endif DX_COND_chm
78+
79+
## ------------------------------ ##
80+
## Rules specific for MAN output. ##
81+
## ------------------------------ ##
82+
83+
if DX_COND_man
84+
85+
DX_CLEAN_MAN = @DX_DOCDIR@/man
86+
87+
endif DX_COND_man
88+
89+
## ------------------------------ ##
90+
## Rules specific for RTF output. ##
91+
## ------------------------------ ##
92+
93+
if DX_COND_rtf
94+
95+
DX_CLEAN_RTF = @DX_DOCDIR@/rtf
96+
97+
endif DX_COND_rtf
98+
99+
## ------------------------------ ##
100+
## Rules specific for XML output. ##
101+
## ------------------------------ ##
102+
103+
if DX_COND_xml
104+
105+
DX_CLEAN_XML = @DX_DOCDIR@/xml
106+
107+
endif DX_COND_xml
108+
109+
## ----------------------------- ##
110+
## Rules specific for PS output. ##
111+
## ----------------------------- ##
112+
113+
if DX_COND_ps
114+
115+
DX_CLEAN_PS = @DX_DOCDIR@/@[email protected]
116+
117+
DX_PS_GOAL = doxygen-ps
118+
119+
doxygen-ps: @DX_DOCDIR@/@[email protected]
120+
121+
@DX_DOCDIR@/@[email protected]: @DX_DOCDIR@/@[email protected]
122+
cd @DX_DOCDIR@/latex; \
123+
rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
124+
$(DX_LATEX) refman.tex; \
125+
$(MAKEINDEX_PATH) refman.idx; \
126+
$(DX_LATEX) refman.tex; \
127+
countdown=5; \
128+
while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
129+
refman.log > /dev/null 2>&1 \
130+
&& test $$countdown -gt 0; do \
131+
$(DX_LATEX) refman.tex; \
132+
countdown=`expr $$countdown - 1`; \
133+
done; \
134+
$(DX_DVIPS) -o ../@[email protected] refman.dvi
135+
136+
endif DX_COND_ps
137+
138+
## ------------------------------ ##
139+
## Rules specific for PDF output. ##
140+
## ------------------------------ ##
141+
142+
if DX_COND_pdf
143+
144+
DX_CLEAN_PDF = @DX_DOCDIR@/@[email protected]
145+
146+
DX_PDF_GOAL = doxygen-pdf
147+
148+
doxygen-pdf: @DX_DOCDIR@/@[email protected]
149+
150+
@DX_DOCDIR@/@[email protected]: @DX_DOCDIR@/@[email protected]
151+
cd @DX_DOCDIR@/latex; \
152+
rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
153+
$(DX_PDFLATEX) refman.tex; \
154+
$(DX_MAKEINDEX) refman.idx; \
155+
$(DX_PDFLATEX) refman.tex; \
156+
countdown=5; \
157+
while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
158+
refman.log > /dev/null 2>&1 \
159+
&& test $$countdown -gt 0; do \
160+
$(DX_PDFLATEX) refman.tex; \
161+
countdown=`expr $$countdown - 1`; \
162+
done; \
163+
mv refman.pdf ../@[email protected]
164+
165+
endif DX_COND_pdf
166+
167+
## ------------------------------------------------- ##
168+
## Rules specific for LaTeX (shared for PS and PDF). ##
169+
## ------------------------------------------------- ##
170+
171+
if DX_COND_latex
172+
173+
DX_CLEAN_LATEX = @DX_DOCDIR@/latex
174+
175+
endif DX_COND_latex
176+
177+
.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
178+
179+
.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
180+
181+
doxygen-run: @DX_DOCDIR@/@[email protected]
182+
183+
doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
184+
185+
@DX_DOCDIR@/@[email protected]: $(DX_CONFIG) $(pkginclude_HEADERS)
186+
rm -rf @DX_DOCDIR@
187+
$(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
188+
189+
DX_CLEANFILES = \
190+
@DX_DOCDIR@/@[email protected] \
191+
-r \
192+
$(DX_CLEAN_HTML) \
193+
$(DX_CLEAN_CHM) \
194+
$(DX_CLEAN_CHI) \
195+
$(DX_CLEAN_MAN) \
196+
$(DX_CLEAN_RTF) \
197+
$(DX_CLEAN_XML) \
198+
$(DX_CLEAN_PS) \
199+
$(DX_CLEAN_PDF) \
200+
$(DX_CLEAN_LATEX)
201+
202+
endif DX_COND_doc

0 commit comments

Comments
 (0)