1########################################################################### 2# Everything below here is generic and you shouldn't need to change it. 3########################################################################### 4# thomas: except of course that we did 5 6if GTK_DOC_USE_LIBTOOL 7GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 8GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) 9GTKDOC_RUN = $(LIBTOOL) --mode=execute 10else 11GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 12GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) 13GTKDOC_RUN = 14endif 15 16# We set GPATH here; this gives us semantics for GNU make 17# which are more like other make's VPATH, when it comes to 18# whether a source that is a target of one rule is then 19# searched for in VPATH/GPATH. 20# 21GPATH = $(srcdir) 22 23# thomas: make docs parallel installable 24TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)-@GST_API_VERSION@ 25 26EXTRA_DIST = \ 27 $(content_files) \ 28 $(extra_files) \ 29 $(HTML_IMAGES) \ 30 $(DOC_MAIN_SGML_FILE) \ 31 $(DOC_MODULE).types \ 32 $(DOC_OVERRIDES) \ 33 $(DOC_MODULE)-sections.txt 34 35DOC_STAMPS = \ 36 setup-build.stamp \ 37 scan-build.stamp \ 38 sgml-build.stamp \ 39 html-build.stamp \ 40 sgml.stamp \ 41 html.stamp 42 43SCANOBJ_FILES = \ 44 $(DOC_MODULE).args \ 45 $(DOC_MODULE).hierarchy \ 46 $(DOC_MODULE).interfaces \ 47 $(DOC_MODULE).prerequisites \ 48 $(DOC_MODULE).signals \ 49 .libs/$(DOC_MODULE)-scan.o 50 51REPORT_FILES = \ 52 $(DOC_MODULE)-undocumented.txt \ 53 $(DOC_MODULE)-undeclared.txt \ 54 $(DOC_MODULE)-unused.txt 55 56CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) doc-registry.xml 57 58if ENABLE_GTK_DOC 59all-local: html-build.stamp 60 61#### setup #### 62 63setup-build.stamp: $(content_files) 64 -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ 65 echo ' DOC Preparing build'; \ 66 files=`echo $(DOC_MAIN_SGML_FILE) $(DOC_OVERRIDES) $(DOC_MODULE)-sections.txt $(DOC_MODULE).types $(content_files)`; \ 67 if test "x$$files" != "x" ; then \ 68 for file in $$files ; do \ 69 test -f $(abs_srcdir)/$$file && \ 70 cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ 71 done; \ 72 fi; \ 73 fi 74 @touch setup-build.stamp 75 76#### scan #### 77 78# in the case of non-srcdir builds, the built gst directory gets added 79# to gtk-doc scanning; but only then, to avoid duplicates 80scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) 81 @echo ' DOC Scanning header files' 82 @_source_dir='' ; \ 83 for i in $(DOC_SOURCE_DIR) ; do \ 84 _source_dir="$${_source_dir} --source-dir=$$i" ; \ 85 done ; \ 86 gtkdoc-scan \ 87 $(SCAN_OPTIONS) $(EXTRA_HFILES) \ 88 --module=$(DOC_MODULE) \ 89 $${_source_dir} \ 90 --ignore-headers="$(IGNORE_HFILES)" 91 @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null; then \ 92 echo " DOC Introspecting gobjects"; \ 93 scanobj_options=""; \ 94 gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ 95 if test "$$?" = "0"; then \ 96 if test "x$(V)" = "x1"; then \ 97 scanobj_options="--verbose"; \ 98 fi; \ 99 fi; \ 100 GST_PLUGIN_SYSTEM_PATH_1_0=`cd $(top_builddir) && pwd` \ 101 GST_PLUGIN_PATH_1_0= \ 102 GST_REGISTRY_1_0=doc-registry.xml \ 103 $(GTKDOC_EXTRA_ENVIRONMENT) \ 104 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" \ 105 CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" \ 106 LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ 107 gtkdoc-scangobj --type-init-func="gst_init(NULL,NULL)" \ 108 $$scanobj_options --module=$(DOC_MODULE) ; \ 109 else \ 110 for i in $(SCANOBJ_FILES) ; do \ 111 $(MKDIR_P) $(dirname $$i) ; \ 112 test -f $$i || touch $$i ; \ 113 done \ 114 fi 115 @touch scan-build.stamp 116 117$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp 118 @true 119 120#### xml #### 121 122sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(expand_content_files) 123 @echo ' DOC Building XML' 124 @_source_dir='' ; \ 125 for i in $(DOC_SOURCE_DIR) ; do \ 126 _source_dir="$${_source_dir} --source-dir=$$i" ; \ 127 done ; \ 128 gtkdoc-mkdb --module=$(DOC_MODULE) $${_source_dir} --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) --output-format=xml $(MKDB_OPTIONS) 129 @cp ../version.entities xml 130 @touch sgml-build.stamp 131 132sgml.stamp: sgml-build.stamp 133 @true 134 135#### html #### 136 137html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) 138 @echo ' DOC Building HTML' 139 @rm -rf html 140 @mkdir html 141 @cp -pr xml html 142 @cp ../version.entities ./ 143 @mkhtml_options=""; \ 144 gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ 145 if test "$(?)" = "0"; then \ 146 if test "x$(V)" = "x1"; then \ 147 mkhtml_options="$$mkhtml_options --verbose"; \ 148 fi; \ 149 fi; \ 150 @gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ 151 if test "$(?)" = "0"; then \ 152 mkhtml_options=--path="$(abs_srcdir)"; \ 153 fi; \ 154 cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE)-@GST_API_VERSION@ ../$(DOC_MAIN_SGML_FILE) 155 @rm -rf html/xml 156 @rm -f version.entities 157 @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html ) 158 @echo ' DOC Fixing cross-references' 159 @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) 160 @touch html-build.stamp 161 162clean-local-gtkdoc: 163 @rm -rf xml tmpl html 164# clean files copied for nonsrcdir templates build 165 @if test x"$(srcdir)" != x. ; then \ 166 rm -rf $(DOC_MODULE).types; \ 167 fi 168else 169all-local: 170clean-local-gtkdoc: 171endif 172 173clean-local: clean-local-gtkdoc 174 @rm -f *~ *.bak 175 @rm -rf .libs 176 177distclean-local: 178 @rm -f $(REPORT_FILES) \ 179 $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt 180 @rm -rf tmpl/*.sgml.bak 181 @rm -f $(DOC_MODULE).hierarchy 182 @rm -f *.stamp || true 183 @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ 184 rm -f $(DOC_MAIN_SGML_FILE) ; \ 185 rm -f $(DOC_OVERRIDES) ; \ 186 rm -f $(DOC_MODULE).types ; \ 187 rm -f $(DOC_MODULE).interfaces ; \ 188 rm -f $(DOC_MODULE).prerequisites ; \ 189 rm -f $(DOC_MODULE)-sections.txt ; \ 190 rm -f $(content_files) ; \ 191 rm -rf tmpl/*.sgml ; \ 192 fi 193 @rm -rf *.o 194 195maintainer-clean-local: clean 196 @cd $(srcdir) && rm -rf html \ 197 xml $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt 198 199# thomas: make docs parallel installable; devhelp requires majorminor too 200install-data-local: 201 (installfiles=`echo $(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css`; \ 202 if test "$$installfiles" = '$(builddir)/html/*.sgml $(builddir)/html/*.html $(builddir)/html/*.png $(builddir)/html/*.css'; \ 203 then echo '-- Nothing to install' ; \ 204 else \ 205 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ 206 for i in $$installfiles; do \ 207 echo '-- Installing '$$i ; \ 208 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ 209 done; \ 210 echo '-- Installing $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2' ; \ 211 if test -e $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; then \ 212 $(INSTALL_DATA) $(builddir)/html/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2 \ 213 $(DESTDIR)$(TARGET_DIR)/$(DOC_MODULE)-@GST_API_VERSION@.devhelp2; \ 214 fi; \ 215 $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) || true ; \ 216 fi) 217uninstall-local: 218 if test -d $(DESTDIR)$(TARGET_DIR); then \ 219 rm -rf $(DESTDIR)$(TARGET_DIR)/*; \ 220 rmdir -p $(DESTDIR)$(TARGET_DIR) 2>/dev/null || true; \ 221 else \ 222 echo '-- Nothing to uninstall' ; \ 223 fi; 224 225 226# 227# Require gtk-doc when making dist 228# 229if ENABLE_GTK_DOC 230dist-check-gtkdoc: 231else 232dist-check-gtkdoc: 233 @echo "*** gtk-doc must be installed and enabled in order to make dist" 234 @false 235endif 236 237dist-hook: dist-check-gtkdoc dist-hook-local 238 mkdir $(distdir)/html 239 cp html/* $(distdir)/html 240 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ 241 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ 242 cd $(distdir) && rm -f $(DISTCLEANFILES) 243 -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html 244 245.PHONY : dist-hook-local docs 246 247# avoid spurious build errors when distchecking with -jN 248.NOTPARALLEL: 249