tex.mk: Make it understand german umlauts

This commit is contained in:
Jan Lindemann 2001-07-11 13:14:12 +00:00 committed by Jan Lindemann
commit 9f7068db8c

View file

@ -13,10 +13,15 @@ FMT_OUT = $(patsubst %,$(OUT).%.zip,$(FMT))
FMT_OFFLINE_OUT = $(patsubst %,$(OUT).%.zip,$(FMT_OFFLINE))
ALL = $(FMT_OUT) html_install
PRE_HTML = $(patsubst %.tmpl,%,$(wildcard *.html.tmpl))
PRE_TEX = $(patsubst %.tmpl,%,$(wildcard *.tex.tmpl) $(LOCAL_IMPORTED_TEMPLATES))
PRE_TEX = $(patsubst %.ger,%.tex,$(patsubst %.tmpl,%,$(wildcard *.tex.tmpl *.ger) $(LOCAL_IMPORTED_TEMPLATES)))
TEXSRC = $(wildcard *.tex $(IMAGES) $(LOCAL_SRC)) $(PRE_TEX)
DATE := $(shell date +'%b, %d, %Y')
TEX_WARN_DONT_EDIT = "\
%+---------------------------------------------------+\n\
%| DO NOT EDIT THIS FILE! |\n\
%| It was automatically created during the build |\n\
%| process! |\n\
%+---------------------------------------------------+\n"
WD = `pwd`
NEWDIRS = $(DISTDIR) $(HTMLDIR) $(DVIDIR)
@ -38,7 +43,21 @@ define replace_macros
s/__ICON_CONTENTS__/$(ICON_CONTENTS)/g; \
s/__ICON_PREV__/$(ICON_PREV)/g; \
s/__ICON_NEXT__/$(ICON_NEXT)/g; \
" > $@
" >> $@
endef
define replace_umlauts
@echo replacing german umlauts with tex-style umlauts
@echo -e $(TEX_WARN_DONT_EDIT) > $@
cat $< | sed -e "\
s/ä/\"a/g; \
s/Ä/\"A/g; \
s/ö/\"o/g; \
s/Ö/\"O/g; \
s/ü/\"u/g; \
s/Ü/\"Ü/g; \
s/ß/\"s/g; \
" >> $@
endef
all: dirs $(ALL)
@ -50,14 +69,17 @@ txt: dirs $(OUT).txt.zip
html: dirs $(OUT).html.zip
pdf: dirs $(OUT).pdf.zip
%.tex: %.ger
$(replace_umlauts)
%.tex: %.tex.tmpl
$(replace_macros)
%.html: %.html.tmpl
$(replace_macros)
%.tmpl: $(TEX_TMPL_DIR)/%.tmpl
cp $< $@
%.tmpl:
cp $(TEX_TMPL_DIR)/$@ .
cfgtest.done:
test -n "$(OUTPUT)" # OUTPUT