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)
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 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
68 CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \
69 LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
70 gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \
71 --module=$(DOC_MODULE) ; \
74 for i in $(SCANOBJ_FILES) ; do \
75 test -f $$i || touch $$i ; \
78 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
80 export BUILT_OPTIONS="--source-dir=$(DOC_BUILD_DIR)"; \
83 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
84 --module=$(DOC_MODULE) \
85 --source-dir=$(DOC_SOURCE_DIR) \
87 --ignore-headers="$(IGNORE_HFILES)"
88 touch scan-build.stamp
90 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
95 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
96 @echo '*** Rebuilding template files ***'
97 if test x"$(srcdir)" != x. ; then \
98 cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
99 touch $(DOC_MODULE)-decl.txt ; \
101 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
102 @if test -s $(DOC_MODULE)-unused.txt; then \
103 exit $(if $(DOCS_ARE_INCOMPLETE_PLEASE_FIXME),0,1); fi
105 touch tmpl-build.stamp
107 tmpl.stamp: tmpl-build.stamp
112 ### FIXME: make this error out again when docs are complete
113 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB)
114 @echo '*** Building XML ***'
115 gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --main-sgml-file=$(srcdir)/$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) | tee sgml-build.log
116 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
118 touch sgml-build.stamp
120 sgml.stamp: sgml-build.stamp
125 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
126 @echo '*** Building HTML ***'
127 if test -d html; then rm -rf html; fi
129 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
130 @for f in $(content_files); do cp $(srcdir)/$$f html; done
132 cp ../version.entities html
133 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
134 mv html/index.sgml html/index.sgml.bak
135 $(SED) "s/ href=\"$(DOC_MODULE)\// href=\"$(DOC_MODULE)-@GST_MAJORMINOR@\//g" html/index.sgml.bak >html/index.sgml
136 rm -f html/index.sgml.bak
137 rm -f html/$(DOC_MAIN_SGML_FILE)
139 rm -f html/version.entities
140 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
141 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
142 @echo '-- Fixing Crossreferences'
143 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
144 touch html-build.stamp
148 # clean files copied for nonsrcdir templates build
149 if test x"$(srcdir)" != x. ; then \
150 rm -rf $(DOC_MODULE).types; \
157 clean-local: clean-local-gtkdoc
161 # company: don't delete .sgml and -sections.txt as they're in CVS
162 # FIXME : thomas added all sgml files and some other things to make
163 # make distcheck work
164 distclean-local: clean
165 rm -f $(REPORT_FILES) \
166 $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
167 rm -rf tmpl/*.sgml.bak
168 rm -f $(DOC_MODULE).hierarchy
169 rm -f *.stamp || true
170 if test x"$(srcdir)" != x. ; then \
171 rm -f $(DOC_MODULE)-docs.sgml ; \
172 rm -f $(DOC_MODULE).types ; \
173 rm -f $(DOC_MODULE).interfaces ; \
174 rm -f $(DOC_MODULE)-overrides.txt ; \
175 rm -f $(DOC_MODULE).prerequisites ; \
176 rm -f $(DOC_MODULE)-sections.txt ; \
177 rm -rf tmpl/*.sgml ; \
181 maintainer-clean-local: clean
182 cd $(srcdir) && rm -rf html \
183 xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
185 # thomas: make docs parallel installable; devhelp requires majorminor too
187 (installfiles=`echo $(srcdir)/html/*.sgml $(srcdir)/html/*.html $(srcdir)/html/*.png $(srcdir)/html/*.css`; \
188 if test "$$installfiles" = '$(srcdir)/html/*.sgml $(srcdir)/html/*.html $(srcdir)/html/*.png $(srcdir)/html/*.css'; \
189 then echo '-- Nothing to install' ; \
191 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
192 for i in $$installfiles; do \
193 echo '-- Installing '$$i ; \
194 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
196 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
197 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
198 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
199 if test -e $(srcdir)/html/$(DOC_MODULE).devhelp2; then \
200 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp2 \
201 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
203 which gtkdoc-rebase >/dev/null && \
204 gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \
207 (installfiles=`echo ./html/*.html`; \
208 if test "$$installfiles" = './html/*.html'; \
209 then echo '-- Nothing to uninstall' ; \
211 for i in $$installfiles; do \
212 rmfile=`basename $$i` ; \
213 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
214 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
216 pngfiles=`echo ./html/*.png`; \
217 if test "$$pngfiles" != './html/*.png'; then \
218 for i in $$pngfiles; do \
219 rmfile=`basename $$i` ; \
220 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
221 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
224 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
225 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
226 if test -e $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; then \
227 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
229 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
230 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
231 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
232 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
233 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
236 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
239 # Require gtk-doc when making dist
245 @echo "*** gtk-doc must be installed and enabled in order to make dist"
249 dist-hook: dist-check-gtkdoc dist-hook-local
250 mkdir $(distdir)/html
251 cp $(srcdir)/html/* $(distdir)/html
252 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
253 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
254 cd $(distdir) && rm -f $(DISTCLEANFILES)
255 -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
257 .PHONY : dist-hook-local docs