| 1 |
foka |
1.23 |
# The two-letter code for the language |
| 2 |
|
|
LANGUAGE := zh |
| 3 |
foka |
1.29 |
SUBLANG := cn hk tw |
| 4 |
foka |
1.21 |
|
| 5 |
foka |
1.23 |
include $(WMLBASE)/../Makefile.common |
| 6 |
|
|
|
| 7 |
|
|
# If you need to modify that is already defined in ../Makefile.common |
| 8 |
|
|
# you can put it below |
| 9 |
chinese |
1.1 |
|
| 10 |
chinese |
1.2 |
# Experimental tag by the Debian Chinese Translation Team |
| 11 |
foka |
1.23 |
SHELL = /bin/bash |
| 12 |
chinese |
1.3 |
BIN = $(WMLBASE)/bin |
| 13 |
|
|
B5TOU8 = $(BIN)/b5tou8 |
| 14 |
chinese |
1.4 |
U8TOB5 = $(BIN)/u8tob5 |
| 15 |
chinese |
1.3 |
U8TOGB = $(BIN)/u8togb |
| 16 |
foka |
1.28 |
# B5TOGB = ( cat - | $(B5TOU8) | $(U8TOGB) ) |
| 17 |
|
|
B5TOGB = LD_LIBRARY_PATH=$(BIN) $(BIN)/autogb -i big5 -o gb |
| 18 |
chinese |
1.9 |
TOCN = $(BIN)/tocn.pl |
| 19 |
foka |
1.29 |
TOHK = $(BIN)/tohk.pl |
| 20 |
chinese |
1.9 |
TOTW = $(BIN)/totw.pl |
| 21 |
foka |
1.22 |
FIX_BIG5 = $(BIN)/fix_big5.pl |
| 22 |
chinese |
1.2 |
|
| 23 |
foka |
1.25 |
COMMONPICS = debian.jpg logo-50.jpg \ |
| 24 |
|
|
red-upperleft.png red-upperright.png \ |
| 25 |
|
|
red-lowerleft.png red-lowerright.png \ |
| 26 |
|
|
blue-upperleft.png blue-upperright.png \ |
| 27 |
|
|
blue-lowerleft.png blue-lowerright.png |
| 28 |
|
|
|
| 29 |
|
|
COMMONPICS_ZH = $(addprefix $(WMLBASE)/Pics/,$(COMMONPICS)) |
| 30 |
|
|
|
| 31 |
foka |
1.29 |
# ZHMAGIC is obsolete! Don't use it any more. |
| 32 |
|
|
# Old magic that coped with the co-existence of international/chinese -> zh |
| 33 |
foka |
1.26 |
ZHMAGIC = @if `echo $(HTMLDIR) | grep -q '^$(WMLBASE)/$(RELHTMLBASE)/international/chinese'`; then \ |
| 34 |
|
|
test -L $(WMLBASE)/$(RELHTMLBASE)/zh && rm -f $(WMLBASE)/$(RELHTMLBASE)/zh ; \ |
| 35 |
|
|
ZHDIR=`echo $(HTMLDIR) | sed -e 's%^\($(WMLBASE)/$(RELHTMLBASE)/\)international/chinese%\1zh%'` ; \ |
| 36 |
|
|
ZHRELDIR=`echo $(WMLBASE) | sed -e 's%^\.\./%%'`/$(CUR_DIR) ; \ |
| 37 |
|
|
test -d $$ZHDIR || mkdir -p $$ZHDIR ; \ |
| 38 |
|
|
shopt -s nullglob ; \ |
| 39 |
|
|
for i in *.{css,gif,jpg,png}; do \ |
| 40 |
|
|
ln -sf $$ZHRELDIR/$$i $$ZHDIR/ ; \ |
| 41 |
|
|
done ; \ |
| 42 |
|
|
sed -e 's%="\.\./\.\./%="\.\.\1/%g' \ |
| 43 |
|
|
-e 's%="\(index\...\.html"\)%="'$$ZHRELDIR'/\1%;' $(@F) \ |
| 44 |
|
|
> $$ZHDIR/$(@F) ; \ |
| 45 |
|
|
echo " and to $$ZHDIR" ; \ |
| 46 |
foka |
1.27 |
if [ ! -f "$(WMLBASE)/../english/$(CUR_DIR)/$(*F).wml" ]; then \ |
| 47 |
|
|
echo "Making a link $$ZHDIR/$(*F).html -> $(@F)"; \ |
| 48 |
|
|
ln -f -s $(@F) $$ZHDIR/$(*F).html; \ |
| 49 |
|
|
fi ; \ |
| 50 |
foka |
1.26 |
fi |
| 51 |
|
|
|
| 52 |
|
|
|
| 53 |
foka |
1.31 |
WMLOUTPUT = -o UNDEFuZH@uCNuCNHKuCNTW:$(*F).zh-cn.html.tmp@g+w \ |
| 54 |
|
|
-o UNDEFuZH@uHKuCNHKuHKTW:$(*F).zh-hk.html.tmp@g+w \ |
| 55 |
|
|
-o UNDEFuZH@uTWuCNTWuHKTW:$(*F).zh-tw.html.tmp@g+w |
| 56 |
foka |
1.23 |
WMLPROLOG = --prolog=$(FIX_BIG5) |
| 57 |
|
|
WML = wml $(WMLOPTIONS) $(WMLOUTPUT) $(WMLPROLOG) $(WMLEPILOG) |
| 58 |
chinese |
1.18 |
|
| 59 |
foka |
1.23 |
install:: |
| 60 |
|
|
@rm -f $(HTMLDIR)/*.imgdot-1x1-transp.gif |
| 61 |
|
|
|
| 62 |
|
|
clean:: |
| 63 |
|
|
rm -f *.$(LANGUAGE)-??.html |
| 64 |
|
|
rm -f *.$(LANGUAGE)-??.html.tmp |
| 65 |
|
|
|
| 66 |
|
|
cleandest:: |
| 67 |
|
|
rm -f $(HTMLDIR)/*.$(LANGUAGE)-??.html |
| 68 |
|
|
|
| 69 |
foka |
1.29 |
$(TOHK): $(TOTW) |
| 70 |
|
|
ln -sf totw.pl $@ |
| 71 |
foka |
1.23 |
|
| 72 |
|
|
# Is there anyway to combine the following two rules into one? |
| 73 |
|
|
$(HTMLDIR)/%.zh-cn.html: %.zh-cn.html |
| 74 |
|
|
@echo copying $(@F) to $(HTMLDIR) |
| 75 |
foka |
1.30 |
-@install -m 664 -p $(@F) $(HTMLDIR) |
| 76 |
foka |
1.29 |
|
| 77 |
|
|
$(HTMLDIR)/%.zh-hk.html: %.zh-hk.html |
| 78 |
|
|
@echo copying $(@F) to $(HTMLDIR) |
| 79 |
foka |
1.30 |
-@install -m 664 -p $(@F) $(HTMLDIR) |
| 80 |
foka |
1.26 |
|
| 81 |
foka |
1.23 |
$(HTMLDIR)/%.zh-tw.html: %.zh-tw.html |
| 82 |
|
|
@echo copying $(@F) to $(HTMLDIR) |
| 83 |
foka |
1.30 |
-@install -m 664 -p $(@F) $(HTMLDIR) |
| 84 |
foka |
1.23 |
# Create %.html -> %.zh-tw.html symlink if no English version of %.wml exists |
| 85 |
|
|
@if [ ! -f "$(WMLBASE)/../english/$(CUR_DIR)/$(*F).wml" ]; then \ |
| 86 |
|
|
echo "Making a link $(@D)/$(*F).html -> $(@F)"; \ |
| 87 |
|
|
ln -f -s $(@F) $(@D)/$(*F).html; \ |
| 88 |
|
|
fi |
| 89 |
|
|
|
| 90 |
|
|
ifndef NOGENERICDEP |
| 91 |
foka |
1.29 |
%.zh-cn.html %.zh-hk.html %.zh-tw.html: %.wml \ |
| 92 |
foka |
1.23 |
$(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml \ |
| 93 |
barbier |
1.34 |
$(TOCN) $(TOHK) $(TOTW) $(ZHTEMPLATE) $(GETTEXTDEP) \ |
| 94 |
foka |
1.29 |
$(COMMONPICS_ZH) |
| 95 |
foka |
1.23 |
$(WML) $(<F) |
| 96 |
|
|
@echo -n " * Converting: [zh_CN.GB2312], " |
| 97 |
|
|
@$(B5TOGB) < $*.zh-cn.html.tmp > $*.zh-cn.html |
| 98 |
|
|
@rm -f $*.zh-cn.html.tmp |
| 99 |
|
|
@$(TOCN) $*.zh-cn.html |
| 100 |
foka |
1.29 |
@echo -n "[zh_HK.Big5], " |
| 101 |
foka |
1.32 |
@mv -f $*.zh-hk.html.tmp $*.zh-hk.html |
| 102 |
foka |
1.29 |
@$(TOHK) $*.zh-hk.html |
| 103 |
foka |
1.23 |
@echo "[zh_TW.Big5]." |
| 104 |
|
|
@mv -f $*.zh-tw.html.tmp $*.zh-tw.html |
| 105 |
|
|
@$(TOTW) $*.zh-tw.html |
| 106 |
|
|
endif |
| 107 |
|
|
|
| 108 |
|
|
# template dependencies |
| 109 |
|
|
|
| 110 |
|
|
$(WMLBASE)/template/debian-zh/template.tmpl: $(TEMPLDIR)/template.wml \ |
| 111 |
|
|
$(WMLBASE)/template/debian-zh/macros.tmpl \ |
| 112 |
foka |
1.33 |
$(WMLBASE)/template/debian-zh/navbar.tmpl |
| 113 |
foka |
1.23 |
touch $@ |
| 114 |
foka |
1.25 |
|
| 115 |
|
|
$(COMMONPICS_ZH): |
| 116 |
|
|
cd $(WMLBASE)/Pics \ |
| 117 |
|
|
&& cp -sf $(addprefix ../../english/Pics/,$(COMMONPICS)) . |