-# 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
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
HTML_DAT = html
-html: html/index.html
+HTML_TARGET = html/index.html
else #!DOC_HTML
HTML_DAT =
-html:
+HTML_TARGET =
endif #DOC_HTML
+html: $(HTML_TARGET)
# can we generate PS ?
if DOC_PS
PS_DAT = $(DOC).ps
-ps: $(DOC).ps
else #!DOC_PS
PS_DAT =
-ps:
endif #DOC_PS
+ps: $(PS_DAT)
# can we generate PDF ?
if DOC_PDF
PDF_DAT = $(DOC).pdf
-pdf: $(DOC).pdf
else #!DOC_PDF
PDF_DAT =
-pdf:
endif #DOC_PDF
+pdf: $(PDF_DAT)
debug:
@echo "outputting some useful debug information"
@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)
+
+# we should switch to xsltproc
+# docbook2html aka jade can't add the encoding easily to the html meta
+# (but we are lazy and just abuse sed to add it)
+# jw -f docbook -b html -d pwg.dsl -o ../html -V '%use-id-as-filename%' $(MAIN)
+# this is a starting point
+# xsltproc --nonet /usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl pwg.xml
+#
html/index.html: $(BUILDDIR)/$(MAIN) $(PNG_BUILT) $(FIG_SRC)
+ @$(MAKE) check-local
@echo "*** Generating HTML output ***"
@-mkdir -p html
- @cp $(srcdir)/../image-png $(BUILDDIR)/image.entities
- @cd $(BUILDDIR) && xmlto html -o ../html $(MAIN)
+ @cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
+ @cd $(BUILDDIR) && SP_ENCODING="UTF-8" docbook2html -o ../html -V '%use-id-as-filename%' $(MAIN)
+ @$(SED) -i -e 's/\(^CONTENT.*\)\(.>\)/\1;charset=UTF-8\2/' html/*html
@test "x$(CSS)" != "x" && \
echo "Copying .css files: $(CSS)" && \
cp $(srcdir)/$(CSS) html
cp $(PNG_BUILT) html/images || true
$(DOC).ps: $(BUILDDIR)/$(MAIN) $(EPS_BUILT) $(PNG_SRC) $(FIG_SRC)
+ @$(MAKE) check-local
@echo "*** Generating PS output ***"
- @cp $(srcdir)/../image-eps $(BUILDDIR)/image.entities
- export LC_PAPER=$(PAPER_LOCALE) && cd $(BUILDDIR) && xmlto ps -o .. $(MAIN)
+ @cp -f $(srcdir)/../image-eps $(BUILDDIR)/image.entities
+ 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
@echo "*** Generating PDF output ***"
@ps2pdf $(DOC).ps
#$(DOC).pdf: $(MAIN) $(PDF) $(FIG_SRC)
# @echo "*** Generating PDF output ***"
-# @cp $(srcdir)/../image-pdf image.entities
+# @cp -f $(srcdir)/../image-pdf image.entities
# @export LC_PAPER=$(PAPER_LOCALE) && xmlto pdf $(MAIN)
# @rm image.entities
@cat $< | pngtopnm | pnmtops -noturn > $@ 2> /dev/null
# make sure xml validates properly
-#check-local:
-# xmllint -noout -valid $(srcdir)/$(MAIN)
-
-### this is a website upload target
-
-upload: html ps pdf
- @export RSYNC_RSH=ssh; \
- if test "x$$GST_PLUGINS_VERSION_NANO" = x0; then \
- export DOCVERSION=$(VERSION); \
- else export DOCVERSION=cvs; \
- fi; \
- echo Uploading docs to shell.sf.net/home/groups/g/gs/gstreamer/htdocs/docs/$$DOCVERSION; \
- ssh $(USERNAME)@shell.sf.net mkdir -p /home/groups/g/gs/gstreamer/htdocs/docs/$$DOCVERSION/$(DOC); \
- rsync -arv $(DOC).ps $(DOC).pdf html $(USERNAME)@shell.sf.net:/home/groups/g/gs/gstreamer/htdocs/docs/$$DOCVERSION/$(DOC)
+check-local: $(BUILDDIR)/$(MAIN)
+ @cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
+ cd $(BUILDDIR) && xmllint -noout -valid $(MAIN)
+# avoid 'cp: cannot create regular file `build/image.entities': File exists'
+# errors during 'make distcheck' by disabling parallel builds
+.NOTPARALLEL: