File: Makefile.doc

package info (click to toggle)
videolan-doc 20060711-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,656 kB
  • ctags: 34
  • sloc: xml: 39,118; sh: 256; makefile: 191; php: 6
file content (92 lines) | stat: -rw-r--r-- 2,241 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Makefile for the VideoLAN Documentation in DocBook XML
# Written by Alexis de Lattre <alexis@videolan.org>
# Mostly rewritten by Rémi Denis-Courmont <rem at videolan dot org>
# To build another language than the default one, do 'make LNG=foo'

# 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)`

JADE = SP_CHARSET_FIXED=YES SP_ENCODING=XML jade
RECURSEMAKE = $(MAKE) DOC=$(DOC) -f ../../Makefile.doc
SINGLEZIP = rm -f $@ && zip $@ $<

# Default language : en
# DON'T USE «LANG» for that, it defines the system locale !!!
LNG = en

XSL = ../../common/videolan-doc.xsl
XML = ../src/$(LNG)/$(DOC).xml

# Build HTML, PDF, RTF and TXT outputs (for the web site)
TYPES = html pdf rtf txt
TARGETS = $(TYPES:%=$(DOC)-$(LNG).%) $(TYPES:%=$(DOC)-$(LNG).%.zip)

all: recurse-$(LNG)

$(LINGUAS:%=recurse-%): recurse-%: FORCE
	mkdir -p $*
	$(RECURSEMAKE) -C $* LNG=$* build-dir

build-dir: prepare-dir $(TARGETS)

prepare-dir: images screen.css .htaccess

images:
	ln -sf ../../../images/documentation images

screen.css:
	cp ../../common/screen.css .

.htaccess:
	cp ../../common/htaccess .htaccess

# HTML output
$(DOC)-$(LNG).html: $(XML)
	xsltproc $(XSL) $<
	cp index.html $@

$(DOC)-$(LNG).html.zip: $(DOC)-$(LNG).html
	rm -f $@
	zip $@ *.html images/*.gif

# PDF output
$(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.zip: %.pdf
	$(SINGLEZIP)

# RTF output
$(DOC)-$(LNG).rtf: $(XML)
	$(JADE) -t rtf -d ../../common/stylesheet-print-noicones.dsl -o $@ $(XML_DECL) $<

%.rtf.zip: %.rtf
	$(SINGLEZIP)

# TXT output
$(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.zip: %.txt
	$(SINGLEZIP)

# Delete all outputs
clean:
	rm -Rf $(LINGUAS)

mostlyclean: clean
distclean: clean

# All languages
all-lang: $(LINGUAS:%=recurse-%)

.PHONY: clean all FORCE