Makefile
branchpoesie
changeset 0 a1ca775e51e0
child 3 ef0c1302aa60
equal deleted inserted replaced
-1:000000000000 0:a1ca775e51e0
       
     1 #/usr/bin/make
       
     2 
       
     3 targets=$(addprefix $(1), .html .pdf .txt /index.html)
       
     4 output=$(addprefix $(1), .html .pdf .txt) $(1)/
       
     5 
       
     6 TOP=$(shell pwd)
       
     7 INSTALL_DIR=$(TOP)/install
       
     8 SRCS=poetry.xml
       
     9 SRC_DEPS=\
       
    10 	abzoodre.xml \
       
    11 	amoureux.xml \
       
    12 	apprends.xml \
       
    13 	belle.xml \
       
    14 	coeur.xml \
       
    15 	democratie.xml \
       
    16 	desert.xml \
       
    17 	horloge.xml \
       
    18 	idees.xml \
       
    19 	jugement.xml \
       
    20 	lettreseule.xml \
       
    21 	nature.xml \
       
    22 	oiseau.xml \
       
    23 	ondes.xml \
       
    24 	paysage.xml \
       
    25 	plonger.xml \
       
    26 	pomme.xml \
       
    27 	prince.xml \
       
    28 	renaissance.xml \
       
    29 	reverie.xml \
       
    30 	tempete.xml \
       
    31 	valentin.xml \
       
    32 	voix.xml \
       
    33 	wolf.xml
       
    34 STYLES_DIR=$(TOP)/styles
       
    35 DTD_DIR=$(TOP)/dtd
       
    36 STYLES=$(addprefix $(STYLES_DIR)/,common.xsl)
       
    37 HTML_STYLES=$(STYLES) $(addprefix $(STYLES_DIR)/,html.xsl poetry_html.xsl)
       
    38 PRINT_STYLES=$(STYLES) $(addprefix $(STYLES_DIR)/,print.xsl poetry_print.xsl masters_print.xsl)
       
    39 DTD=$(addprefix $(DTD_DIR)/,poetry.dtd)
       
    40 
       
    41 REMOTE_DIR=o:public_html/poesie
       
    42 # FOP=xmlto pdf
       
    43 FOP=fop
       
    44 CATALOG=$(TOP)/catalog
       
    45 
       
    46 #OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target)))
       
    47 OUTPUT=poetry.pdf poetry/
       
    48 
       
    49 all: $(OUTPUT)
       
    50 
       
    51 #poetry: $(call targets,poetry) $(SRC_DEPS)
       
    52 poetry/: poetry/index.html
       
    53 
       
    54 update: $(OUTPUT)
       
    55 	rsync -avz -P $(OUTPUT) $(REMOTE_DIR)
       
    56 
       
    57 install: $(OUTPUT)
       
    58 	[ -d $(INSTALL_DIR) ] || mkdir -p $(INSTALL_DIR)
       
    59 	cp -a $(OUTPUT)* $(INSTALL_DIR)
       
    60 
       
    61 clean:
       
    62 	rm -f *~ *.fo
       
    63 
       
    64 purge: clean
       
    65 	rm -rf $(OUTPUT)
       
    66 
       
    67 debug:
       
    68 	echo $(PRINT_STYLES)
       
    69 
       
    70 %.fo: %.xml $(PRINT_STYLES) $(SRC_DEPS)
       
    71 	SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
       
    72 		-o $@ $(STYLES_DIR)/poetry_print.xsl $<
       
    73 
       
    74 %.pdf: %.fo
       
    75 #	SGML_CATALOG_FILES=$(CATALOG) xsltproc -o $@.tmp.fo strip-attributes.xsl $<
       
    76 #	xmlto pdf -o $(dir $@) $<
       
    77 	fop $< $@
       
    78 #	rm $@.tmp.fo
       
    79 
       
    80 %.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
       
    81 	SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
       
    82 		--stringparam css-base-dir '/~fabien/styles/' \
       
    83 		-o $@ $(STYLES_DIR)/poetry_html.xsl $<
       
    84 
       
    85 %/index.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
       
    86 	rm -rf $(dir $@)
       
    87 	mkdir -p $(dir $@)
       
    88 	SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
       
    89 		--stringparam css-base-dir '/~fabien/styles/' \
       
    90 		-o $@ $(STYLES_DIR)/poetry_html.xsl $<
       
    91 
       
    92 %.txt: %.html
       
    93 	w3m -dump $< > $@
       
    94