1 # -*- mode: makefile -*-
3 ####################################
4 # Everything below here is generic #
5 ####################################
8 GTKDOC_CC
= $(LIBTOOL
) --tag
=CC
--mode
=compile
$(CC
) $(INCLUDES
) $(AM_CPPFLAGS
) $(CPPFLAGS
) $(AM_CFLAGS
) $(CFLAGS
)
9 GTKDOC_LD
= $(LIBTOOL
) --tag
=CC
--mode
=link
$(CC
) $(AM_CFLAGS
) $(CFLAGS
) $(AM_LDFLAGS
) $(LDFLAGS
)
10 GTKDOC_RUN
= $(LIBTOOL
) --mode
=execute
12 GTKDOC_CC
= $(CC
) $(INCLUDES
) $(AM_CPPFLAGS
) $(CPPFLAGS
) $(AM_CFLAGS
) $(CFLAGS
)
13 GTKDOC_LD
= $(CC
) $(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
)
29 $(DOC_MAIN_SGML_FILE
) \
30 $(DOC_MODULE
)-sections.txt \
31 $(DOC_MODULE
)-overrides.txt
33 DOC_STAMPS
=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
35 $(srcdir)/tmpl.stamp
$(srcdir)/sgml.stamp
$(srcdir)/html.stamp \
40 $(DOC_MODULE
).hierarchy \
41 $(DOC_MODULE
).interfaces \
42 $(DOC_MODULE
).prerequisites \
46 $(DOC_MODULE
)-undocumented.txt \
47 $(DOC_MODULE
)-undeclared.txt \
48 $(DOC_MODULE
)-unused.txt
50 CLEANFILES
= $(SCANOBJ_FILES
) $(REPORT_FILES
) $(DOC_STAMPS
)
54 HTML_BUILD_STAMP
=html-build.stamp
59 PDF_BUILD_STAMP
=pdf-build.stamp
64 all-local
: $(HTML_BUILD_STAMP
) $(PDF_BUILD_STAMP
)
69 docs
: $(HTML_BUILD_STAMP
) $(PDF_BUILD_STAMP
)
71 $(REPORT_FILES
): sgml-build.stamp
75 scan-build.stamp
: $(HFILE_GLOB
) $(CFILE_GLOB
)
76 @echo
'gtk-doc: Scanning header files'
77 @
-chmod
-R u
+w
$(srcdir)
78 @_source_dir
='' ; for i in
$(DOC_SOURCE_DIR
) ; do \
79 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
82 gtkdoc-scan
--module
=$(DOC_MODULE
) --ignore-headers
="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS
) $(EXTRA_HFILES
)
83 @if grep
-l
'^..*$$' $(srcdir)/$(DOC_MODULE
).types
> /dev
/null
2>&1 ; then \
84 CC
="$(GTKDOC_CC)" LD
="$(GTKDOC_LD)" RUN
="$(GTKDOC_RUN)" CFLAGS
="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS
="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj
$(SCANGOBJ_OPTIONS
) --module
=$(DOC_MODULE
) --output-dir
=$(srcdir) ; \
87 for i in
$(SCANOBJ_FILES
) ; do \
88 test -f
$$i || touch
$$i ; \
91 @touch scan-build.stamp
93 $(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
: scan-build.stamp
98 tmpl-build.stamp
: $(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
99 @echo
'gtk-doc: Rebuilding template files'
100 @
-chmod
-R u
+w
$(srcdir)
101 @cd
$(srcdir) && gtkdoc-mktmpl
--module
=$(DOC_MODULE
) $(MKTMPL_OPTIONS
)
102 @touch tmpl-build.stamp
104 tmpl.stamp
: tmpl-build.stamp
107 $(srcdir)/tmpl
/*.sgml
:
112 sgml-build.stamp
: tmpl.stamp
$(DOC_MODULE
)-sections.txt
$(srcdir)/tmpl
/*.sgml
$(expand_content_files
)
113 @echo
'gtk-doc: Building XML'
114 @
-chmod
-R u
+w
$(srcdir)
115 @_source_dir
='' ; for i in
$(DOC_SOURCE_DIR
) ; do \
116 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
119 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
)
120 @touch sgml-build.stamp
122 sgml.stamp
: sgml-build.stamp
127 html-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
128 @echo
'gtk-doc: Building HTML'
129 @
-chmod
-R u
+w
$(srcdir)
130 @
rm -rf
$(srcdir)/html
131 @mkdir
$(srcdir)/html
132 @mkhtml_options
=""; \
133 gtkdoc-mkhtml
2>&1 --help | grep
>/dev
/null
"\-\-path"; \
134 if
test "$(?)" = "0"; then \
135 mkhtml_options
=--path
="$(srcdir)"; \
137 cd
$(srcdir)/html
&& gtkdoc-mkhtml
$$mkhtml_options $(MKHTML_OPTIONS
) $(DOC_MODULE
) ..
/$(DOC_MAIN_SGML_FILE
)
138 @
test "x$(HTML_IMAGES)" = "x" ||
( cd
$(srcdir) && cp
$(HTML_IMAGES
) html
)
139 @echo
'gtk-doc: Fixing cross-references'
140 @cd
$(srcdir) && gtkdoc-fixxref
--module
=$(DOC_MODULE
) --module-dir
=html
--html-dir
=$(HTML_DIR
) $(FIXXREF_OPTIONS
)
141 @touch html-build.stamp
145 pdf-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
146 @echo
'gtk-doc: Building PDF'
147 @
-chmod
-R u
+w
$(srcdir)
148 @
rm -rf
$(srcdir)/$(DOC_MODULE
).pdf
150 if
test "x$(HTML_IMAGES)" != "x"; then \
151 for img in
$(HTML_IMAGES
); do \
152 part
=`dirname $$img`; \
153 echo
$$mkpdf_imgdirs | grep
>/dev
/null
"\-\-imgdir=$$part "; \
154 if
test $$?
!= 0; then \
155 mkpdf_imgdirs
="$$mkpdf_imgdirs --imgdir=$$part"; \
159 cd
$(srcdir) && gtkdoc-mkpdf
--path
="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE
) $(DOC_MAIN_SGML_FILE
) $(MKPDF_OPTIONS
)
160 @touch pdf-build.stamp
170 rm -rf xml
$(REPORT_FILES
) $(DOC_MODULE
).pdf \
171 $(DOC_MODULE
)-decl-list.txt
$(DOC_MODULE
)-decl.txt
173 maintainer-clean-local
: clean
174 cd
$(srcdir) && rm -rf xml html
177 @installfiles
=`echo $(srcdir)/html/*`; \
178 if
test "$$installfiles" = '$(srcdir)/html/*'; \
179 then echo
'-- Nothing to install' ; \
181 if
test -n
"$(DOC_MODULE_VERSION)"; then \
182 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
184 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
186 $(mkinstalldirs
) $${installdir} ; \
187 for i in
$$installfiles; do \
188 echo
'-- Installing '$$i ; \
189 $(INSTALL_DATA
) $$i $${installdir}; \
191 if
test -n
"$(DOC_MODULE_VERSION)"; then \
192 mv
-f
$${installdir}/$(DOC_MODULE
).devhelp2 \
193 $${installdir}/$(DOC_MODULE
)-$(DOC_MODULE_VERSION
).devhelp2
; \
194 mv
-f
$${installdir}/$(DOC_MODULE
).devhelp \
195 $${installdir}/$(DOC_MODULE
)-$(DOC_MODULE_VERSION
).devhelp
; \
197 $(GTKDOC_REBASE
) --relative
--dest-dir
=$(DESTDIR
) --html-dir
=$${installdir}; \
201 @if
test -n
"$(DOC_MODULE_VERSION)"; then \
202 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
204 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
206 rm -rf
$${installdir}
209 # Require gtk-doc when making dist
215 @echo
"*** gtk-doc must be installed and enabled in order to make dist"
219 dist-hook
: dist-check-gtkdoc dist-hook-local
220 mkdir
$(distdir
)/tmpl
221 mkdir
$(distdir
)/html
222 -cp
$(srcdir)/tmpl
/*.sgml
$(distdir
)/tmpl
223 -cp
$(srcdir)/html
/* $(distdir
)/html
224 -cp
$(srcdir)/$(DOC_MODULE
).pdf
$(distdir
)/
225 -cp
$(srcdir)/$(DOC_MODULE
).types
$(distdir
)/
226 -cp
$(srcdir)/$(DOC_MODULE
)-sections.txt
$(distdir
)/
227 cd
$(distdir
) && rm -f
$(DISTCLEANFILES
)
228 $(GTKDOC_REBASE
) --online
--relative
--html-dir
=$(distdir
)/html
230 .PHONY
: dist-hook-local docs