# $Id$ # The two-letter code for the language LANGUAGE := zh SUBLANG := cn hk tw include $(WMLBASE)/../Makefile.common # If you need to modify that is already defined in ../Makefile.common # you can put it below # Experimental tag by the Debian Chinese Translation Team SHELL = /bin/bash BIN = $(WMLBASE)/bin B5TOU8 = $(BIN)/b5tou8 U8TOB5 = $(BIN)/u8tob5 U8TOGB = $(BIN)/u8togb # B5TOGB = ( cat - | $(B5TOU8) | $(U8TOGB) ) B5TOGB = LD_LIBRARY_PATH=$(BIN) $(BIN)/autogb -i big5 -o gb TOCN = $(BIN)/tocn.pl TOHK = $(BIN)/tohk.pl TOTW = $(BIN)/totw.pl FIX_BIG5 = $(BIN)/fix_big5.pl ZHTEMPLATE = $(WMLBASE)/template/debian-zh/template.tmpl # how to include openlogo-nd-50.png here? it's in logos, not in Pics/ ... COMMONPICS = debian.png \ blue-upperleft.png blue-upperright.png \ blue-lowerleft.png blue-lowerright.png COMMONPICS_ZH = $(addprefix $(WMLBASE)/Pics/,$(COMMONPICS)) # ZHMAGIC is obsolete! Don't use it any more. # Old magic that coped with the co-existence of international/chinese -> zh ZHMAGIC = @if `echo $(HTMLDIR) | grep -q '^$(WMLBASE)/$(RELHTMLBASE)/international/chinese'`; then \ test -L $(WMLBASE)/$(RELHTMLBASE)/zh && rm -f $(WMLBASE)/$(RELHTMLBASE)/zh ; \ ZHDIR=`echo $(HTMLDIR) | sed -e 's%^\($(WMLBASE)/$(RELHTMLBASE)/\)international/chinese%\1zh%'` ; \ ZHRELDIR=`echo $(WMLBASE) | sed -e 's%^\.\./%%'`/$(CUR_DIR) ; \ test -d $$ZHDIR || mkdir -p $$ZHDIR ; \ shopt -s nullglob ; \ for i in *.{css,gif,jpg,png}; do \ ln -sf $$ZHRELDIR/$$i $$ZHDIR/ ; \ done ; \ sed -e 's%="\.\./\.\./%="\.\.\1/%g' \ -e 's%="\(index\...\.html"\)%="'$$ZHRELDIR'/\1%;' $(@F) \ > $$ZHDIR/$(@F) ; \ echo " and to $$ZHDIR" ; \ if [ ! -f "$(WMLBASE)/../english/$(CUR_DIR)/$(*F).wml" ]; then \ echo "Making a link $$ZHDIR/$(*F).html -> $(@F)"; \ ln -f -s $(@F) $$ZHDIR/$(*F).html; \ fi ; \ fi WMLOUTPUT = -o UNDEFuZH@uCNuCNHKuCNTW:$(*F).zh-cn.html.tmp@g+w \ -o UNDEFuZH@uHKuCNHKuHKTW:$(*F).zh-hk.html.tmp@g+w \ -o UNDEFuZH@uTWuCNTWuHKTW:$(*F).zh-tw.html.tmp@g+w WMLPROLOG = --prolog=$(FIX_BIG5) WML = wml $(WMLOPTIONS) $(WMLOUTPUT) $(WMLPROLOG) $(WMLEPILOG) install:: @rm -f $(HTMLDIR)/*.imgdot-1x1-transp.gif clean:: rm -f *.$(LANGUAGE)-??.html rm -f *.$(LANGUAGE)-??.html.tmp cleandest:: rm -f $(HTMLDIR)/*.$(LANGUAGE)-??.html $(TOHK): $(TOTW) ln -sf totw.pl $@ # Is there anyway to combine the following two rules into one? $(HTMLDIR)/%.zh-cn.html: %.zh-cn.html @test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR) @echo copying $(@F) to $(HTMLDIR) -@install -m 664 -p $(@F) $(HTMLDIR) $(HTMLDIR)/%.zh-hk.html: %.zh-hk.html @test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR) @echo copying $(@F) to $(HTMLDIR) -@install -m 664 -p $(@F) $(HTMLDIR) $(HTMLDIR)/%.zh-tw.html: %.zh-tw.html @test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR) @echo copying $(@F) to $(HTMLDIR) -@install -m 664 -p $(@F) $(HTMLDIR) # Create %.html -> %.zh-tw.html symlink if no English version of %.wml exists @if [ ! -f "$(WMLBASE)/../english/$(CUR_DIR)/$(*F).wml" ]; then \ echo "Making a link $(@D)/$(*F).html -> $(@F)"; \ ln -f -s $(@F) $(@D)/$(*F).html; \ fi ifndef NOGENERICDEP %.zh-cn.html %.zh-hk.html %.zh-tw.html: %.wml \ $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml \ $(TOCN) $(TOHK) $(TOTW) $(ZHTEMPLATE) $(GETTEXTDEP) \ $(COMMONPICS_ZH) $(WML) $( $*.zh-cn.html @rm -f $*.zh-cn.html.tmp @$(TOCN) $*.zh-cn.html @echo -n "[zh_HK.Big5], " @mv -f $*.zh-hk.html.tmp $*.zh-hk.html @$(TOHK) $*.zh-hk.html @echo "[zh_TW.Big5]." @mv -f $*.zh-tw.html.tmp $*.zh-tw.html @$(TOTW) $*.zh-tw.html else %.zh-cn.html %.zh-hk.html %.zh-tw.html: %.wml \ $(TOCN) $(TOHK) $(TOTW) $(ZHTEMPLATE) $(GETTEXTDEP) \ $(COMMONPICS_ZH) cd $(@D) && $(WML) $(notdir $(<)) @echo -n " * Converting: [zh_CN.GB2312], " @$(B5TOGB) < $*.zh-cn.html.tmp > $*.zh-cn.html @rm -f $*.zh-cn.html.tmp @$(TOCN) $*.zh-cn.html @echo -n "[zh_HK.Big5], " @mv -f $*.zh-hk.html.tmp $*.zh-hk.html @$(TOHK) $*.zh-hk.html @echo "[zh_TW.Big5]." @mv -f $*.zh-tw.html.tmp $*.zh-tw.html @$(TOTW) $*.zh-tw.html endif # template dependencies $(ZHTEMPLATE): $(TEMPLDIR)/template.wml \ $(WMLBASE)/template/debian-zh/macros.tmpl \ $(WMLBASE)/template/debian-zh/navbar.tmpl touch $@ $(COMMONPICS_ZH): cd $(WMLBASE)/Pics \ && cp -sf $(addprefix ../../english/Pics/,$(COMMONPICS)) .