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
|
prefix:=
synopsis:= python synopsis.py
xsltproc:= xsltproc --novalid --path $(shell pwd) --xinclude
fop := fop#xmlroff --backend=cairo
src := math.h
syn := $(patsubst %.h, %.syn, $(src))
all: math
math: math.xml Reference.xml
mkdir -p $@
cp synopsis.css $@
$(xsltproc) -o $@/ html.xsl Reference.xml
%.pdf: %.fo
$(fop) -o $@ $<
math.fo: math.xml Reference.xml
$(xsltproc) -o $@ fo.xsl Reference.xml
%.xml: %.syn
$(synopsis) docbook --title='math reference' --output=$@ $<
%.syn: %.h
$(synopsis) parse --output=$@ $<
install-html: all
ifdef prefix
mkdir -p $(prefix)
cp -r math/* $(prefix)
if test -f math.pdf; then cp math.pdf $(prefix); fi
endif
install-print: math.pdf
ifdef prefix
mkdir -p $(prefix)
cp $< $(prefix)
endif
clean:
rm -rf *.syn
distclean: clean
rm -rf math math.xml
|