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) \
23 $(DOC_MODULE)-sections.txt
30 $(srcdir)/tmpl.stamp \
31 $(srcdir)/sgml.stamp \
36 $(DOC_MODULE).hierarchy \
37 $(DOC_MODULE).interfaces \
38 $(DOC_MODULE).prerequisites \
39 .libs/$(DOC_MODULE)-scan.o \
42 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
45 all-local: html-build.stamp
49 # in the case of non-srcdir builds, the built gst directory gets added
50 # to gtk-doc scanning; but only then, to avoid duplicates
51 scan-build.stamp: $(HFILE_GLOB) $(SCANOBJ_DEPS) $(basefiles)
52 @echo '*** Scanning header files ***'
53 if test x"$(srcdir)" != x. ; then \
54 cp $(srcdir)/$(DOC_MODULE).types . ; \
55 chmod u+w $(DOC_MODULE).types ; \
57 GST_PLUGIN_PATH=`cd $(top_builddir) && pwd` \
58 GST_PLUGIN_PATH_ONLY=1 \
59 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" \
60 CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" \
61 $(GST_DOC_SCANOBJ) --type-init-func="gst_init(NULL,NULL)" \
62 --module=$(DOC_MODULE) ; \
63 if test "x$(top_srcdir)" != "x$(top_builddir)"; \
65 export BUILT_OPTIONS="--source-dir=$(top_builddir)/gst"; \
68 $(SCAN_OPTIONS) $(EXTRA_HFILES) \
69 --module=$(DOC_MODULE) \
71 --ignore-headers="$(IGNORE_HFILES)"
72 touch scan-build.stamp
74 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
79 ### FIXME: make this error out again when docs are fixed for 0.9
80 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
81 @echo '*** Rebuilding template files ***'
82 if test x"$(srcdir)" != x. ; then \
83 cp $(srcdir)/$(DOC_MODULE)-sections.txt . ; \
84 touch $(DOC_MODULE)-decl.txt ; \
86 gtkdoc-mktmpl --module=$(DOC_MODULE) | tee tmpl-build.log
87 @cat $(DOC_MODULE)-unused.txt
88 @if ! test -z "`grep -v GstPoptOption $(DOC_MODULE)-unused.txt`"; then \
91 touch tmpl-build.stamp
93 tmpl.stamp: tmpl-build.stamp
98 ### FIXME: make this error out again when docs are fixed for 0.9
99 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB)
100 @echo '*** Building XML ***'
101 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
102 @if grep "WARNING:" sgml-build.log > /dev/null; then true; fi # exit 1; fi
104 touch sgml-build.stamp
106 sgml.stamp: sgml-build.stamp
111 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
112 @echo '*** Building HTML ***'
113 if test -d html; then rm -rf html; fi
115 cp $(srcdir)/$(DOC_MAIN_SGML_FILE) html
116 @for f in $(content_files); do cp $(srcdir)/$$f html; done
118 cp ../version.entities html
119 cd html && gtkdoc-mkhtml $(DOC_MODULE) $(DOC_MAIN_SGML_FILE)
120 rm -f html/$(DOC_MAIN_SGML_FILE)
122 rm -f html/version.entities
123 test "x$(HTML_IMAGES)" = "x" || for i in "" $(HTML_IMAGES) ; do \
124 if test "$$i" != ""; then cp $(srcdir)/$$i html ; fi; done
125 @echo '-- Fixing Crossreferences'
126 gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
127 touch html-build.stamp
137 maintainer-clean-local: clean
138 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
140 # company: don't delete .sgml and -sections.txt as they're in CVS
141 # FIXME : thomas added all sgml files and some other things to make
142 # make distcheck work
143 distclean-local: clean
144 rm -f $(DOC_MODULE)-decl-list.txt
145 rm -f $(DOC_MODULE)-decl.txt
146 rm -f $(DOC_MODULE)-undocumented.txt
147 rm -f $(DOC_MODULE)-unused.txt
148 rm -rf tmpl/*.sgml.bak
149 rm -f $(DOC_MODULE).hierarchy
150 rm -f *.stamp || true
151 if test x"$(srcdir)" != x. ; then \
152 rm -f $(DOC_MODULE)-docs.sgml ; \
153 rm -f $(DOC_MODULE).types ; \
154 rm -f $(DOC_MODULE).interfaces ; \
155 rm -f $(DOC_MODULE)-overrides.txt ; \
156 rm -f $(DOC_MODULE).prerequisites ; \
157 rm -f $(DOC_MODULE)-sections.txt ; \
158 rm -rf tmpl/*.sgml ; \
162 # thomas: make docs parallel installable; devhelp requires majorminor too
164 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
165 (installfiles=`echo ./html/*.html`; \
166 if test "$$installfiles" = './html/*.html'; \
167 then echo '-- Nothing to install' ; \
169 for i in $$installfiles; do \
170 echo '-- Installing '$$i ; \
171 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
173 pngfiles=`echo ./html/*.png`; \
174 if test "$$pngfiles" != './html/*.png'; then \
175 for i in $$pngfiles; do \
176 echo '-- Installing '$$i ; \
177 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
180 echo '-- Installing $(srcdir)/html/$(DOC_MODULE).devhelp' ; \
181 $(INSTALL_DATA) $(srcdir)/html/$(DOC_MODULE).devhelp \
182 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
183 echo '-- Installing $(srcdir)/html/index.sgml' ; \
184 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
185 if test -e $(srcdir)/html/style.css; then \
186 echo '-- Installing $(srcdir)/html/style.css' ; \
187 $(INSTALL_DATA) $(srcdir)/html/style.css $(DESTDIR)$(TARGET_DIR); \
191 (installfiles=`echo ./html/*.html`; \
192 if test "$$installfiles" = './html/*.html'; \
193 then echo '-- Nothing to uninstall' ; \
195 for i in $$installfiles; do \
196 rmfile=`basename $$i` ; \
197 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
198 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
200 pngfiles=`echo ./html/*.png`; \
201 if test "$$pngfiles" != './html/*.png'; then \
202 for i in $$pngfiles; do \
203 rmfile=`basename $$i` ; \
204 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/'$$rmfile ; \
205 rm -f $(DESTDIR)$(TARGET_DIR)/$$rmfile; \
208 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE).devhelp' ; \
209 rm -f $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_MAJORMINOR@.devhelp; \
210 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/index.sgml' ; \
211 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
212 if test -e $(DESTDIR)$(TARGET_DIR)/style.css; then \
213 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)/style.css' ; \
214 rm -f $(DESTDIR)$(TARGET_DIR)/style.css; \
217 if test -d $(DESTDIR)$(TARGET_DIR); then rmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(TARGET_DIR) 2>/dev/null; fi; true
220 # Require gtk-doc when making dist
226 @echo "*** gtk-doc must be installed and enabled in order to make dist"
230 dist-hook: dist-check-gtkdoc dist-hook-local
231 mkdir $(distdir)/tmpl
233 mkdir $(distdir)/html
234 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
235 -cp $(srcdir)/sgml/*.xml $(distdir)/xml
236 -cp $(srcdir)/html/index.sgml $(distdir)/html
237 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
238 -cp $(srcdir)/html/$(DOC_MODULE).devhelp $(distdir)/html
240 images=$(HTML_IMAGES) ; \
241 for i in "" $$images ; do \
242 if test "$$i" != ""; then cp $(srcdir)/$$i $(distdir)/html ; fi; \
245 .PHONY : dist-hook-local