# Directions for adding a new language:
# 1. Add the two-letter code to LANGS below.
# 2. Add a new "%.html.es: es/%.wml en/%.wml" clause below.
# 3. Add a new ".deps/%.html.es.d: es/%.wml .deps/.stamp" clause below.
# 4. mkdir a new two-letter directory. Make sure there's a foot.wmi
# and navigation.wmi.
# 5. Edit include/perl-globals.wmi, add to @LANGUAGES and %LANGUAGES.
# You might find useful %LANGUAGES strings at the bottom of
# http://debian.org/
# 6. Add a new images/es.png flag image.
WMLOPT = \
-I $(WMLBASE)/include \
-D DOCROOT=$(WMLBASE) \
-D IMGROOT=$(WMLBASE)/images \
-D TORGIT=$(TORGIT)\
-D DEVTAG=$(DEVTAG) \
-D STABLETAG=$(STABLETAG)
#LANGS=ar bms cy da de en es et fa fi fr hu id it ja ko nl no pl pt pt-br ru se tr vn zh-cn
LANGS=en es
WMLFILES=$(wildcard $(patsubst %, %/*.wml, $(LANGS)))
WMIFILES=$(wildcard $(patsubst %, %/*.wmi, $(LANGS)) $(WMLBASE)/include/*.wmi )
HTMLFILES=$(shell perl -le 's, (.*)/(.*).wml , $$2.html.$$1 ,x, print $$_ for @ARGV' $(WMLFILES))
DEPFILES=$(shell perl -le 's, (.*)/(.*).wml , .deps/$$2.html.$$1.d ,x, print $$_ for @ARGV' $(WMLFILES))
all: $(HTMLFILES)
%.html.en: en/%.wml
lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
%.html.ar: ar/%.wml en/%.wml
lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
%.html.bms: bms/%.wml en/%.wml
lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
%.html.cy: cy/%.wml en/%.wml
lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
%.html.es: es/%.wml en/%.wml
lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
%.html.et: et/%.wml en/%.wml
lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
%.html.de: de/%.wml en/%.wml
lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@