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 # we don't install anything in tests
25 #TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
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 CLEANFILES
= $(SCANOBJ_FILES
) $(REPORT_FILES
) $(DOC_STAMPS
)
55 check-local
: html-build.stamp pdf-build.stamp
56 @ts1
=`cat ts`;ts2
=`date +%s.%N`;tsd
=`echo $$ts2-$$ts1 | bc`; \
57 echo
" DOC `date --utc --date @0$$tsd +%H:%M:%S.%N`: All done"
59 docs
: html-build.stamp pdf-build.stamp
60 @ts1
=`cat ts`;ts2
=`date +%s.%N`;tsd
=`echo $$ts2-$$ts1 | bc`; \
61 echo
" DOC `date --utc --date @0$$tsd +%H:%M:%S.%N`: All done"
63 $(REPORT_FILES
): sgml-build.stamp
66 @echo
>ts
`date +%s.%N`;
71 -@if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
72 echo
' DOC Preparing build'; \
73 files
=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
74 if
test "x$$files" != "x" ; then \
75 for file in
$$files ; do \
76 test -f
$(abs_srcdir
)/$$file && \
77 cp
-pu
$(abs_srcdir
)/$$file $(abs_builddir
)/ || true
; \
80 test -d
$(abs_srcdir
)/tmpl
&& \
81 { cp
$(abs_builddir
)/$$file $(abs_builddir
)/html
; \
82 chmod
-R u
+w
$(abs_builddir
)/tmpl
; } \
84 @touch setup-build.stamp
88 scan-build.stamp
: ts
$(HFILE_GLOB
) $(CFILE_GLOB
)
89 @ts1
=`cat ts`;ts2
=`date +%s.%N`;tsd
=`echo $$ts2-$$ts1 | bc`; \
90 echo
" DOC `date --utc --date @0$$tsd +%H:%M:%S.%N`: Scanning header files"
92 for i in
$(DOC_SOURCE_DIR
) ; do \
93 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
95 echo
"gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES
)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)" >gtkdoc-scan.log
; \
96 PATH
=$(abs_top_builddir
):$(PATH
) PERL5LIB
=$(abs_top_builddir
):$(PERL5LIB
) \
97 gtkdoc-scan
--module
=$(DOC_MODULE
) --ignore-headers
="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS
) $(EXTRA_HFILES
) 2>&1 | tee
-a gtkdoc-scan.log
98 @if grep
-l
'^..*$$' $(DOC_MODULE
).types
> /dev
/null
2>&1 ; then \
99 ts1
=`cat ts`;ts2
=`date +%s.%N`;tsd
=`echo $$ts2-$$ts1 | bc`; \
100 echo
" DOC `date --utc --date @0$$tsd +%H:%M:%S.%N`: Introspecting gobjects"; \
101 scanobj_options
=""; \
102 if
test "x$(V)" = "x1"; then \
103 scanobj_options
="--verbose"; \
105 echo
"gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) $$scanobj_options" >gtkdoc-scangobj.log
; \
106 PATH
=$(abs_top_builddir
):$(PATH
) PERL5LIB
=$(abs_top_builddir
):$(PERL5LIB
) \
107 CC
="$(GTKDOC_CC)" LD
="$(GTKDOC_LD)" RUN
="$(GTKDOC_RUN)" CFLAGS
="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS
="$(GTKDOC_LIBS) $(LDFLAGS)" \
108 gtkdoc-scangobj
$(SCANGOBJ_OPTIONS
) --module
=$(DOC_MODULE
) $$scanobj_options 2>&1 | tee
-a gtkdoc-scangobj.log
; \
110 for i in
$(SCANOBJ_FILES
) ; do \
111 test -f
$$i || touch
$$i ; \
114 @touch scan-build.stamp
116 $(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
: scan-build.stamp
121 tmpl-build.stamp
: setup-build.stamp
$(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
122 @ts1
=`cat ts`;ts2
=`date +%s.%N`;tsd
=`echo $$ts2-$$ts1 | bc`; \
123 echo
" DOC `date --utc --date @0$$tsd +%H:%M:%S.%N`: Rebuilding template files"
124 @echo
"gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)" >gtkdoc-mktmpl.log
; \
125 PATH
=$(abs_top_builddir
):$(PATH
) PERL5LIB
=$(abs_top_builddir
):$(PERL5LIB
) \
126 gtkdoc-mktmpl
--module
=$(DOC_MODULE
) $(MKTMPL_OPTIONS
) 2>&1 | tee
-a gtkdoc-mktmpl.log
127 @if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
128 if
test -w
$(abs_srcdir
) ; then \
129 cp
-rp
$(abs_builddir
)/tmpl
$(abs_srcdir
)/; \
132 @touch tmpl-build.stamp
134 tmpl.stamp
: tmpl-build.stamp
137 $(srcdir)/tmpl
/*.sgml
:
142 sgml-build.stamp
: tmpl.stamp
$(DOC_MODULE
)-sections.txt
$(srcdir)/tmpl
/*.sgml
$(expand_content_files
)
143 @ts1
=`cat ts`;ts2
=`date +%s.%N`;tsd
=`echo $$ts2-$$ts1 | bc`; \
144 echo
" DOC `date --utc --date @0$$tsd +%H:%M:%S.%N`: Building XML"
146 for i in
$(DOC_SOURCE_DIR
) ; do \
147 _source_dir
="$${_source_dir} --source-dir=$$i" ; \
149 echo
"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)" >gtkdoc-mkdb.log
; \
150 PATH
=$(abs_top_builddir
):$(PATH
) PERL5LIB
=$(abs_top_builddir
):$(PERL5LIB
) \
151 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
) 2>&1 | tee
-a gtkdoc-mkdb.log
152 @touch sgml-build.stamp
154 sgml.stamp
: sgml-build.stamp
159 html-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
160 @ts1
=`cat ts`;ts2
=`date +%s.%N`;tsd
=`echo $$ts2-$$ts1 | bc`; \
161 echo
" DOC `date --utc --date @00$$tsd +%H:%M:%S.%N`: Building HTML"
164 @mkhtml_options
=""; \
165 if
test "x$(V)" = "x1"; then \
166 mkhtml_options
="$$mkhtml_options --verbose"; \
168 echo
"gtkdoc-mkhtml --uninstalled --path="$(abs_srcdir
)" $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)" >gtkdoc-mkhtml.log
; \
169 cd html
&& PATH
=$(abs_top_builddir
):$(PATH
) PERL5LIB
=$(abs_top_builddir
):$(PERL5LIB
) ABS_TOP_SRCDIR
=$(abs_top_srcdir
) \
170 gtkdoc-mkhtml
--uninstalled
--path
="$(abs_srcdir)" $$mkhtml_options $(MKHTML_OPTIONS
) $(DOC_MODULE
) ..
/$(DOC_MAIN_SGML_FILE
) 2>&1 | tee
-a ..
/gtkdoc-mkhtml.log
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 @ts1
=`cat ts`;ts2
=`date +%s.%N`;tsd
=`echo $$ts2-$$ts1 | bc`; \
181 echo
" DOC `date --utc --date @0$$tsd +%H:%M:%S.%N`: Fixing cross-references"
182 @echo
"gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)" >gtkdoc-fixxref.log
; \
183 PATH
=$(abs_top_builddir
):$(PATH
) PERL5LIB
=$(abs_top_builddir
):$(PERL5LIB
) \
184 gtkdoc-fixxref
--module
=$(DOC_MODULE
) --module-dir
=html
--html-dir
=$(HTML_DIR
) $(FIXXREF_OPTIONS
) 2>&1 | tee
-a gtkdoc-fixxref.log
185 @touch html-build.stamp
189 pdf-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
190 @ts1
=`cat ts`;ts2
=`date +%s.%N`;tsd
=`echo $$ts2-$$ts1 | bc`; \
191 echo
" DOC `date --utc --date @0$$tsd +%H:%M:%S.%N`: Building PDF"
192 @
rm -f
$(DOC_MODULE
).pdf
194 if
test "x$(V)" = "x1"; then \
195 mkpdf_options
="$$mkpdf_options --verbose"; \
197 if
test "x$(HTML_IMAGES)" != "x"; then \
198 for img in
$(HTML_IMAGES
); do \
199 part
=`dirname $$img`; \
200 echo
$$mkpdf_options | grep
>/dev
/null
"\-\-imgdir=$$part "; \
201 if
test $$?
!= 0; then \
202 mkpdf_options
="$$mkpdf_options --imgdir=$$part"; \
206 echo
"gtkdoc-mkpdf --uninstalled --path="$(abs_srcdir
)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)" >gtkdoc-mkpdf.log
; \
207 PATH
=$(abs_top_builddir
):$(PATH
) PERL5LIB
=$(abs_top_builddir
):$(PERL5LIB
) ABS_TOP_SRCDIR
=$(abs_top_srcdir
) \
208 gtkdoc-mkpdf
--uninstalled
--path
="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE
) $(DOC_MAIN_SGML_FILE
) $(MKPDF_OPTIONS
) 2>&1 | tee
-a gtkdoc-mkpdf.log
209 @touch pdf-build.stamp
213 # we need to enforce a rebuild for the tests
217 $(MAKE
) distclean-local
220 @
rm -rf xml html
$(REPORT_FILES
) $(DOC_MODULE
).pdf \
221 $(DOC_MODULE
)-decl-list.txt
$(DOC_MODULE
)-decl.txt
222 @if
test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
223 rm -f
$(SETUP_FILES
) $(expand_content_files
) $(DOC_MODULE
).types
; \
227 maintainer-clean-local
:
230 .PHONY
: dist-hook-local docs