1 # -*- mode: makefile -*-
3 ####################################
4 # Everything below here is generic #
5 ####################################
8 GTKDOC_CC
= $(LIBTOOL
) --tag
=CC
--mode
=compile
$(CC
) $(INCLUDES
) $(GTKDOC_DEPS_CFLAGS
) $(AM_CPPFLAGS
) $(CPPFLAGS
) $(AM_CFLAGS
) $(CFLAGS
)
9 GTKDOC_LD
= $(LIBTOOL
) --tag
=CC
--mode
=link
$(CC
) $(GTKDOC_DEPS_LIBS
) $(AM_CFLAGS
) $(CFLAGS
) $(AM_LDFLAGS
) $(LDFLAGS
)
10 GTKDOC_RUN
= $(LIBTOOL
) --mode
=execute
12 GTKDOC_CC
= $(CC
) $(INCLUDES
) $(GTKDOC_DEPS_CFLAGS
) $(AM_CPPFLAGS
) $(CPPFLAGS
) $(AM_CFLAGS
) $(CFLAGS
)
13 GTKDOC_LD
= $(CC
) $(GTKDOC_DEPS_LIBS
) $(AM_CFLAGS
) $(CFLAGS
) $(AM_LDFLAGS
) $(LDFLAGS
)
17 # We set GPATH here; this gives us semantics for GNU make
18 # which are more like other make's VPATH, when it comes to
19 # whether a source that is a target of one rule is then
20 # searched for in VPATH/GPATH.
24 TARGET_DIR
=$(HTML_DIR
)/$(DOC_MODULE
)
28 $(DOC_MAIN_SGML_FILE
) \
29 $(DOC_MODULE
)-sections.txt \
30 $(DOC_MODULE
)-overrides.txt
36 DOC_STAMPS
=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \
37 html-build.stamp pdf-build.stamp \
38 tmpl.stamp sgml.stamp html.stamp pdf.stamp
42 $(DOC_MODULE
).hierarchy \
43 $(DOC_MODULE
).interfaces \
44 $(DOC_MODULE
).prerequisites \
48 $(DOC_MODULE
)-undocumented.txt \
49 $(DOC_MODULE
)-undeclared.txt \
50 $(DOC_MODULE
)-unused.txt
52 gtkdoc-check.
test: Makefile
53 $(AM_V_GEN
)echo
"#!/bin/sh -e" > $@
; \
54 echo
"$(GTKDOC_CHECK_PATH) || exit 1" >> $@
; \
57 CLEANFILES
= $(SCANOBJ_FILES
) $(REPORT_FILES
) $(DOC_STAMPS
) gtkdoc-check.
test
61 HTML_BUILD_STAMP
=html-build.stamp
66 PDF_BUILD_STAMP
=pdf-build.stamp
71 all-local
: $(HTML_BUILD_STAMP
) $(PDF_BUILD_STAMP
)
76 docs
: $(HTML_BUILD_STAMP
) $(PDF_BUILD_STAMP
)
78 $(REPORT_FILES
): sgml-build.stamp
82 GTK_DOC_V_SETUP
=$(GTK_DOC_V_SETUP_
$(V
))
83 GTK_DOC_V_SETUP_
=$(GTK_DOC_V_SETUP_
$(AM_DEFAULT_VERBOSITY
))
84 GTK_DOC_V_SETUP_0
=@echo
" DOC Preparing build";
87 -$(GTK_DOC_V_SETUP
)if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
88 files
=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
89 if
test "x$$files" != "x" ; then \
90 for file in
$$files ; do \
91 test -f
$(abs_srcdir
)/$$file && \
92 cp
-pu
$(abs_srcdir
)/$$file $(abs_builddir
)/$$file || true
; \
95 test -d
$(abs_srcdir
)/tmpl
&& \
96 { cp
-rp
$(abs_srcdir
)/tmpl
$(abs_builddir
)/; \
97 chmod
-R u
+w
$(abs_builddir
)/tmpl
; } \
99 $(AM_V_at
)touch setup-build.stamp
103 GTK_DOC_V_SCAN
=$(GTK_DOC_V_SCAN_
$(V
))
104 GTK_DOC_V_SCAN_
=$(GTK_DOC_V_SCAN_
$(AM_DEFAULT_VERBOSITY
))
105 GTK_DOC_V_SCAN_0
=@echo
" DOC Scanning header files";
107 GTK_DOC_V_INTROSPECT
=$(GTK_DOC_V_INTROSPECT_
$(V
))
108 GTK_DOC_V_INTROSPECT_
=$(GTK_DOC_V_INTROSPECT_
$(AM_DEFAULT_VERBOSITY
))
109 GTK_DOC_V_INTROSPECT_0
=@echo
" DOC Introspecting gobjects";
111 scan-build.stamp
: $(HFILE_GLOB
) $(CFILE_GLOB
)
112 $(GTK_DOC_V_SCAN
)_source_dir
='' ; \
113 for i in
$(DOC_SOURCE_DIR
) ; do \
114 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
116 gtkdoc-scan
--module
=$(DOC_MODULE
) --ignore-headers
="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS
) $(EXTRA_HFILES
)
117 $(GTK_DOC_V_INTROSPECT
)if grep
-l
'^..*$$' $(DOC_MODULE
).types
> /dev
/null
2>&1 ; then \
118 scanobj_options
=""; \
119 gtkdoc-scangobj
2>&1 --help | grep
>/dev
/null
"\-\-verbose"; \
120 if
test "$(?)" = "0"; then \
121 if
test "x$(V)" = "x1"; then \
122 scanobj_options
="--verbose"; \
125 CC
="$(GTKDOC_CC)" LD
="$(GTKDOC_LD)" RUN
="$(GTKDOC_RUN)" CFLAGS
="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS
="$(GTKDOC_LIBS) $(LDFLAGS)" \
126 gtkdoc-scangobj
$(SCANGOBJ_OPTIONS
) $$scanobj_options --module
=$(DOC_MODULE
); \
128 for i in
$(SCANOBJ_FILES
) ; do \
129 test -f
$$i || touch
$$i ; \
132 $(AM_V_at
)touch scan-build.stamp
134 $(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
: scan-build.stamp
139 GTK_DOC_V_TMPL
=$(GTK_DOC_V_TMPL_
$(V
))
140 GTK_DOC_V_TMPL_
=$(GTK_DOC_V_TMPL_
$(AM_DEFAULT_VERBOSITY
))
141 GTK_DOC_V_TMPL_0
=@echo
" DOC Rebuilding template files";
143 tmpl-build.stamp
: setup-build.stamp
$(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
144 $(GTK_DOC_V_TMPL
)gtkdoc-mktmpl
--module
=$(DOC_MODULE
) $(MKTMPL_OPTIONS
)
145 $(AM_V_at
)if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
146 if
test -w
$(abs_srcdir
) ; then \
147 cp
-rp
$(abs_builddir
)/tmpl
$(abs_srcdir
)/; \
150 $(AM_V_at
)touch tmpl-build.stamp
152 tmpl.stamp
: tmpl-build.stamp
155 $(srcdir)/tmpl
/*.sgml
:
160 GTK_DOC_V_XML
=$(GTK_DOC_V_XML_
$(V
))
161 GTK_DOC_V_XML_
=$(GTK_DOC_V_XML_
$(AM_DEFAULT_VERBOSITY
))
162 GTK_DOC_V_XML_0
=@echo
" DOC Building XML";
164 sgml-build.stamp
: tmpl.stamp
$(DOC_MODULE
)-sections.txt
$(srcdir)/tmpl
/*.sgml
$(expand_content_files
)
165 -$(GTK_DOC_V_XML
)chmod
-R u
+w
$(srcdir) && _source_dir
='' ; \
166 for i in
$(DOC_SOURCE_DIR
) ; do \
167 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
169 gtkdoc-mkdb
--module
=$(DOC_MODULE
) --output-format
=xml
--expand-content-files
="$(expand_content_files)" --main-sgml-file
=$(DOC_MAIN_SGML_FILE
) $${_source_dir} $(MKDB_OPTIONS
)
170 $(AM_V_at
)touch sgml-build.stamp
172 sgml.stamp
: sgml-build.stamp
177 GTK_DOC_V_HTML
=$(GTK_DOC_V_HTML_
$(V
))
178 GTK_DOC_V_HTML_
=$(GTK_DOC_V_HTML_
$(AM_DEFAULT_VERBOSITY
))
179 GTK_DOC_V_HTML_0
=@echo
" DOC Building HTML";
181 GTK_DOC_V_XREF
=$(GTK_DOC_V_XREF_
$(V
))
182 GTK_DOC_V_XREF_
=$(GTK_DOC_V_XREF_
$(AM_DEFAULT_VERBOSITY
))
183 GTK_DOC_V_XREF_0
=@echo
" DOC Fixing cross-references";
185 html-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
186 $(GTK_DOC_V_HTML
)rm -rf html
&& mkdir html
&& \
188 gtkdoc-mkhtml
2>&1 --help | grep
>/dev
/null
"\-\-verbose"; \
189 if
test "$(?)" = "0"; then \
190 if
test "x$(V)" = "x1"; then \
191 mkhtml_options
="$$mkhtml_options --verbose"; \
194 gtkdoc-mkhtml
2>&1 --help | grep
>/dev
/null
"\-\-path"; \
195 if
test "$(?)" = "0"; then \
196 mkhtml_options
="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
198 cd html
&& gtkdoc-mkhtml
$$mkhtml_options $(MKHTML_OPTIONS
) $(DOC_MODULE
) ..
/$(DOC_MAIN_SGML_FILE
)
199 -@
test "x$(HTML_IMAGES)" = "x" || \
200 for file in
$(HTML_IMAGES
) ; do \
201 if
test -f
$(abs_srcdir
)/$$file ; then \
202 cp
$(abs_srcdir
)/$$file $(abs_builddir
)/html
; \
204 if
test -f
$(abs_builddir
)/$$file ; then \
205 cp
$(abs_builddir
)/$$file $(abs_builddir
)/html
; \
208 $(GTK_DOC_V_XREF
)gtkdoc-fixxref
--module
=$(DOC_MODULE
) --module-dir
=html
--html-dir
=$(HTML_DIR
) $(FIXXREF_OPTIONS
)
209 $(AM_V_at
)touch html-build.stamp
213 GTK_DOC_V_PDF
=$(GTK_DOC_V_PDF_
$(V
))
214 GTK_DOC_V_PDF_
=$(GTK_DOC_V_PDF_
$(AM_DEFAULT_VERBOSITY
))
215 GTK_DOC_V_PDF_0
=@echo
" DOC Building PDF";
217 pdf-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
218 $(GTK_DOC_V_PDF
)rm -f
$(DOC_MODULE
).pdf
&& \
220 gtkdoc-mkpdf
2>&1 --help | grep
>/dev
/null
"\-\-verbose"; \
221 if
test "$(?)" = "0"; then \
222 if
test "x$(V)" = "x1"; then \
223 mkpdf_options
="$$mkpdf_options --verbose"; \
226 if
test "x$(HTML_IMAGES)" != "x"; then \
227 for img in
$(HTML_IMAGES
); do \
228 part
=`dirname $$img`; \
229 echo
$$mkpdf_options | grep
>/dev
/null
"\-\-imgdir=$$part "; \
230 if
test $$?
!= 0; then \
231 mkpdf_options
="$$mkpdf_options --imgdir=$$part"; \
235 gtkdoc-mkpdf
--path
="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE
) $(DOC_MAIN_SGML_FILE
) $(MKPDF_OPTIONS
)
236 $(AM_V_at
)touch pdf-build.stamp
245 @
rm -rf xml html
$(REPORT_FILES
) $(DOC_MODULE
).pdf \
246 $(DOC_MODULE
)-decl-list.txt
$(DOC_MODULE
)-decl.txt
247 @if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
248 rm -f
$(SETUP_FILES
) $(expand_content_files
) $(DOC_MODULE
).types
; \
252 maintainer-clean-local
:
256 @installfiles
=`echo $(builddir)/html/*`; \
257 if
test "$$installfiles" = '$(builddir)/html/*'; \
258 then echo
1>&2 'Nothing to install' ; \
260 if
test -n
"$(DOC_MODULE_VERSION)"; then \
261 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
263 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
265 $(mkinstalldirs
) $${installdir} ; \
266 for i in
$$installfiles; do \
267 echo
' $(INSTALL_DATA) '$$i ; \
268 $(INSTALL_DATA
) $$i $${installdir}; \
270 if
test -n
"$(DOC_MODULE_VERSION)"; then \
271 mv
-f
$${installdir}/$(DOC_MODULE
).devhelp2 \
272 $${installdir}/$(DOC_MODULE
)-$(DOC_MODULE_VERSION
).devhelp2
; \
274 $(GTKDOC_REBASE
) --relative
--dest-dir
=$(DESTDIR
) --html-dir
=$${installdir}; \
278 @if
test -n
"$(DOC_MODULE_VERSION)"; then \
279 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
281 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
283 rm -rf
$${installdir}
286 # Require gtk-doc when making dist
289 dist-check-gtkdoc
: docs
292 @echo
"*** gtk-doc must be installed and enabled in order to make dist"
296 dist-hook
: dist-check-gtkdoc dist-hook-local
297 @mkdir
$(distdir
)/tmpl
298 @mkdir
$(distdir
)/html
299 @
-cp .
/tmpl
/*.sgml
$(distdir
)/tmpl
300 @cp .
/html
/* $(distdir
)/html
301 @
-cp .
/$(DOC_MODULE
).pdf
$(distdir
)/
302 @
-cp .
/$(DOC_MODULE
).types
$(distdir
)/
303 @
-cp .
/$(DOC_MODULE
)-sections.txt
$(distdir
)/
304 @cd
$(distdir
) && rm -f
$(DISTCLEANFILES
)
305 @
$(GTKDOC_REBASE
) --online
--relative
--html-dir
=$(distdir
)/html
307 .PHONY
: dist-hook-local docs