forked from LinuxStandardBase/fhs-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (40 loc) · 1.8 KB
/
Makefile
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
XMLFILES=fhs.xml intro.xml filesystem.xml root-filesystem.xml usr.xml var.xml os.xml appendix.xml
XMLTOARGS_OLD=--xsltopts '--stringparam section.autolabel 1 --stringparam section.label.includes.component.label 1 --stringparam chunker.output.encoding UTF-8'
XMLTOARGS_NEW=--stringparam section.autolabel=1 --stringparam section.label.includes.component.label=1 --stringparam chunker.output.encoding=UTF-8
XSLTPROCARGS=--stringparam section.autolabel 1 --stringparam section.label.includes.component.label 1 --stringparam chunker.output.encoding UTF-8
# Possible locations of DocBook upstream docbook.xsl for html-nochunks
# on the system.
HTML_NOCHUNK_XSL_LOCATIONS=/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl \
/usr/share/xml/docbook/stylesheet/nwalsh/current/html/docbook.xsl \
/usr/share/sgml/docbook/xsl-stylesheets/html/docbook.xsl
ifeq ($(shell xmlto --help | grep stringparam | wc -l),0)
XMLTOARGS=$(XMLTOARGS_OLD)
else
XMLTOARGS=$(XMLTOARGS_NEW)
endif
all: fhs.html fhs/index.html fhs.txt fhs.pdf
docbook-utf8.xsl: docbook-utf8.xsl.in
for f in $(HTML_NOCHUNK_XSL_LOCATIONS); do \
if [ -e $$f ]; then \
sed s,@HTML_NOCHUNK_XSL@,$$f,g < $< > $@; \
break; \
fi; \
done
fhs.ps: $(XMLFILES)
xmlto $(XMLTOARGS) ps fhs.xml
fhs.fo: $(XMLFILES)
xsltproc $(XSLTPROCARGS) $(FO_ARGS) -o $@ ./docbook-xsl/fo/docbook.xsl fhs.xml
fhs.pdf: fhs.fo
fop fhs.fo -pdf fhs.pdf
fhs.txt: $(XMLFILES)
xmlto $(XMLTOARGS) txt fhs.xml
fhs/index.html: $(XMLFILES)
xmlto $(XMLTOARGS) -o fhs html fhs.xml
fhs.html: $(XMLFILES) docbook-utf8.xsl
xmlto $(XMLTOARGS) -x ./docbook-utf8.xsl html-nochunks fhs.xml
valid:
xmllint --valid --noout fhs.xml
clean:
rm -f fhs.ps fhs.txt fhs.pdf fhs/*.html fhs.html fhs.fo docbook-utf8.xsl
rm -rf fhs
distclean: clean