verstaendliche Fehlermeldung, falls lyx nicht gefunden wird (closes #120)

Verwendung von 'validate' _und_ 'tidy' zur html-Pruefung
This commit is contained in:
lars 2006-12-30 02:09:52 +00:00
parent 7d73b0f8f9
commit 99da3ef141

View file

@ -1,10 +1,10 @@
# validation program
VALIDATE_BIN := validate
VALIDATE_OPTS :=
# alternativ kann auch ein anderes Pruef-Programm verwendet werden - tidy kann
# aber wohl nicht daran gehindert werden, unwichtige Nachrichten auszugeben
#VALIDATE_BIN := tidy
#VALIDATE_OPTS := -o /dev/null -errors -quiet
# Validierungswerkzeuge
VALIDATE1_BIN := validate
VALIDATE1_OPTS :=
VALIDATE1_DEB_PACKAGE := wdg-html-validator
VALIDATE2_BIN := tidy
VALIDATE2_OPTS := -o /dev/null -errors -quiet
VALIDATE2_DEB_PACKAGE := tidy
# our self written documents
LYX_FILES := $(shell find . -name *.lyx -type f)
# the tex output of lyx
@ -31,6 +31,9 @@ LATEX2HTML_OPTS := -no_auto_link -split 0 -no_navigation -no_subdir -info 0 -sty
# if another target depends on them (they do not look for timestamps)
.PHONY : clean clean-targets install all
# clear language environment setting of the shell
export LANG=
# default target
all: $(EXPORT_DIRS)
@ -38,17 +41,40 @@ all: $(EXPORT_DIRS)
# validate the html files
validate: $(EXPORT_DIRS)
@if which $(VALIDATE_BIN) >/dev/null ;\
@# Warnung, falls das erste Programm nicht gefunden wird
@if which $(VALIDATE1_BIN) >/dev/null ;\
then true ;\
else echo >&2 ;\
echo >&2 "*****************************************************************" ;\
echo >&2 "* Could not find the html-checker '$(VALIDATE_BIN)'! *" ;\
echo >&2 "* Debian users should run 'apt-get install wdg-html-validator'. *" ;\
echo >&2 "* Could not find the html-checker '$(VALIDATE1_BIN)'! *" ;\
echo >&2 "* Debian users should run 'apt-get install $(VALIDATE1_DEB_PACKAGE)'. *" ;\
echo >&2 "*****************************************************************";\
echo >&2 ;\
fi
@# Warnung, falls das zweite Programm nicht gefunden wird
@if which $(VALIDATE2_BIN) >/dev/null ;\
then true ;\
else echo >&2 ;\
echo >&2 "*****************************************************************" ;\
echo >&2 "* Could not find the html-checker '$(VALIDATE2_BIN)'! *" ;\
echo >&2 "* Debian users should run 'apt-get install $(VALIDATE2_DEB_PACKAGE)'. *" ;\
echo >&2 "*****************************************************************";\
echo >&2 ;\
fi
@# Abbruch, falls beide Programme nicht gefunden werden
@if which $(VALIDATE1_BIN) >/dev/null || which $(VALIDATE2_BIN) >/dev/null ;\
then true ;\
else echo >&2 ;\
echo >&2 "None of the html checkers was found!" ;\
echo >&2 ;\
false ;\
fi
@$(VALIDATE_BIN) $(VALIDATE_OPTS) $(shell find . -name *.html -type f) ;\
@find . -name \*.html -type f | while read fname ;\
do echo "Validating $$fname" ;\
which $(VALIDATE1_BIN) >/dev/null && $(VALIDATE1_BIN) $(VALIDATE1_OPTS) "$$fname" ;\
which $(VALIDATE2_BIN) >/dev/null && $(VALIDATE2_BIN) $(VALIDATE2_OPTS) "$$fname" ;\
echo ;\
done
# copy the created files to the destination directory (usually outside of this directory tree)
@ -93,6 +119,15 @@ clean-targets:
# create tex files from lyx
$(TEX_FILES): $(LYX_FILES)
@if test -z $(LYX_BIN) ;\
then echo >&2 ;\
echo >&2 "**************************************************" ;\
echo >&2 "* Could not find 'lyx'! *" ;\
echo >&2 "* Debian users should run 'apt-get install lyx'. *" ;\
echo >&2 "**************************************************";\
echo >&2 ;\
false ;\
fi
$(LYX_BIN) -e latex $*.lyx