summaryrefslogtreecommitdiff
path: root/manual/Makefile
blob: 76965262c2a5e0d39dd4c6adbb8067b36e07d69e (plain)
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

DOCNAME		= ardour_manual

# Default values, only set if not set in book Makefile
OUTDIR   ?= tmp
XMLFILE  ?= xml/$(DOCNAME).xml
XSLFILE  ?= xsl/html.xsl
CSSFILE	 ?= $(DOCNAME).css
XSLTPROC ?= xsltproc
#PWD		  = $(shell pwd)

help::
	@echo " The Following is a list of supported build targets:"
	@echo
	@echo " html:"
	@echo "     Build HTML version of ardour manual."
	@echo
	@echo " test:"
	@echo "     Validate DocBook XML source."
	@echo
	@echo " format:"
	@echo "     Format DocBook XML source using xmlformat."
	@echo
	@echo " clean:"
	@echo "     Remove temporary files."
	@echo

# xsltproc -output option gives I/O errors because??, so 
# just move the html to the output directory
html:: clean
	# creating output directory
	-@mkdir $(OUTDIR)
	# generating html
	LANG=en_US.UTF-8 $(XSLTPROC) -xinclude $(XSLFILE) $(XMLFILE)
	# copy html files to output directory
	-@mv *.html $(OUTDIR)
	# copy css file to output directory
	-@cp css/$(CSSFILE) $(OUTDIR)/$(CSSFILE)
	# copy the image files to the output directory
	-@cp -r images  $(OUTDIR)/images

.PHONY : html

test::
	# validating book
	xmllint --noout --postvalid --xinclude $(XMLFILE)

.PHONY : test

format:: test
	@for file in `find xml/*.xml`; \
		do xmlformat/xmlformat.pl --in-place --backup .bak \
		--config-file xmlformat/xmlformat-ardour.conf $$file; \
		done

.PHONY : format

clean::
	@rm -rf $(OUTDIR)

.PHONY : clean

upload: html
	cd tmp && tar cf - . | bzip2 > ../man.tar.bz2
	scp man.tar.bz2 las@ardour.org:ardour.org

.PHONY : upload