Commit 05a3a61f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

- Fix UTF-8 encoding issue in PDF and RTF

- Mostly rewritten Makefile
parent 0929e529
# Makefile for the VideoLAN Documentation in DocBook XML
# Written by Alexis de Lattre <>
# To build another language than the default one, do 'make LANG=foo'
# Mostly rewritten by Rémi Denis-Courmont <rem at videolan dot org>
# To build another language than the default one, do 'make LNG=foo'
# Document name
DOC := play-howto
# All available languages
LINGUAS := en fr
# XML declaration
XML_DECL1 = /usr/lib/sgml/declaration/xml.decl
XML_DECL2 = /usr/share/sgml/declaration/xml.decl
XML_DECL = `test -f $(XML_DECL1) && echo $(XML_DECL1) || echo $(XML_DECL2)`
# Default language (English)
LANG = en
RECURSEMAKE = $(MAKE) DOC=$(DOC) -f ../Makefile
SINGLEZIP = rm -f $@ && zip $@ $<
XSL= ../common/videolan-doc.xsl
# Default language : en
# DON'T USE «LANG» for that, it defines the system locale !!!
LNG = en
# All available languages (used in 'make clean')
ALL_LANG = en fr
XSL = ../../common/videolan-doc.xsl
XML = ../src/$(LNG)/$(DOC).xml
# Build HTML, PDF, RTF and TXT outputs (for the web site)
all: $(LANG)/$(DOC)-$(LANG).html $(LANG)/$(DOC)-$(LANG).rtf $(LANG)/$(DOC)-$(LANG).txt $(LANG)/$(DOC)-$(LANG).pdf
TYPES = html pdf rtf txt
TARGETS = $(TYPES:%=$(DOC)-$(LNG).%) $(TYPES:%=$(DOC)-$(LNG)
mkdir -p $(LANG)
ln -sf ../../../images/documentation $(LANG)/images
cp ../common/screen.css $(LANG)
cp ../common/htaccess $(LANG)/.htaccess
all: recurse-$(LNG)
$(LINGUAS:%=recurse-%): recurse-%: FORCE
mkdir -p $*
$(RECURSEMAKE) -C $* LNG=$* build-dir
build-dir: prepare-dir $(TARGETS)
echo $@
prepare-dir: images screen.css .htaccess
ln -sf ../../../images/documentation images
cp ../../common/screen.css .
cp ../../common/htaccess .htaccess
# HTML output
$(LANG)/$(DOC)-$(LANG).html: init-$(LANG)
xsltproc $(XSL) src/$(LANG)/$(DOC).xml > $(LANG)/$(DOC)-$(LANG).html
mv *.html $(LANG)
cd $(LANG) && cp index.html $(DOC)-$(LANG).html && cd ..
rm -f $(LANG)/$(DOC)-$(LANG)
cd $(LANG) && zip $(DOC)-$(LANG) *.html images/*.gif
$(DOC)-$(LNG).html: $(XML)
xsltproc $(XSL) $<
cp index.html $@
$(DOC)-$(LNG) $(DOC)-$(LNG).html
rm -f $@
zip $@ *.html images/*.gif
# PDF output
$(LANG)/$(DOC)-$(LANG).pdf: init-$(LANG)
jade -t tex -d ../common/stylesheet-print-noicones.dsl -o $(LANG)/$(DOC)-$(LANG).tex $(XML_DECL) src/$(LANG)/$(DOC).xml
cd $(LANG) && pdfjadetex $(DOC)-$(LANG).tex
cd $(LANG) && pdfjadetex $(DOC)-$(LANG).tex
cd $(LANG) && pdfjadetex $(DOC)-$(LANG).tex
cd $(LANG) && rm -f *.tex *.out *.aux *.log
cd $(LANG) && zip $(DOC)-$(LANG) $(DOC)-$(LANG).pdf
$(DOC)-$(LNG).pdf: $(XML)
$(JADE) -t tex -d ../../common/stylesheet-print-noicones.dsl -o $(DOC)-$(LNG).tex $(XML_DECL) $<
-pdfjadetex $(DOC)-$(LNG).tex
-pdfjadetex $(DOC)-$(LNG).tex
-pdfjadetex $(DOC)-$(LNG).tex
rm -f *.tex *.out *.aux *.log %.pdf
# RTF output
cd $(LANG) && jade -t rtf -d ../../common/stylesheet-print-noicones.dsl -o $(DOC)-$(LANG).rtf $(XML_DECL) ../src/$(LANG)/$(DOC).xml
rm -f $(LANG)/$(DOC)-$(LANG)
cd $(LANG) && zip $(DOC)-$(LANG) $(DOC)-$(LANG).rtf
$(DOC)-$(LNG).rtf: $(XML)
$(JADE) -t rtf -d ../../common/stylesheet-print-noicones.dsl -o $@ $(XML_DECL) $< %.rtf
# TXT output
jade -t sgml -d ../common/stylesheet-txt.dsl -V nochunks $(XML_DECL) src/$(LANG)/$(DOC).xml > $(LANG)/dumpfortxt.html
lynx -force_html -dump $(LANG)/dumpfortxt.html > $(LANG)/$(DOC)-$(LANG).txt
rm -f $(LANG)/dumpfortxt.html
$(DOC)-$(LNG).txt: $(XML)
$(JADE) -t sgml -d ../common/stylesheet-txt.dsl -V nochunks $(XML_DECL) $(XML) > dumpfortxt.html
lynx -force_html -dump dumpfortxt.html > $@
rm -f dumpfortxt.html %.txt
# Delete all outputs
rm -rf $(ALL_LANG)
rm -Rf $(LINGUAS)
mostlyclean: clean
distclean: clean
# All languages
for l in $(ALL_LANG); do $(MAKE) LANG=$$l || exit 1; done
all-lang: $(LINGUAS:%=recurse-%)
.PHONY: clean all FORCE
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment