Makefile
author fabien
Mon, 23 Jan 2006 13:07:49 -0500
branchcthulhu_19e
changeset 0 b33e0bb8c644
child 1 9b9ab4d82243
permissions -rw-r--r--
[svn] r2198@freebird: fabien | 2006-01-22 15:36:14 -0500 Déplacement de cthulhu_19e dans les jeux des Harmonies. Installation des jeux des harmonies dans leurs sous-répertoires respectifs. Création d'une page spécifique aux Arpèges.

#/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)

all: $(basename $(SRCS))

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)