[svn r1966] r2244@freebird: fabien | 2006-01-25 01:03:44 -0500 contes
authorfabien
Thu, 26 Jan 2006 16:51:34 -0500
branchcontes
changeset 5 b0d91312ad83
parent 4 3c038a4eee34
child 6 f5ce1e175ca6
[svn r1966] r2244@freebird: fabien | 2006-01-25 01:03:44 -0500 Ajout de la target validate.
Makefile
--- 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