Makefile
branchcontes
changeset 5 b0d91312ad83
parent 0 5cbf517f2a5a
child 6 f5ce1e175ca6
equal deleted inserted replaced
4:3c038a4eee34 5:b0d91312ad83
    18 STYLES=$(addprefix $(STYLES_DIR)/,common.xsl)
    18 STYLES=$(addprefix $(STYLES_DIR)/,common.xsl)
    19 HTML_STYLES=$(STYLES) $(addprefix $(STYLES_DIR)/,html.xsl story_html.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)
    20 PRINT_STYLES=$(STYLES) $(addprefix $(STYLES_DIR)/,print.xsl story_print.xsl masters_print.xsl)
    21 DTD=$(addprefix $(DTD_DIR)/,story.dtd)
    21 DTD=$(addprefix $(DTD_DIR)/,story.dtd)
    22 
    22 
    23 
       
    24 REMOTE_DIR=o:public_html/contes
       
    25 # FOP=xmlto pdf
    23 # FOP=xmlto pdf
    26 FOP=fop
    24 FOP=fop
    27 CATALOG=$(TOP)/catalog
    25 SGML_CATALOG_FILES=$(TOP)/catalog
       
    26 export SGML_CATALOG_FILES
    28 
    27 
    29 #OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target)))
    28 #OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target)))
    30 OUTPUT=contes.pdf contes/
    29 OUTPUT=contes.pdf contes/
       
    30 xml_validate=xmllint --catalogs --xinclude $(1) |	\
       
    31 	sed -e 's/\(xmlns:xi\|xml:base\)="[^"]*"//g' |	\
       
    32 	xmllint --catalogs --valid --noout - 2>&1 |	\
       
    33 	sed 's/^-:/$(1):/'
       
    34 html_validate=true
    31 
    35 
    32 all: $(OUTPUT)
    36 all: $(OUTPUT)
    33 
    37 
    34 #poetry: $(call targets,poetry) $(SRC_DEPS)
    38 #poetry: $(call targets,poetry) $(SRC_DEPS)
    35 contes/: contes/index.html
    39 contes/: contes/index.html
    39 
    43 
    40 install: $(OUTPUT)
    44 install: $(OUTPUT)
    41 	[ -d $(INSTALL_DIR) ] || mkdir -p $(INSTALL_DIR)
    45 	[ -d $(INSTALL_DIR) ] || mkdir -p $(INSTALL_DIR)
    42 	cp -a $(OUTPUT)* $(INSTALL_DIR)
    46 	cp -a $(OUTPUT)* $(INSTALL_DIR)
    43 
    47 
       
    48 validate:
       
    49 	$(call xml_validate,$(SRCS))
       
    50 
    44 clean:
    51 clean:
    45 	rm -f *~ *.fo
    52 	rm -f *~ *.fo
    46 
    53 
    47 purge: clean
    54 purge: clean
    48 	rm -rf $(OUTPUT)
    55 	rm -rf $(OUTPUT)
    49 
    56 
    50 debug:
    57 debug:
    51 	echo $(PRINT_STYLES)
    58 	echo $(PRINT_STYLES)
    52 
    59 
    53 %.fo: %.xml $(PRINT_STYLES) $(SRC_DEPS)
    60 %.fo: %.xml $(PRINT_STYLES) $(SRC_DEPS)
    54 	SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
    61 	xsltproc --catalogs --xinclude			\
    55 		-o $@ $(STYLES_DIR)/story_print.xsl $<
    62 		-o $@ $(STYLES_DIR)/story_print.xsl $<
    56 
    63 
    57 %.pdf: %.fo
    64 %.pdf: %.fo
    58 #	xsltproc -o $@.tmp.fo strip-attributes.xsl $<
    65 #	xsltproc -o $@.tmp.fo strip-attributes.xsl $<
    59 #	xmlto pdf -o $(dir $@) $<
    66 #	xmlto pdf -o $(dir $@) $<
    60 	fop $< $@
    67 	fop $< $@
    61 #	rm $@.tmp.fo
    68 #	rm $@.tmp.fo
    62 
    69 
    63 %.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
    70 %.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
    64 	SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
    71 	xsltproc --catalogs --xinclude				\
    65 		--stringparam css-base-dir '/~fabien/styles/' \
    72 		--stringparam css-base-dir '/~fabien/styles/'	\
    66 		-o $@ $(STYLES_DIR)/story_html.xsl $<
    73 		-o $@ $(STYLES_DIR)/story_html.xsl $<
    67 
    74 
    68 %/index.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
    75 %/index.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
    69 	rm -rf $(dir $@)
    76 	rm -rf $(dir $@)
    70 	mkdir -p $(dir $@)
    77 	mkdir -p $(dir $@)
    71 	SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
    78 	xsltproc --catalogs --xinclude				\
    72 		--stringparam css-base-dir '/~fabien/styles/' \
    79 		--stringparam css-base-dir '/~fabien/styles/'	\
    73 		-o $@ $(STYLES_DIR)/story_html.xsl $<
    80 		-o $@ $(STYLES_DIR)/story_html.xsl $<
    74 
    81 
    75 %.txt: %.html
    82 %.txt: %.html
    76 	w3m -dump $< > $@
    83 	w3m -dump $< > $@
    77 
    84