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 $(expand_content_files
) \
29 $(DOC_MAIN_SGML_FILE
) \
30 $(DOC_MODULE
)-sections.txt \
31 $(DOC_MODULE
)-overrides.txt
37 DOC_STAMPS
=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \
38 html-build.stamp pdf-build.stamp \
39 tmpl.stamp sgml.stamp html.stamp pdf.stamp
43 $(DOC_MODULE
).hierarchy \
44 $(DOC_MODULE
).interfaces \
45 $(DOC_MODULE
).prerequisites \
49 $(DOC_MODULE
)-undocumented.txt \
50 $(DOC_MODULE
)-undeclared.txt \
51 $(DOC_MODULE
)-unused.txt
53 gtkdoc-check.
test: Makefile
54 $(AM_V_GEN
)echo
"#!/bin/sh -e" > $@
; \
55 echo
"$(GTKDOC_CHECK_PATH) || exit 1" >> $@
; \
58 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-gtk-doc
: $(HTML_BUILD_STAMP
) $(PDF_BUILD_STAMP
)
75 all-local
: all-gtk-doc
78 docs
: $(HTML_BUILD_STAMP
) $(PDF_BUILD_STAMP
)
80 $(REPORT_FILES
): sgml-build.stamp
84 GTK_DOC_V_SETUP
=$(GTK_DOC_V_SETUP_
$(V
))
85 GTK_DOC_V_SETUP_
=$(GTK_DOC_V_SETUP_
$(AM_DEFAULT_VERBOSITY
))
86 GTK_DOC_V_SETUP_0
=@echo
" DOC Preparing build";
89 -$(GTK_DOC_V_SETUP
)if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
90 files
=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \
91 if
test "x$$files" != "x" ; then \
92 for file in
$$files ; do \
93 destdir
=`dirname $(abs_builddir)/$$file` ;\
94 test -d
"$$destdir" || mkdir
-p
"$$destdir"; \
95 test -f
$(abs_srcdir
)/$$file && \
96 cp
-pf
$(abs_srcdir
)/$$file $(abs_builddir
)/$$file || true
; \
99 test -d
$(abs_srcdir
)/tmpl
&& \
100 { cp
-pR
$(abs_srcdir
)/tmpl
$(abs_builddir
)/; \
101 chmod
-R u
+w
$(abs_builddir
)/tmpl
; } \
103 $(AM_V_at
)touch setup-build.stamp
107 GTK_DOC_V_SCAN
=$(GTK_DOC_V_SCAN_
$(V
))
108 GTK_DOC_V_SCAN_
=$(GTK_DOC_V_SCAN_
$(AM_DEFAULT_VERBOSITY
))
109 GTK_DOC_V_SCAN_0
=@echo
" DOC Scanning header files";
111 GTK_DOC_V_INTROSPECT
=$(GTK_DOC_V_INTROSPECT_
$(V
))
112 GTK_DOC_V_INTROSPECT_
=$(GTK_DOC_V_INTROSPECT_
$(AM_DEFAULT_VERBOSITY
))
113 GTK_DOC_V_INTROSPECT_0
=@echo
" DOC Introspecting gobjects";
115 scan-build.stamp
: setup-build.stamp
$(HFILE_GLOB
) $(CFILE_GLOB
)
116 $(GTK_DOC_V_SCAN
)_source_dir
='' ; \
117 for i in
$(DOC_SOURCE_DIR
) ; do \
118 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
120 gtkdoc-scan
--module
=$(DOC_MODULE
) --ignore-headers
="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS
) $(EXTRA_HFILES
)
121 $(GTK_DOC_V_INTROSPECT
)if grep
-l
'^..*$$' $(DOC_MODULE
).types
> /dev
/null
2>&1 ; then \
122 scanobj_options
=""; \
123 gtkdoc-scangobj
2>&1 --help | grep
>/dev
/null
"\-\-verbose"; \
124 if
test "$$?" = "0"; then \
125 if
test "x$(V)" = "x1"; then \
126 scanobj_options
="--verbose"; \
129 CC
="$(GTKDOC_CC)" LD
="$(GTKDOC_LD)" RUN
="$(GTKDOC_RUN)" CFLAGS
="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS
="$(GTKDOC_LIBS) $(LDFLAGS)" \
130 gtkdoc-scangobj
$(SCANGOBJ_OPTIONS
) $$scanobj_options --module
=$(DOC_MODULE
); \
132 for i in
$(SCANOBJ_FILES
) ; do \
133 test -f
$$i || touch
$$i ; \
136 $(AM_V_at
)touch scan-build.stamp
138 $(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
: scan-build.stamp
143 GTK_DOC_V_TMPL
=$(GTK_DOC_V_TMPL_
$(V
))
144 GTK_DOC_V_TMPL_
=$(GTK_DOC_V_TMPL_
$(AM_DEFAULT_VERBOSITY
))
145 GTK_DOC_V_TMPL_0
=@echo
" DOC Rebuilding template files";
147 tmpl-build.stamp
: setup-build.stamp
$(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(HFILE_GLOB
) $(CFILE_GLOB
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
148 $(GTK_DOC_V_TMPL
)gtkdoc-mktmpl
--module
=$(DOC_MODULE
) $(MKTMPL_OPTIONS
)
149 $(AM_V_at
)if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
150 if
test -w
$(abs_srcdir
) ; then \
151 cp
-pR
$(abs_builddir
)/tmpl
$(abs_srcdir
)/; \
154 $(AM_V_at
)touch tmpl-build.stamp
156 tmpl.stamp
: tmpl-build.stamp
159 $(srcdir)/tmpl
/*.sgml
:
164 GTK_DOC_V_XML
=$(GTK_DOC_V_XML_
$(V
))
165 GTK_DOC_V_XML_
=$(GTK_DOC_V_XML_
$(AM_DEFAULT_VERBOSITY
))
166 GTK_DOC_V_XML_0
=@echo
" DOC Building XML";
168 sgml-build.stamp
: tmpl.stamp
$(DOC_MODULE
)-sections.txt
$(srcdir)/tmpl
/*.sgml
$(expand_content_files
) xml
/gtkdocentities.ent
169 -$(GTK_DOC_V_XML
)chmod
-R u
+w
$(srcdir) && _source_dir
='' ; \
170 for i in
$(DOC_SOURCE_DIR
) ; do \
171 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
173 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
)
174 $(AM_V_at
)touch sgml-build.stamp
176 sgml.stamp
: sgml-build.stamp
179 xml
/gtkdocentities.ent
: Makefile
180 $(GTK_DOC_V_XML
)$(MKDIR_P
) $(@D
) && ( \
181 echo
"<!ENTITY package \"$(PACKAGE)\">"; \
182 echo
"<!ENTITY package_bugreport \"$(PACKAGE_BUGREPORT)\">"; \
183 echo
"<!ENTITY package_name \"$(PACKAGE_NAME)\">"; \
184 echo
"<!ENTITY package_string \"$(PACKAGE_STRING)\">"; \
185 echo
"<!ENTITY package_tarname \"$(PACKAGE_TARNAME)\">"; \
186 echo
"<!ENTITY package_url \"$(PACKAGE_URL)\">"; \
187 echo
"<!ENTITY package_version \"$(PACKAGE_VERSION)\">"; \
192 GTK_DOC_V_HTML
=$(GTK_DOC_V_HTML_
$(V
))
193 GTK_DOC_V_HTML_
=$(GTK_DOC_V_HTML_
$(AM_DEFAULT_VERBOSITY
))
194 GTK_DOC_V_HTML_0
=@echo
" DOC Building HTML";
196 GTK_DOC_V_XREF
=$(GTK_DOC_V_XREF_
$(V
))
197 GTK_DOC_V_XREF_
=$(GTK_DOC_V_XREF_
$(AM_DEFAULT_VERBOSITY
))
198 GTK_DOC_V_XREF_0
=@echo
" DOC Fixing cross-references";
200 html-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
) $(expand_content_files
)
201 $(GTK_DOC_V_HTML
)rm -rf html
&& mkdir html
&& \
203 gtkdoc-mkhtml
2>&1 --help | grep
>/dev
/null
"\-\-verbose"; \
204 if
test "$$?" = "0"; then \
205 if
test "x$(V)" = "x1"; then \
206 mkhtml_options
="$$mkhtml_options --verbose"; \
209 gtkdoc-mkhtml
2>&1 --help | grep
>/dev
/null
"\-\-path"; \
210 if
test "$$?" = "0"; then \
211 mkhtml_options
="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
213 cd html
&& gtkdoc-mkhtml
$$mkhtml_options $(MKHTML_OPTIONS
) $(DOC_MODULE
) ..
/$(DOC_MAIN_SGML_FILE
)
214 -@
test "x$(HTML_IMAGES)" = "x" || \
215 for file in
$(HTML_IMAGES
) ; do \
216 if
test -f
$(abs_srcdir
)/$$file ; then \
217 cp
$(abs_srcdir
)/$$file $(abs_builddir
)/html
; \
219 if
test -f
$(abs_builddir
)/$$file ; then \
220 cp
$(abs_builddir
)/$$file $(abs_builddir
)/html
; \
223 $(GTK_DOC_V_XREF
)gtkdoc-fixxref
--module
=$(DOC_MODULE
) --module-dir
=html
--html-dir
=$(HTML_DIR
) $(FIXXREF_OPTIONS
)
224 $(AM_V_at
)touch html-build.stamp
228 GTK_DOC_V_PDF
=$(GTK_DOC_V_PDF_
$(V
))
229 GTK_DOC_V_PDF_
=$(GTK_DOC_V_PDF_
$(AM_DEFAULT_VERBOSITY
))
230 GTK_DOC_V_PDF_0
=@echo
" DOC Building PDF";
232 pdf-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
) $(expand_content_files
)
233 $(GTK_DOC_V_PDF
)rm -f
$(DOC_MODULE
).pdf
&& \
235 gtkdoc-mkpdf
2>&1 --help | grep
>/dev
/null
"\-\-verbose"; \
236 if
test "$$?" = "0"; then \
237 if
test "x$(V)" = "x1"; then \
238 mkpdf_options
="$$mkpdf_options --verbose"; \
241 if
test "x$(HTML_IMAGES)" != "x"; then \
242 for img in
$(HTML_IMAGES
); do \
243 part
=`dirname $$img`; \
244 echo
$$mkpdf_options | grep
>/dev
/null
"\-\-imgdir=$$part "; \
245 if
test $$?
!= 0; then \
246 mkpdf_options
="$$mkpdf_options --imgdir=$$part"; \
250 gtkdoc-mkpdf
--path
="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE
) $(DOC_MAIN_SGML_FILE
) $(MKPDF_OPTIONS
)
251 $(AM_V_at
)touch pdf-build.stamp
258 @if echo
$(SCAN_OPTIONS
) | grep
-q
"\-\-rebuild-types" ; then \
259 rm -f
$(DOC_MODULE
).types
; \
261 @if echo
$(SCAN_OPTIONS
) | grep
-q
"\-\-rebuild-sections" ; then \
262 rm -f
$(DOC_MODULE
)-sections.txt
; \
266 @
rm -rf xml html
$(REPORT_FILES
) $(DOC_MODULE
).pdf \
267 $(DOC_MODULE
)-decl-list.txt
$(DOC_MODULE
)-decl.txt
268 @if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
269 rm -f
$(SETUP_FILES
) $(DOC_MODULE
).types
; \
273 maintainer-clean-local
:
277 @installfiles
=`echo $(builddir)/html/*`; \
278 if
test "$$installfiles" = '$(builddir)/html/*'; \
279 then echo
1>&2 'Nothing to install' ; \
281 if
test -n
"$(DOC_MODULE_VERSION)"; then \
282 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
284 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
286 $(mkinstalldirs
) $${installdir} ; \
287 for i in
$$installfiles; do \
288 echo
' $(INSTALL_DATA) '$$i ; \
289 $(INSTALL_DATA
) $$i $${installdir}; \
291 if
test -n
"$(DOC_MODULE_VERSION)"; then \
292 mv
-f
$${installdir}/$(DOC_MODULE
).devhelp2 \
293 $${installdir}/$(DOC_MODULE
)-$(DOC_MODULE_VERSION
).devhelp2
; \
295 $(GTKDOC_REBASE
) --relative
--dest-dir
=$(DESTDIR
) --html-dir
=$${installdir}; \
299 @if
test -n
"$(DOC_MODULE_VERSION)"; then \
300 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
302 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
304 rm -rf
$${installdir}
307 # Require gtk-doc when making dist
310 dist-check-gtkdoc
: docs
313 @echo
"*** gtk-doc is needed to run 'make dist'. ***"
314 @echo
"*** gtk-doc was not found when 'configure' ran. ***"
315 @echo
"*** please install gtk-doc and rerun 'configure'. ***"
319 dist-hook
: dist-check-gtkdoc all-gtk-doc dist-hook-local
320 @mkdir
$(distdir
)/tmpl
321 @mkdir
$(distdir
)/html
322 @
-cp .
/tmpl
/*.sgml
$(distdir
)/tmpl
323 @cp .
/html
/* $(distdir
)/html
324 @
-cp .
/$(DOC_MODULE
).pdf
$(distdir
)/
325 @
-cp .
/$(DOC_MODULE
).types
$(distdir
)/
326 @
-cp .
/$(DOC_MODULE
)-sections.txt
$(distdir
)/
327 @cd
$(distdir
) && rm -f
$(DISTCLEANFILES
)
328 @
$(GTKDOC_REBASE
) --online
--relative
--html-dir
=$(distdir
)/html
330 .PHONY
: dist-hook-local docs