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 .libs/$(DOC_MODULE)-scan.o \
43 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
46 all-local: html-build.stamp
50 # in the case of non-srcdir builds, the built gst directory gets added
51 # to gtk-doc scanning; but only then, to avoid duplicates
52 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
53 @echo '*** Scanning header files ***'
54 if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null; \
56 if test x"$(srcdir)" != x. ; then \
57 cp $(srcdir)/$(DOC_MODULE).types . ; \
58 chmod u+w $(DOC_MODULE).types ; \
60 GST_PLUGIN_SYSTEM_PATH=`cd $(top_builddir) && pwd` \
62 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
63 CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" \
64 gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \
65 --module=$(DOC_MODULE) ; \
68 for i in $(SCANOBJ_FILES) ; do \
69 test -f $$i || touch $$i ; \
72 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
74 export BUILT_OPTIONS="--source-dir=$(DOC_BUILD_DIR)"; \
77 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
78 --module=$(DOC_MODULE) \
79 --source-dir=$(DOC_SOURCE_DIR) \
81 --ignore-headers="$(IGNORE_HFILES)"
82 touch scan-build.stamp
84 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
89 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
90 @echo '*** Rebuilding template files ***'
91 if test x"$(srcdir)" != x. ; then \
92 cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
93 touch $(DOC_MODULE)-decl.txt ; \
95 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
96 @if test -s $(DOC_MODULE)-unused.txt; then \
97 exit $(if $(DOCS_ARE_INCOMPLETE_PLEASE_FIXME),0,1); fi
99 touch tmpl-build.stamp
101 tmpl.stamp: tmpl-build.stamp
106 ### FIXME: make this error out again when docs are fixed for 0.9
107 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB)
108 @echo '*** Building XML ***'
109 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
110 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
112 touch sgml-build.stamp
114 sgml.stamp: sgml-build.stamp
119 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
120 @echo '*** Building HTML ***'
121 if test -d html; then rm -rf html; fi
123 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
124 @for f in $(content_files); do cp $(srcdir)/$$f html; done
126 cp ../version.entities html
127 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
128 rm -f html/$(DOC_MAIN_SGML_FILE)
130 rm -f html/version.entities
131 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
132 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
133 @echo '-- Fixing Crossreferences'
134 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
135 touch html-build.stamp
145 maintainer-clean-local: clean
146 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
148 # company: don't delete .sgml and -sections.txt as they're in CVS
149 # FIXME : thomas added all sgml files and some other things to make
150 # make distcheck work
151 distclean-local: clean
152 rm -f $(DOC_MODULE)-decl-list.txt
153 rm -f $(DOC_MODULE)-decl.txt
154 rm -f $(DOC_MODULE)-undocumented.txt
155 rm -f $(DOC_MODULE)-unused.txt
156 rm -rf tmpl/*.sgml.bak
157 rm -f $(DOC_MODULE).hierarchy
158 rm -f *.stamp || true
159 if test x"$(srcdir)" != x. ; then \
160 rm -f $(DOC_MODULE)-docs.sgml ; \
161 rm -f $(DOC_MODULE).types ; \
162 rm -f $(DOC_MODULE).interfaces ; \
163 rm -f $(DOC_MODULE)-overrides.txt ; \
164 rm -f $(DOC_MODULE).prerequisites ; \
165 rm -f $(DOC_MODULE)-sections.txt ; \
166 rm -rf tmpl/*.sgml ; \
170 # thomas: make docs parallel installable; devhelp requires majorminor too
172 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
173 (installfiles=`echo ./html/*.html`; \
174 if test "$$installfiles" = './html/*.html'; \
175 then echo '-- Nothing to install' ; \
177 for i in $$installfiles; do \
178 echo '-- Installing '$$i ; \
179 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
181 pngfiles=`echo ./html/*.png`; \
182 if test "$$pngfiles" != './html/*.png'; then \
183 for i in $$pngfiles; do \
184 echo '-- Installing '$$i ; \
185 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
188 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
189 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
190 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
191 if test -e $(srcdir)/html/$(DOC_MODULE).devhelp2; then \
192 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp2 \
193 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
195 echo '-- Installing $(srcdir)/html/index.sgml' ; \
196 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
197 if test -e $(srcdir)/html/style.css; then \
198 echo '-- Installing $(srcdir)/html/style.css' ; \
199 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
203 (installfiles=`echo ./html/*.html`; \
204 if test "$$installfiles" = './html/*.html'; \
205 then echo '-- Nothing to uninstall' ; \
207 for i in $$installfiles; do \
208 rmfile=`basename $$i` ; \
209 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
210 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
212 pngfiles=`echo ./html/*.png`; \
213 if test "$$pngfiles" != './html/*.png'; then \
214 for i in $$pngfiles; do \
215 rmfile=`basename $$i` ; \
216 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
217 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
220 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
221 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
222 if test -e $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; then \
223 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp2; \
225 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
226 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
227 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
228 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
229 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
232 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
235 # Require gtk-doc when making dist
241 @echo "*** gtk-doc must be installed and enabled in order to make dist"
245 dist-hook: dist-check-gtkdoc dist-hook-local
246 mkdir $(distdir)/tmpl
248 mkdir $(distdir)/html
249 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
250 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
251 -cp $(srcdir)/html/index.sgml $(distdir)/html
252 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
253 -cp $(srcdir)/html/$(DOC_MODULE).devhelp* $(distdir)/html
255 images=$(HTML_IMAGES) ; \
256 for i in "" $$images ; do \
257 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
260 .PHONY : dist-hook-local