[svn] r2267@freebird: fabien | 2006-01-27 18:06:12 -0500
Last one to validate.
#/usr/bin/make
targets=$(addprefix $(1), .html .pdf .txt /index.html)
output=$(addprefix $(1), .html .pdf .txt) $(1)
TOP=`pwd`
INSTALL_DIR=$(TOP)/install
SRCS=cthulhu_19e.xml
FOP=fop
NWALSH_XSL_DIR=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh
OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target)))
UPLOAD=$(OUTPUT)
xml_validate=xmllint --xinclude --noout --valid $(1)
html_validate=true
all: $(basename $(SRCS))
validate: $(addsuffix -validate,$(SRCS))
$(addsuffix -validate,$(SRCS)):
$(call xml_validate,$(subst -validate,,$@))
cthulhu_19e: $(call targets,cthulhu_19e)
# title.xsl: title.xml
# xsltproc -o $@ $(NWALSH_XSL_DIR)/template/titlepage.xsl $<
%.fo: %.xml print.xsl common.xsl
xsltproc -o $@ print.xsl $<
%.pdf: %.fo
# xsltproc -o $@.tmp.fo strip-attributes.xsl $<
# xmlto pdf -o $(dir $@) $<
fop $< $@
# rm $@.tmp.fo
%.pdf: %.sxw
xvfb-run -a oowriter2 -pt PDF $<
mv $(OO_PDF_OUTPUT_DIR)/$@ $@
%.pdf: %.sxi
xvfb-run -a ooimpress2 -pt PDF $<
mv $(OO_PDF_OUTPUT_DIR)/$@ $@
%.html: %.xml html.xsl common.xsl
xsltproc --xinclude -o $@ html.xsl $<
# recode u8..l1 $@
%/index.html: %.xml chunk.xsl common.xsl
rm -rf $(dir $@)
mkdir -p $(dir $@)
xsltproc --xinclude -o $(dir $@) chunk.xsl $<
%.txt: %.html
w3m -dump $< > $@
install: $(UPLOAD)
-mkdir -p $(INSTALL_DIR)
cp -a $^ $(INSTALL_DIR)
clean:
rm -f *~ *.fo
purge: clean
rm -rf $(OUTPUT)