Makefile
branchcda
changeset 0 ff2810600648
child 3 dca5a75d3c0e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Tue Jan 24 13:22:49 2006 -0500
@@ -0,0 +1,62 @@
+#/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=cda.xml
+FOP=fop
+NWALSH_XSL_DIR=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh
+OO_PDF_OUTPUT_DIR=$(HOME)/pdf
+
+PDF_OUTPUT=cda-perso.pdf cda-perso-alt.pdf presentation.pdf
+OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target))) \
+	$(PDF_OUTPUT)
+UPLOAD=$(OUTPUT) cda-perso.sxw cda-perso-alt.sxw presentation.sxi index.fr.html blason.png
+
+all: $(basename $(SRCS)) $(PDF_OUTPUT)
+
+cda: $(call targets,cda)
+
+# title.xsl: title.xml
+#	xsltproc -o $@ $(NWALSH_XSL_DIR)/template/titlepage.xsl $<
+
+%.fo: %.xml print.xsl titlepage.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)