[svn r1966] r2244@freebird: fabien | 2006-01-25 01:03:44 -0500
Ajout de la target validate.
--- a/Makefile Thu Jan 26 16:51:23 2006 -0500
+++ b/Makefile Thu Jan 26 16:51:34 2006 -0500
@@ -20,14 +20,18 @@
PRINT_STYLES=$(STYLES) $(addprefix $(STYLES_DIR)/,print.xsl story_print.xsl masters_print.xsl)
DTD=$(addprefix $(DTD_DIR)/,story.dtd)
-
-REMOTE_DIR=o:public_html/contes
# FOP=xmlto pdf
FOP=fop
-CATALOG=$(TOP)/catalog
+SGML_CATALOG_FILES=$(TOP)/catalog
+export SGML_CATALOG_FILES
#OUTPUT=$(foreach target,$(basename $(SRCS)),$(call output,$(target)))
OUTPUT=contes.pdf contes/
+xml_validate=xmllint --catalogs --xinclude $(1) | \
+ sed -e 's/\(xmlns:xi\|xml:base\)="[^"]*"//g' | \
+ xmllint --catalogs --valid --noout - 2>&1 | \
+ sed 's/^-:/$(1):/'
+html_validate=true
all: $(OUTPUT)
@@ -41,6 +45,9 @@
[ -d $(INSTALL_DIR) ] || mkdir -p $(INSTALL_DIR)
cp -a $(OUTPUT)* $(INSTALL_DIR)
+validate:
+ $(call xml_validate,$(SRCS))
+
clean:
rm -f *~ *.fo
@@ -51,7 +58,7 @@
echo $(PRINT_STYLES)
%.fo: %.xml $(PRINT_STYLES) $(SRC_DEPS)
- SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
+ xsltproc --catalogs --xinclude \
-o $@ $(STYLES_DIR)/story_print.xsl $<
%.pdf: %.fo
@@ -61,15 +68,15 @@
# rm $@.tmp.fo
%.html: %.xml $(HTML_STYLES) $(SRC_DEPS)
- SGML_CATALOG_FILES=$(CATALOG) xsltproc --catalogs --xinclude \
- --stringparam css-base-dir '/~fabien/styles/' \
+ xsltproc --catalogs --xinclude \
+ --stringparam css-base-dir '/~fabien/styles/' \
-o $@ $(STYLES_DIR)/story_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/' \
+ xsltproc --catalogs --xinclude \
+ --stringparam css-base-dir '/~fabien/styles/' \
-o $@ $(STYLES_DIR)/story_html.xsl $<
%.txt: %.html