docs: manual: fix formatting
[platform/upstream/gstreamer.git] / docs / manuals.mak
index b563378..c0fec85 100644 (file)
@@ -1,8 +1,3 @@
-# rewritten by Thomas to be more simple and working
-
-# SF username
-USERNAME ?= thomasvs
-
 ### These are all generic; we set all the variables we need
 
 # intermediary build path
@@ -27,14 +22,14 @@ PNG_BUILT = $(foreach file, $(PNG), $(BUILDIMAGESDIR)/$(file))
 EPS_BUILT = $(foreach file, $(EPS), $(BUILDIMAGESDIR)/$(file))
 PDF_BUILT = $(foreach file, $(PDF), $(BUILDIMAGESDIR)/$(file))
 
-# everything considered source
-SRC = $(XML) $(PNG_SRC) $(FIG_SRC) $(CSS)
+SRC = $(XML) $(PNG_SRC) $(FIG_SRC) $(CSS) $(EXTRA_SRC)
 
 # generate A4 docs
 PAPER_LOCALE = nl_NL
 
 ### generate all documentation by default
-all: html ps pdf
+# hook in html generation
+all-local: html
 
 # can we generate HTML ?
 if     DOC_HTML
@@ -84,18 +79,20 @@ debug:
        @echo "PDF_DAT:  '$(PDF_DAT)'"
 
 # a rule to copy all of the source for docs into $(builddir)/build
-$(BUILDDIR)/$(MAIN): $(XML) $(CSS)
-       @-mkdir -p $(BUILDDIR)
-       @for a in $(XML); do cp $(srcdir)/$$a $(BUILDDIR); done
-       @for a in $(CSS); do cp $(srcdir)/$$a $(BUILDDIR); done
-       @cp ../version.entities $(BUILDDIR)
+$(BUILDDIR)/$(MAIN): $(XML) $(CSS) $(EXTRA_SRC)
+       @-mkdir -p $(BUILDDIR); \
+       if test "x$(EXTRA_SRC)" != "x"; then for a in $(EXTRA_SRC); do cp $(srcdir)/$$a $(BUILDDIR); done; fi ; \
+       for a in $(XML); do cp $(srcdir)/$$a $(BUILDDIR); done ; \
+       for a in $(CSS); do cp $(srcdir)/$$a $(BUILDDIR); done ; \
+       cp ../version.entities $(BUILDDIR) ; \
+       cp $(top_srcdir)/docs/url.entities $(BUILDDIR)
 
 html/index.html: $(BUILDDIR)/$(MAIN) $(PNG_BUILT) $(FIG_SRC)
-       @make check-local
+       @$(MAKE) check-local
        @echo "*** Generating HTML output ***"
        @-mkdir -p html
        @cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
-       @cd $(BUILDDIR) && docbook2html -o ../html -V '%use-id-as-filename%' $(MAIN)
+       @cd $(BUILDDIR) && $(XSLTPROC) -o ../html/ --stringparam chunker.output.encoding UTF-8 --stringparam  use.id.as.filename 1 $(XSLTPROC_FLAGS) "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl" $(MAIN)
        @test "x$(CSS)" != "x" && \
           echo "Copying .css files: $(CSS)" && \
           cp $(srcdir)/$(CSS) html
@@ -105,14 +102,14 @@ html/index.html: $(BUILDDIR)/$(MAIN) $(PNG_BUILT) $(FIG_SRC)
           cp $(PNG_BUILT) html/images || true
 
 $(DOC).ps: $(BUILDDIR)/$(MAIN) $(EPS_BUILT) $(PNG_SRC) $(FIG_SRC)
-       @make check-local
+       @$(MAKE) check-local
        @echo "*** Generating PS output ***"
        @cp -f $(srcdir)/../image-eps $(BUILDDIR)/image.entities
-       cd $(BUILDDIR) && docbook2ps -o .. $(MAIN)
+       cd $(BUILDDIR) && SP_ENCODING="UTF-8" docbook2ps -o .. $(MAIN)
 #      export LC_PAPER=$(PAPER_LOCALE) && cd $(BUILDDIR) && xmlto ps -o .. $(MAIN)
 
 $(DOC).pdf: $(DOC).ps
-       @make check-local
+       @$(MAKE) check-local
        @echo "*** Generating PDF output ***"
        @ps2pdf $(DOC).ps
 
@@ -169,4 +166,21 @@ $(BUILDIMAGESDIR)/%.ps: %.png
 # make sure xml validates properly
 check-local: $(BUILDDIR)/$(MAIN)
        @cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
-       cd $(BUILDDIR) && xmllint -noout -valid $(MAIN)
+       @cd $(BUILDDIR) && xmllint -noout -valid $(MAIN)
+       @cd $(BUILDDIR) && \
+       if [ `which curl` ]; then \
+    links=`$(XSLTPROC) $(XSLTPROC_FLAGS) --xinclude $(abs_top_srcdir)/docs/list-ulink.xsl $(MAIN) | egrep '^http' | sort | uniq` && \
+    have_error=0 && \
+    for link in $$links; do \
+      code=`curl -s -m20 -o /dev/null -I -w "%{http_code}" $$link`; \
+      if [ \( $$? -ne 0 \) -o \( $$code -gt 399 \) ]; then \
+        echo "exit_status=$$?, http_code=$$code: $$link"; \
+        grep -Hnr "$$link" .; \
+        have_error=1; \
+      fi; \
+    done \
+  fi
+
+# avoid 'cp: cannot create regular file `build/image.entities': File exists'
+# errors during 'make distcheck' by disabling parallel builds
+.NOTPARALLEL: