merged with 1697 revision of trunk (which is post-rc1 but pre-rc2
[ardour.git] / manual / Makefile
1
2 DOCNAME         = ardour_manual
3
4 # Default values, only set if not set in book Makefile
5 OUTDIR   ?= tmp
6 XMLFILE  ?= xml/$(DOCNAME).xml
7 XSLFILE  ?= xsl/html.xsl
8 CSSFILE  ?= $(DOCNAME).css
9 XSLTPROC ?= xsltproc
10 #PWD              = $(shell pwd)
11
12 help::
13         @echo " The Following is a list of supported build targets:"
14         @echo
15         @echo " html:"
16         @echo "     Build HTML version of ardour manual."
17         @echo
18         @echo " test:"
19         @echo "     Validate DocBook XML source."
20         @echo
21         @echo " format:"
22         @echo "     Format DocBook XML source using xmlformat."
23         @echo
24         @echo " clean:"
25         @echo "     Remove temporary files."
26         @echo
27
28 # xsltproc -output option gives I/O errors because??, so 
29 # just move the html to the output directory
30 html:: clean
31         # creating output directory
32         -@mkdir $(OUTDIR)
33         # generating html
34         LANG=en_US.UTF-8 $(XSLTPROC) -xinclude $(XSLFILE) $(XMLFILE)
35         # copy html files to output directory
36         -@mv *.html $(OUTDIR)
37         # copy css file to output directory
38         -@cp css/$(CSSFILE) $(OUTDIR)/$(CSSFILE)
39         # copy the image files to the output directory
40         -@cp -r images  $(OUTDIR)/images
41
42 .PHONY : html
43
44 test::
45         # validating book
46         xmllint --noout --postvalid --xinclude $(XMLFILE)
47
48 .PHONY : test
49
50 format:: test
51         @for file in `find xml/*.xml`; \
52                 do xmlformat/xmlformat.pl --in-place --backup .bak \
53                 --config-file xmlformat/xmlformat-ardour.conf $$file; \
54                 done
55
56 .PHONY : format
57
58 clean::
59         @rm -rf $(OUTDIR)
60
61 .PHONY : clean
62
63 upload: html
64         cd tmp && tar cf - . | bzip2 > ../man.tar.bz2
65         scp man.tar.bz2 las@ardour.org:ardour.org
66
67 .PHONY : upload
68