Makefile
branchcontes
changeset 0 5cbf517f2a5a
child 5 b0d91312ad83
equal deleted inserted replaced
-1:000000000000 0:5cbf517f2a5a
       
     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=contes.xml
       
     9 SRC_DEPS=\
       
    10 	dorsey.xml \
       
    11 	jardin.xml \
       
    12 	marche.xml \
       
    13 	yeux.xml \
       
    14 	genese.xml \
       
    15 	mythos.xml
       
    16 STYLES_DIR=$(TOP)/styles
       
    17 DTD_DIR=$(TOP)/dtd
       
    18 STYLES=$(addprefix $(STYLES_DIR)/,common.xsl)
       
    19 HTML_STYLES=$(STYLES) $(addprefix $(STYLES_DIR)/,html.xsl story_html.xsl)
       
    20 PRINT_STYLES=$(STYLES) $(addprefix $(STYLES_DIR)/,print.xsl story_print.xsl masters_print.xsl)
       
    21 DTD=$(addprefix $(DTD_DIR)/,story.dtd)
       
    22 
       
    23 
       
    24 REMOTE_DIR=o:public_html/contes
       
    25 # FOP=xmlto pdf
       
    26 FOP=fop
       
    27 CATALOG=$(TOP)/catalog
       
    28 
       
    29 #OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target)))
       
    30 OUTPUT=contes.pdf contes/
       
    31 
       
    32 all: $(OUTPUT)
       
    33 
       
    34 #poetry: $(call targets,poetry) $(SRC_DEPS)
       
    35 contes/: contes/index.html
       
    36 
       
    37 update: $(OUTPUT)
       
    38 	rsync -avz -P $(OUTPUT) $(REMOTE_DIR)
       
    39 
       
    40 install: $(OUTPUT)
       
    41 	[ -d $(INSTALL_DIR) ] || mkdir -p $(INSTALL_DIR)
       
    42 	cp -a $(OUTPUT)* $(INSTALL_DIR)
       
    43 
       
    44 clean:
       
    45 	rm -f *~ *.fo
       
    46 
       
    47 purge: clean
       
    48 	rm -rf $(OUTPUT)
       
    49 
       
    50 debug:
       
    51 	echo $(PRINT_STYLES)
       
    52 
       
    53 %.fo: %.xml $(PRINT_STYLES) $(SRC_DEPS)
       
    54 	SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
       
    55 		-o $@ $(STYLES_DIR)/story_print.xsl $<
       
    56 
       
    57 %.pdf: %.fo
       
    58 #	xsltproc -o $@.tmp.fo strip-attributes.xsl $<
       
    59 #	xmlto pdf -o $(dir $@) $<
       
    60 	fop $< $@
       
    61 #	rm $@.tmp.fo
       
    62 
       
    63 %.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
       
    64 	SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
       
    65 		--stringparam css-base-dir '/~fabien/styles/' \
       
    66 		-o $@ $(STYLES_DIR)/story_html.xsl $<
       
    67 
       
    68 %/index.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
       
    69 	rm -rf $(dir $@)
       
    70 	mkdir -p $(dir $@)
       
    71 	SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
       
    72 		--stringparam css-base-dir '/~fabien/styles/' \
       
    73 		-o $@ $(STYLES_DIR)/story_html.xsl $<
       
    74 
       
    75 %.txt: %.html
       
    76 	w3m -dump $< > $@
       
    77