--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile Tue Dec 27 13:55:27 2005 -0500
@@ -0,0 +1,94 @@
+#/usr/bin/make
+
+targets=$(addprefix $(1), .html .pdf .txt /index.html)
+output=$(addprefix $(1), .html .pdf .txt) $(1)/
+
+TOP=$(shell pwd)
+INSTALL_DIR=$(TOP)/install
+SRCS=poetry.xml
+SRC_DEPS=\
+ abzoodre.xml \
+ amoureux.xml \
+ apprends.xml \
+ belle.xml \
+ coeur.xml \
+ democratie.xml \
+ desert.xml \
+ horloge.xml \
+ idees.xml \
+ jugement.xml \
+ lettreseule.xml \
+ nature.xml \
+ oiseau.xml \
+ ondes.xml \
+ paysage.xml \
+ plonger.xml \
+ pomme.xml \
+ prince.xml \
+ renaissance.xml \
+ reverie.xml \
+ tempete.xml \
+ valentin.xml \
+ voix.xml \
+ wolf.xml
+STYLES_DIR=$(TOP)/styles
+DTD_DIR=$(TOP)/dtd
+STYLES=$(addprefix $(STYLES_DIR)/,common.xsl)
+HTML_STYLES=$(STYLES) $(addprefix $(STYLES_DIR)/,html.xsl poetry_html.xsl)
+PRINT_STYLES=$(STYLES) $(addprefix $(STYLES_DIR)/,print.xsl poetry_print.xsl masters_print.xsl)
+DTD=$(addprefix $(DTD_DIR)/,poetry.dtd)
+
+REMOTE_DIR=o:public_html/poesie
+# FOP=xmlto pdf
+FOP=fop
+CATALOG=$(TOP)/catalog
+
+#OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target)))
+OUTPUT=poetry.pdf poetry/
+
+all: $(OUTPUT)
+
+#poetry: $(call targets,poetry) $(SRC_DEPS)
+poetry/: poetry/index.html
+
+update: $(OUTPUT)
+ rsync -avz -P $(OUTPUT) $(REMOTE_DIR)
+
+install: $(OUTPUT)
+ [ -d $(INSTALL_DIR) ] || mkdir -p $(INSTALL_DIR)
+ cp -a $(OUTPUT)* $(INSTALL_DIR)
+
+clean:
+ rm -f *~ *.fo
+
+purge: clean
+ rm -rf $(OUTPUT)
+
+debug:
+ echo $(PRINT_STYLES)
+
+%.fo: %.xml $(PRINT_STYLES) $(SRC_DEPS)
+ SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
+ -o $@ $(STYLES_DIR)/poetry_print.xsl $<
+
+%.pdf: %.fo
+# SGML_CATALOG_FILES=$(CATALOG) xsltproc -o $@.tmp.fo strip-attributes.xsl $<
+# xmlto pdf -o $(dir $@) $<
+ fop $< $@
+# rm $@.tmp.fo
+
+%.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
+ SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
+ --stringparam css-base-dir '/~fabien/styles/' \
+ -o $@ $(STYLES_DIR)/poetry_html.xsl $<
+
+%/index.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
+ rm -rf $(dir $@)
+ mkdir -p $(dir $@)
+ SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
+ --stringparam css-base-dir '/~fabien/styles/' \
+ -o $@ $(STYLES_DIR)/poetry_html.xsl $<
+
+%.txt: %.html
+ w3m -dump $< > $@
+