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 sgml-build.stamp \
37 html-build.stamp pdf-build.stamp \
38 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 CLEANFILES
= $(SCANOBJ_FILES
) $(REPORT_FILES
) $(DOC_STAMPS
)
56 HTML_BUILD_STAMP
=html-build.stamp
61 PDF_BUILD_STAMP
=pdf-build.stamp
66 all-local
: $(HTML_BUILD_STAMP
) $(PDF_BUILD_STAMP
)
71 docs
: $(HTML_BUILD_STAMP
) $(PDF_BUILD_STAMP
)
73 $(REPORT_FILES
): sgml-build.stamp
77 GTK_DOC_V_SETUP
=$(GTK_DOC_V_SETUP_
$(V
))
78 GTK_DOC_V_SETUP_
=$(GTK_DOC_V_SETUP_
$(AM_DEFAULT_VERBOSITY
))
79 GTK_DOC_V_SETUP_0
=@echo
" DOC Preparing build";
82 -$(GTK_DOC_V_SETUP
)if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
83 files
=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
84 if
test "x$$files" != "x" ; then \
85 for file in
$$files ; do \
86 test -f
$(abs_srcdir
)/$$file && \
87 cp
-pu
$(abs_srcdir
)/$$file $(abs_builddir
)/$$file || true
; \
91 $(AM_V_at
)touch setup-build.stamp
96 GTK_DOC_V_SCAN
=$(GTK_DOC_V_SCAN_
$(V
))
97 GTK_DOC_V_SCAN_
=$(GTK_DOC_V_SCAN_
$(AM_DEFAULT_VERBOSITY
))
98 GTK_DOC_V_SCAN_0
=@echo
" DOC Scanning header files";
100 GTK_DOC_V_INTROSPECT
=$(GTK_DOC_V_INTROSPECT_
$(V
))
101 GTK_DOC_V_INTROSPECT_
=$(GTK_DOC_V_INTROSPECT_
$(AM_DEFAULT_VERBOSITY
))
102 GTK_DOC_V_INTROSPECT_0
=@echo
" DOC Introspecting gobjects";
104 scan-build.stamp
: $(HFILE_GLOB
) $(CFILE_GLOB
)
105 $(GTK_DOC_V_SCAN
)_source_dir
='' ; \
106 for i in
$(DOC_SOURCE_DIR
) ; do \
107 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
109 gtkdoc-scan
--module
=$(DOC_MODULE
) --ignore-headers
="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS
) $(EXTRA_HFILES
)
110 $(GTK_DOC_V_INTROSPECT
)if grep
-l
'^..*$$' $(DOC_MODULE
).types
> /dev
/null
2>&1 ; then \
111 scanobj_options
=""; \
112 gtkdoc-scangobj
2>&1 --help | grep
>/dev
/null
"\-\-verbose"; \
113 if
test "$(?)" = "0"; then \
114 if
test "x$(V)" = "x1"; then \
115 scanobj_options
="--verbose"; \
118 CC
="$(GTKDOC_CC)" LD
="$(GTKDOC_LD)" RUN
="$(GTKDOC_RUN)" CFLAGS
="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS
="$(GTKDOC_LIBS) $(LDFLAGS)" \
119 gtkdoc-scangobj
$(SCANGOBJ_OPTIONS
) $$scanobj_options --module
=$(DOC_MODULE
); \
121 for i in
$(SCANOBJ_FILES
) ; do \
122 test -f
$$i || touch
$$i ; \
125 $(AM_V_at
)touch scan-build.stamp
127 $(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
: scan-build.stamp
132 GTK_DOC_V_XML
=$(GTK_DOC_V_XML_
$(V
))
133 GTK_DOC_V_XML_
=$(GTK_DOC_V_XML_
$(AM_DEFAULT_VERBOSITY
))
134 GTK_DOC_V_XML_0
=@echo
" DOC Building XML";
136 sgml-build.stamp
: setup-build.stamp
$(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
$(expand_content_files
)
137 $(GTK_DOC_V_XML
)_source_dir
='' ; \
138 for i in
$(DOC_SOURCE_DIR
) ; do \
139 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
141 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
)
142 $(AM_V_at
)touch sgml-build.stamp
144 sgml.stamp
: sgml-build.stamp
149 GTK_DOC_V_HTML
=$(GTK_DOC_V_HTML_
$(V
))
150 GTK_DOC_V_HTML_
=$(GTK_DOC_V_HTML_
$(AM_DEFAULT_VERBOSITY
))
151 GTK_DOC_V_HTML_0
=@echo
" DOC Building HTML";
153 GTK_DOC_V_XREF
=$(GTK_DOC_V_XREF_
$(V
))
154 GTK_DOC_V_XREF_
=$(GTK_DOC_V_XREF_
$(AM_DEFAULT_VERBOSITY
))
155 GTK_DOC_V_XREF_0
=@echo
" DOC Fixing cross-references";
157 html-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
158 $(GTK_DOC_V_HTML
)rm -rf html
&& mkdir html
&& \
160 gtkdoc-mkhtml
2>&1 --help | grep
>/dev
/null
"\-\-verbose"; \
161 if
test "$(?)" = "0"; then \
162 if
test "x$(V)" = "x1"; then \
163 mkhtml_options
="$$mkhtml_options --verbose"; \
166 gtkdoc-mkhtml
2>&1 --help | grep
>/dev
/null
"\-\-path"; \
167 if
test "$(?)" = "0"; then \
168 mkhtml_options
="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
170 cd html
&& gtkdoc-mkhtml
$$mkhtml_options $(MKHTML_OPTIONS
) $(DOC_MODULE
) ..
/$(DOC_MAIN_SGML_FILE
)
171 -@
test "x$(HTML_IMAGES)" = "x" || \
172 for file in
$(HTML_IMAGES
) ; do \
173 if
test -f
$(abs_srcdir
)/$$file ; then \
174 cp
$(abs_srcdir
)/$$file $(abs_builddir
)/html
; \
176 if
test -f
$(abs_builddir
)/$$file ; then \
177 cp
$(abs_builddir
)/$$file $(abs_builddir
)/html
; \
180 $(GTK_DOC_V_XREF
)gtkdoc-fixxref
--module
=$(DOC_MODULE
) --module-dir
=html
--html-dir
=$(HTML_DIR
) $(FIXXREF_OPTIONS
)
181 $(AM_V_at
)touch html-build.stamp
185 GTK_DOC_V_PDF
=$(GTK_DOC_V_PDF_
$(V
))
186 GTK_DOC_V_PDF_
=$(GTK_DOC_V_PDF_
$(AM_DEFAULT_VERBOSITY
))
187 GTK_DOC_V_PDF_0
=@echo
" DOC Building PDF";
189 pdf-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
190 $(GTK_DOC_V_PDF
)rm -f
$(DOC_MODULE
).pdf
&& \
192 gtkdoc-mkpdf
2>&1 --help | grep
>/dev
/null
"\-\-verbose"; \
193 if
test "$(?)" = "0"; then \
194 if
test "x$(V)" = "x1"; then \
195 mkpdf_options
="$$mkpdf_options --verbose"; \
198 if
test "x$(HTML_IMAGES)" != "x"; then \
199 for img in
$(HTML_IMAGES
); do \
200 part
=`dirname $$img`; \
201 echo
$$mkpdf_options | grep
>/dev
/null
"\-\-imgdir=$$part "; \
202 if
test $$?
!= 0; then \
203 mkpdf_options
="$$mkpdf_options --imgdir=$$part"; \
207 gtkdoc-mkpdf
--path
="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE
) $(DOC_MAIN_SGML_FILE
) $(MKPDF_OPTIONS
)
208 $(AM_V_at
)touch pdf-build.stamp
217 @
rm -rf xml html
$(REPORT_FILES
) $(DOC_MODULE
).pdf \
218 $(DOC_MODULE
)-decl-list.txt
$(DOC_MODULE
)-decl.txt
219 @if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
220 rm -f
$(SETUP_FILES
) $(expand_content_files
) $(DOC_MODULE
).types
; \
223 maintainer-clean-local
:
227 @installfiles
=`echo $(builddir)/html/*`; \
228 if
test "$$installfiles" = '$(builddir)/html/*'; \
229 then echo
1>&2 'Nothing to install' ; \
231 if
test -n
"$(DOC_MODULE_VERSION)"; then \
232 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
234 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
236 $(mkinstalldirs
) $${installdir} ; \
237 for i in
$$installfiles; do \
238 echo
' $(INSTALL_DATA) '$$i ; \
239 $(INSTALL_DATA
) $$i $${installdir}; \
241 if
test -n
"$(DOC_MODULE_VERSION)"; then \
242 mv
-f
$${installdir}/$(DOC_MODULE
).devhelp2 \
243 $${installdir}/$(DOC_MODULE
)-$(DOC_MODULE_VERSION
).devhelp2
; \
245 $(GTKDOC_REBASE
) --relative
--dest-dir
=$(DESTDIR
) --html-dir
=$${installdir}; \
249 @if
test -n
"$(DOC_MODULE_VERSION)"; then \
250 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
252 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
254 rm -rf
$${installdir}
257 # Require gtk-doc when making dist
260 dist-check-gtkdoc
: docs
263 @echo
"*** gtk-doc must be installed and enabled in order to make dist"
267 dist-hook
: dist-check-gtkdoc dist-hook-local
268 @mkdir
$(distdir
)/html
269 @cp .
/html
/* $(distdir
)/html
270 @
-cp .
/$(DOC_MODULE
).pdf
$(distdir
)/
271 @
-cp .
/$(DOC_MODULE
).types
$(distdir
)/
272 @
-cp .
/$(DOC_MODULE
)-sections.txt
$(distdir
)/
273 @cd
$(distdir
) && rm -f
$(DISTCLEANFILES
)
274 @
$(GTKDOC_REBASE
) --online
--relative
--html-dir
=$(distdir
)/html
276 .PHONY
: dist-hook-local docs