687e0dc2945af33abf86501aff15c8766c3d6845
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

1) WMLOPT  = \
2)           -I $(WMLBASE)/include \
3)           -D DOCROOT=$(WMLBASE) \
4)           -D IMGROOT=$(WMLBASE)/images \
5)           -D TORCVSSTABLE=$(TORCVSSTABLE) \
6)           -D TORCVSHEAD=$(TORCVSHEAD)
7) 
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

8) 
Peter Palfrader Add russian translation

Peter Palfrader authored 18 years ago

9) LANGS=de en it fr se ru
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

10) WMLFILES=$(wildcard $(patsubst %, %/*.wml, $(LANGS)))
11) WMIFILES=$(wildcard $(patsubst %, %/*.wmi, $(LANGS)) $(WMLBASE)/include/*.wmi )
12) 
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

13) HTMLFILES = $(shell perl -le 's,  (.*)/(.*).wml  ,        $$2.html.$$1    ,x, print $$_ for @ARGV' $(WMLFILES))
14) DEPFILES  = $(shell perl -le 's,  (.*)/(.*).wml  ,  .deps/$$2.html.$$1.d  ,x, print $$_ for @ARGV' $(WMLFILES))
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

15) 
16) 
17) all: $(HTMLFILES)
18) 
19) %.html.en: en/%.wml
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

20) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

21) 
22) %.html.de: de/%.wml en/%.wml
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

23) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

24) 
25) %.html.it: it/%.wml en/%.wml
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

26) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

27) 
28) %.html.fr: fr/%.wml en/%.wml
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

29) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

30) 
31) %.html.se: se/%.wml en/%.wml
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

32) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

33) 
Peter Palfrader Add russian translation

Peter Palfrader authored 18 years ago

34) %.html.ru: ru/%.wml en/%.wml
35) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
36) 
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

37) .deps/%.html.en.d: en/%.wml .deps/.stamp
38) 	tmpfile=`tempfile` \
39) 	lang=`dirname $<` && \
40) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

41) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

42) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
43) 	rm -f $$tmpfile
44) .deps/%.html.de.d: de/%.wml .deps/.stamp
45) 	tmpfile=`tempfile` \
46) 	lang=`dirname $<` && \
47) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

48) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

49) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
50) 	rm -f $$tmpfile
51) .deps/%.html.it.d: it/%.wml .deps/.stamp
52) 	tmpfile=`tempfile` \
53) 	lang=`dirname $<` && \
54) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

55) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

56) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
57) 	rm -f $$tmpfile
58) .deps/%.html.fr.d: fr/%.wml .deps/.stamp
59) 	tmpfile=`tempfile` \
60) 	lang=`dirname $<` && \
61) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

62) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

63) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
64) 	rm -f $$tmpfile
65) .deps/%.html.se.d: se/%.wml .deps/.stamp
66) 	tmpfile=`tempfile` \
67) 	lang=`dirname $<` && \
68) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

69) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

70) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
71) 	rm -f $$tmpfile
Peter Palfrader Add russian translation

Peter Palfrader authored 18 years ago

72) .deps/%.html.ru.d: ru/%.wml .deps/.stamp
73) 	tmpfile=`tempfile` \
74) 	lang=`dirname $<` && \
75) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
76) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
77) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
78) 	rm -f $$tmpfile
Peter Palfrader Split Makefile in two

Peter Palfrader authored 18 years ago

79) .deps/.stamp:
80) 	[ -d .deps ] || mkdir .deps
81) 	touch "$@"
82) 
83) dep: $(DEPFILES)
84) clean:
85) 	rm -f $(HTMLFILES) $(DEPFILES)
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

86) 	for sub in $(SUBDIRS); do \
87) 		$(MAKE) -C "$$sub" WMLBASE=../$(WMLBASE) clean; \
88) 	done