2003-10-08 14:34:09 +00:00
|
|
|
# rewritten by Thomas to be more simple and working
|
2000-12-30 15:36:24 +00:00
|
|
|
|
2003-10-09 13:06:06 +00:00
|
|
|
# SF username
|
|
|
|
USERNAME ?= thomasvs
|
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
### These are all generic; we set all the variables we need
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
# intermediary build path
|
|
|
|
BUILDDIR = build
|
|
|
|
# same for images
|
|
|
|
BUILDIMAGESDIR = $(BUILDDIR)/images
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
# images
|
|
|
|
# right now, we only allow .png and .fig as source
|
|
|
|
# we might add more later if we feel the need
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
# PNG's can be source or built from .fig
|
|
|
|
PNG = $(strip $(PNG_SRC) $(FIG_SRC:.fig=.png))
|
|
|
|
# EPS .ps files can be built from .png or .fig
|
|
|
|
EPS = $(strip $(FIG_SRC:.fig=.ps) $(PNG_SRC:.png=.ps))
|
|
|
|
# PDF .pdf files can be built from .png or .fig
|
|
|
|
PDF = $(strip $(FIG_SRC:.fig=.pdf) $(PNG_SRC:.png=.pdf))
|
2002-12-18 14:44:26 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
# where we expect to find images during building, whether by copying
|
|
|
|
# or by generating them
|
|
|
|
PNG_BUILT = $(foreach file, $(PNG), $(BUILDIMAGESDIR)/$(file))
|
|
|
|
EPS_BUILT = $(foreach file, $(EPS), $(BUILDIMAGESDIR)/$(file))
|
|
|
|
PDF_BUILT = $(foreach file, $(PDF), $(BUILDIMAGESDIR)/$(file))
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
# everything considered source
|
|
|
|
SRC = $(XML) $(PNG_SRC) $(FIG_SRC) $(CSS)
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
# generate A4 docs
|
|
|
|
PAPER_LOCALE = nl_NL
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
### generate all documentation by default
|
|
|
|
all: html ps pdf
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
# can we generate HTML ?
|
|
|
|
if DOC_HTML
|
|
|
|
HTML_DAT = html
|
|
|
|
html: html/index.html
|
|
|
|
else #!DOC_HTML
|
|
|
|
HTML_DAT =
|
|
|
|
html:
|
|
|
|
endif #DOC_HTML
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
# can we generate PS ?
|
|
|
|
if DOC_PS
|
|
|
|
PS_DAT = $(DOC).ps
|
|
|
|
ps: $(DOC).ps
|
|
|
|
else #!DOC_PS
|
|
|
|
PS_DAT =
|
2001-12-15 23:13:04 +00:00
|
|
|
ps:
|
2003-10-08 14:34:09 +00:00
|
|
|
endif #DOC_PS
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-10-08 14:34:09 +00:00
|
|
|
# can we generate PDF ?
|
|
|
|
if DOC_PDF
|
|
|
|
PDF_DAT = $(DOC).pdf
|
|
|
|
pdf: $(DOC).pdf
|
|
|
|
else #!DOC_PDF
|
|
|
|
PDF_DAT =
|
2001-12-15 23:13:04 +00:00
|
|
|
pdf:
|
2003-10-08 14:34:09 +00:00
|
|
|
endif #DOC_PDF
|
|
|
|
|
|
|
|
debug:
|
|
|
|
@echo "outputting some useful debug information"
|
|
|
|
@echo "Source XML:"
|
|
|
|
@echo "XML: '$(XML)'"
|
|
|
|
@echo "CSS: '$(CSS)'"
|
|
|
|
@echo "Source image files:"
|
|
|
|
@echo "PNG_SRC: '$(PNG_SRC)'"
|
|
|
|
@echo "FIG_SRC: '$(FIG_SRC)'"
|
|
|
|
@echo "All used image files:"
|
|
|
|
@echo "PNG: '$(PNG)'"
|
|
|
|
@echo "EPS: '$(EPS)'"
|
|
|
|
@echo "PDF: '$(PDF)'"
|
|
|
|
@echo "All used image files in their built path:"
|
|
|
|
@echo "PNG_BUILT: '$(PNG_BUILT)'"
|
|
|
|
@echo "EPS_BUILT: '$(EPS_BUILT)'"
|
|
|
|
@echo "PDF_BUILT: '$(PDF_BUILT)'"
|
|
|
|
@echo "End result products:"
|
|
|
|
@echo "HTML_DAT: '$(HTML_DAT)'"
|
|
|
|
@echo "PS_DAT: '$(PS_DAT)'"
|
|
|
|
@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
|
2003-11-29 04:09:27 +00:00
|
|
|
@cp ../version.entities $(BUILDDIR)
|
2003-10-08 14:34:09 +00:00
|
|
|
|
|
|
|
html/index.html: $(BUILDDIR)/$(MAIN) $(PNG_BUILT) $(FIG_SRC)
|
|
|
|
@echo "*** Generating HTML output ***"
|
|
|
|
@-mkdir -p html
|
|
|
|
@cp $(srcdir)/../image-png $(BUILDDIR)/image.entities
|
|
|
|
@cd $(BUILDDIR) && xmlto html -o ../html $(MAIN)
|
|
|
|
@test "x$(CSS)" != "x" && \
|
|
|
|
echo "Copying .css files: $(CSS)" && \
|
|
|
|
cp $(srcdir)/$(CSS) html
|
|
|
|
@test "x$(PNG)" != "x" && \
|
|
|
|
echo "Copying .png images: $(PNG_BUILT)" && \
|
|
|
|
mkdir -p html/images && \
|
|
|
|
cp $(PNG_BUILT) html/images || true
|
|
|
|
|
|
|
|
$(DOC).ps: $(BUILDDIR)/$(MAIN) $(EPS_BUILT) $(PNG_SRC) $(FIG_SRC)
|
|
|
|
@echo "*** Generating PS output ***"
|
|
|
|
@cp $(srcdir)/../image-eps $(BUILDDIR)/image.entities
|
2003-11-29 02:55:14 +00:00
|
|
|
# export LC_PAPER=$(PAPER_LOCALE) && cd $(BUILDDIR) && xmlto ps -o .. $(MAIN)
|
|
|
|
export LC_PAPER=$(PAPER_LOCALE) && cd $(BUILDDIR) && docbook2ps -o .. $(MAIN)
|
2003-10-08 14:34:09 +00:00
|
|
|
|
|
|
|
$(DOC).pdf: $(DOC).ps
|
|
|
|
@echo "*** Generating PDF output ***"
|
|
|
|
@ps2pdf $(DOC).ps
|
|
|
|
|
|
|
|
#$(DOC).pdf: $(MAIN) $(PDF) $(FIG_SRC)
|
|
|
|
# @echo "*** Generating PDF output ***"
|
|
|
|
# @cp $(srcdir)/../image-pdf image.entities
|
|
|
|
# @export LC_PAPER=$(PAPER_LOCALE) && xmlto pdf $(MAIN)
|
|
|
|
# @rm image.entities
|
2001-12-15 23:13:04 +00:00
|
|
|
|
2003-11-29 04:09:27 +00:00
|
|
|
clean-local:
|
2003-10-08 14:34:09 +00:00
|
|
|
-$(RM) -r $(BUILDDIR)
|
|
|
|
-$(RM) -r html
|
|
|
|
-$(RM) $(DOC).ps
|
|
|
|
-$(RM) $(DOC).pdf
|
|
|
|
-$(RM) -r www
|
|
|
|
|
|
|
|
### image generation
|
|
|
|
|
|
|
|
# copy png from source dir png
|
|
|
|
$(BUILDIMAGESDIR)/%.png: $(srcdir)/%.png
|
|
|
|
@echo "Copying $< to $@"
|
|
|
|
@mkdir -p $(BUILDIMAGESDIR)
|
|
|
|
@cp $< $@
|
|
|
|
# make png from fig
|
|
|
|
$(BUILDIMAGESDIR)/%.png: %.fig
|
|
|
|
@echo "Generating $@ from $<"
|
|
|
|
@mkdir -p $(BUILDIMAGESDIR)
|
|
|
|
@fig2dev -Lpng $< $@
|
|
|
|
|
|
|
|
# make ps(EPS) from fig
|
|
|
|
$(BUILDIMAGESDIR)/%.ps: %.fig
|
|
|
|
@echo "Generating $@ from $<"
|
|
|
|
@mkdir -p $(BUILDIMAGESDIR)
|
|
|
|
@fig2dev -Leps $< $@
|
|
|
|
|
|
|
|
# make pdf from fig
|
|
|
|
$(BUILDIMAGESDIR)/%.pdf: %.fig
|
|
|
|
@echo "Generating $@ from $<"
|
|
|
|
@mkdir -p $(BUILDIMAGESDIR)
|
|
|
|
@fig2dev -Lpdf $< $@
|
|
|
|
|
|
|
|
# make pdf from png
|
|
|
|
$(BUILDIMAGESDIR)/%.pdf: %.png
|
|
|
|
@echo "Generating $@ from $<"
|
|
|
|
@mkdir -p $(BUILDIMAGESDIR)
|
|
|
|
@cat $< | pngtopnm | pnmtops -noturn 2> /dev/null | epstopdf --filter --outfile $@ 2> /dev/null
|
|
|
|
|
|
|
|
# make ps(EPS) from png
|
|
|
|
$(BUILDIMAGESDIR)/%.ps: %.png
|
|
|
|
@echo "Generating $@ from $<"
|
|
|
|
@mkdir -p $(BUILDIMAGESDIR)
|
|
|
|
@cat $< | pngtopnm | pnmtops -noturn > $@ 2> /dev/null
|
|
|
|
|
|
|
|
# make sure xml validates properly
|
2003-11-29 04:09:27 +00:00
|
|
|
#check-local:
|
|
|
|
# xmllint -noout -valid $(srcdir)/$(MAIN)
|
2003-10-09 11:29:59 +00:00
|
|
|
|
|
|
|
### this is a website upload target
|
2003-10-09 13:06:06 +00:00
|
|
|
|
2003-10-09 11:29:59 +00:00
|
|
|
upload: html ps pdf
|
2003-10-09 13:10:54 +00:00
|
|
|
@export RSYNC_RSH=ssh; \
|
2003-10-09 13:06:06 +00:00
|
|
|
if test "x$$GST_PLUGINS_VERSION_NANO" = x0; then \
|
|
|
|
export DOCVERSION=$(VERSION); \
|
|
|
|
else export DOCVERSION=cvs; \
|
|
|
|
fi; \
|
2003-10-09 13:10:54 +00:00
|
|
|
echo Uploading docs to shell.sf.net/home/groups/g/gs/gstreamer/htdocs/docs/$$DOCVERSION; \
|
2003-10-09 13:06:06 +00:00
|
|
|
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)
|
2003-10-09 11:29:59 +00:00
|
|
|
|