Updated Spanish translation
[gtk-doc.git] / gtk-doc.make
blob14d95e8ea4d2206e4d4a9cd1087b3d9f7e6e1d73
1 # -*- mode: makefile -*-
3 ####################################
4 # Everything below here is generic #
5 ####################################
7 if GTK_DOC_USE_LIBTOOL
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
11 else
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)
14 GTKDOC_RUN =
15 endif
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.
22 GPATH = $(srcdir)
24 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
26 SETUP_FILES = \
27 $(content_files) \
28 $(DOC_MAIN_SGML_FILE) \
29 $(DOC_MODULE)-sections.txt \
30 $(DOC_MODULE)-overrides.txt
32 EXTRA_DIST = \
33 $(HTML_IMAGES) \
34 $(SETUP_FILES)
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
40 SCANOBJ_FILES = \
41 $(DOC_MODULE).args \
42 $(DOC_MODULE).hierarchy \
43 $(DOC_MODULE).interfaces \
44 $(DOC_MODULE).prerequisites \
45 $(DOC_MODULE).signals
47 REPORT_FILES = \
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" >> $@; \
55 chmod +x $@
57 CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test
59 if ENABLE_GTK_DOC
60 if GTK_DOC_BUILD_HTML
61 HTML_BUILD_STAMP=html-build.stamp
62 else
63 HTML_BUILD_STAMP=
64 endif
65 if GTK_DOC_BUILD_PDF
66 PDF_BUILD_STAMP=pdf-build.stamp
67 else
68 PDF_BUILD_STAMP=
69 endif
71 all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
72 else
73 all-local:
74 endif
76 docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
78 $(REPORT_FILES): sgml-build.stamp
80 #### setup ####
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";
86 setup-build.stamp:
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; \
93 done; \
94 fi; \
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
101 #### scan ####
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" ; \
115 done ; \
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"; \
123 fi; \
124 fi; \
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); \
127 else \
128 for i in $(SCANOBJ_FILES) ; do \
129 test -f $$i || touch $$i ; \
130 done \
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
135 @true
137 #### templates ####
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)/; \
148 fi \
150 $(AM_V_at)touch tmpl-build.stamp
152 tmpl.stamp: tmpl-build.stamp
153 @true
155 $(srcdir)/tmpl/*.sgml:
156 @true
158 #### xml ####
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" ; \
168 done ; \
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
173 @true
175 #### html ####
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 && \
187 mkhtml_options=""; \
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"; \
192 fi; \
193 fi; \
194 gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
195 if test "$(?)" = "0"; then \
196 mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
197 fi; \
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; \
203 fi; \
204 if test -f $(abs_builddir)/$$file ; then \
205 cp $(abs_builddir)/$$file $(abs_builddir)/html; \
206 fi; \
207 done;
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
211 #### pdf ####
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 && \
219 mkpdf_options=""; \
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"; \
224 fi; \
225 fi; \
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"; \
232 fi; \
233 done; \
234 fi; \
235 gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
236 $(AM_V_at)touch pdf-build.stamp
238 ##############
240 clean-local:
241 @rm -f *~ *.bak
242 @rm -rf .libs
244 distclean-local:
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; \
249 rm -rf tmpl; \
252 maintainer-clean-local:
253 @rm -rf xml html
255 install-data-local:
256 @installfiles=`echo $(builddir)/html/*`; \
257 if test "$$installfiles" = '$(builddir)/html/*'; \
258 then echo 1>&2 'Nothing to install' ; \
259 else \
260 if test -n "$(DOC_MODULE_VERSION)"; then \
261 installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
262 else \
263 installdir="$(DESTDIR)$(TARGET_DIR)"; \
264 fi; \
265 $(mkinstalldirs) $${installdir} ; \
266 for i in $$installfiles; do \
267 echo ' $(INSTALL_DATA) '$$i ; \
268 $(INSTALL_DATA) $$i $${installdir}; \
269 done; \
270 if test -n "$(DOC_MODULE_VERSION)"; then \
271 mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
272 $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
273 fi; \
274 $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
277 uninstall-local:
278 @if test -n "$(DOC_MODULE_VERSION)"; then \
279 installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
280 else \
281 installdir="$(DESTDIR)$(TARGET_DIR)"; \
282 fi; \
283 rm -rf $${installdir}
286 # Require gtk-doc when making dist
288 if ENABLE_GTK_DOC
289 dist-check-gtkdoc: docs
290 else
291 dist-check-gtkdoc:
292 @echo "*** gtk-doc must be installed and enabled in order to make dist"
293 @false
294 endif
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