1 ###########################################################################
2 # Everything below here is generic and you shouldn't need to change it.
3 ###########################################################################
4 # thomas: except of course that we did
6 # thomas: copied from glib-2
7 # We set GPATH here; this gives us semantics for GNU make
8 # which are more like other make's VPATH, when it comes to
9 # whether a source that is a target of one rule is then
10 # searched for in VPATH/GPATH.
14 # thomas: make docs parallel installable
15 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@
21 $(DOC_MAIN_SGML_FILE) \
24 $(DOC_MODULE)-sections.txt
31 $(srcdir)/tmpl.stamp \
32 $(srcdir)/sgml.stamp \
37 $(DOC_MODULE).hierarchy \
38 $(DOC_MODULE).interfaces \
39 $(DOC_MODULE).prerequisites \
40 $(DOC_MODULE).signals \
41 .libs/$(DOC_MODULE)-scan.o
44 $(DOC_MODULE)-undocumented.txt \
45 $(DOC_MODULE)-undeclared.txt \
46 $(DOC_MODULE)-unused.txt
48 CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) doc-registry.xml
51 all-local: html-build.stamp
55 # in the case of non-srcdir builds, the built gst directory gets added
56 # to gtk-doc scanning; but only then, to avoid duplicates
57 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
58 @echo '*** Scanning header files ***'
59 if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null; \
61 if test x"$(srcdir)" != x. ; then \
62 cp $(srcdir)/$(DOC_MODULE).types . ; \
63 chmod u+w $(DOC_MODULE).types ; \
65 GST_PLUGIN_SYSTEM_PATH=`cd $(top_builddir) && pwd` \
67 GST_REGISTRY=doc-registry.xml \
68 $(GTKDOC_EXTRA_ENVIRONMENT) \
69 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
70 CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \
71 LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
72 gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \
73 --module=$(DOC_MODULE) ; \
76 for i in $(SCANOBJ_FILES) ; do \
77 test -f $$i || touch $$i ; \
80 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
82 export BUILT_OPTIONS="--source-dir=$(DOC_BUILD_DIR)"; \
85 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
86 --module=$(DOC_MODULE) \
87 --source-dir=$(DOC_SOURCE_DIR) \
89 --ignore-headers="$(IGNORE_HFILES)"
90 touch scan-build.stamp
92 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
97 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
98 @echo '*** Rebuilding template files ***'
99 if test x"$(srcdir)" != x. ; then \
100 cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
101 touch $(DOC_MODULE)-decl.txt ; \
103 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
104 @if test -s $(DOC_MODULE)-unused.txt; then \
105 echo "============================================================"; \
106 echo "Please add the following to $(DOC_MODULE)-sections.txt: "; \
107 cat $(DOC_MODULE)-unused.txt; \
108 echo "============================================================"; \
111 touch tmpl-build.stamp
113 tmpl.stamp: tmpl-build.stamp
118 ### FIXME: make this error out again when docs are complete
119 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(expand_content_files)
120 @echo '*** Building XML ***'
121 gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --expand-content-files="$(expand_content_files)" --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) | tee sgml-build.log
122 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
123 cp ../version.entities xml
125 touch sgml-build.stamp
127 sgml.stamp: sgml-build.stamp
132 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
133 @echo '*** Building HTML ***'
134 if test -d html; then rm -rf html; fi
136 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
137 @for f in $(content_files); do cp $(srcdir)/$$f html; done
139 cp ../version.entities html
140 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
141 mv html/index.sgml html/index.sgml.bak
142 $(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml
143 rm -f html/index.sgml.bak
144 rm -f html/$(DOC_MAIN_SGML_FILE)
146 rm -f html/version.entities
147 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
148 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
149 @echo '-- Fixing Crossreferences'
150 gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
151 touch html-build.stamp
155 # clean files copied for nonsrcdir templates build
156 if test x"$(srcdir)" != x. ; then \
157 rm -rf $(DOC_MODULE).types; \
164 clean-local: clean-local-gtkdoc
168 # company: don't delete .sgml and -sections.txt as they're in git
169 # FIXME : thomas added all sgml files and some other things to make
170 # make distcheck work
172 rm -f $(REPORT_FILES) \
173 $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
174 rm -rf tmpl/*.sgml.bak
175 rm -f $(DOC_MODULE).hierarchy
176 rm -f *.stamp || true
177 if test x"$(srcdir)" != x. ; then \
178 rm -f $(DOC_MODULE)-docs.sgml ; \
179 rm -f $(DOC_MODULE).types ; \
180 rm -f $(DOC_MODULE).interfaces ; \
181 rm -f $(DOC_MODULE)-overrides.txt ; \
182 rm -f $(DOC_MODULE).prerequisites ; \
183 rm -f $(DOC_MODULE)-sections.txt ; \
184 rm -rf tmpl/*.sgml ; \
188 maintainer-clean-local: clean
189 cd $(srcdir) && rm -rf html \
190 xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
192 # thomas: make docs parallel installable; devhelp requires majorminor too
194 (installfiles=`echo $(srcdir)/html/*.sgml $(srcdir)/html/*.html $(srcdir)/html/*.png $(srcdir)/html/*.css`; \
195 if test "$$installfiles" = '$(srcdir)/html/*.sgml $(srcdir)/html/*.html $(srcdir)/html/*.png $(srcdir)/html/*.css'; \
196 then echo '-- Nothing to install' ; \
198 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
199 for i in $$installfiles; do \
200 echo '-- Installing '$$i ; \
201 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
203 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
204 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
205 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
206 if test -e $(srcdir)/html/$(DOC_MODULE).devhelp2; then \
207 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp2 \
208 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
210 (which gtkdoc-rebase >/dev/null && \
211 gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR)) || true ; \
214 if test -d $(DESTDIR)$(TARGET_DIR); then \
215 rm -rf $(DESTDIR)$(TARGET_DIR)/*; \
216 rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \
218 echo '-- Nothing to uninstall' ; \
223 # Require gtk-doc when making dist
229 @echo "*** gtk-doc must be installed and enabled in order to make dist"
233 dist-hook: dist-check-gtkdoc dist-hook-local
234 mkdir $(distdir)/html
235 cp html/* $(distdir)/html
236 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
237 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
238 cd $(distdir) && rm -f $(DISTCLEANFILES)
239 -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
241 .PHONY : dist-hook-local docs