IF "%1"=="palm1lib" GOTO Make_libs
IF "%1"=="p_util" GOTO Make_util
IF "%1"=="p_tcpip" GOTO Make_tcpip
IF "%1"=="p_h323" GOTO Make_h323
IF "%1"=="p_sip" GOTO Make_sip
IF "%1"=="p_mgcp" GOTO Make_mgcp
IF "%1"=="p_n2p" GOTO Make_n2p
IF "%1"=="p_wp" GOTO Make_wp
IF "%1"=="p_iax2" GOTO Make_iax2
IF "%1"=="p_epn" GOTO Make_epn
IF "%1"=="auvtech" GOTO Make_auvtech
IF "%1"=="asiainfo" GOTO Make_asiainfo
IF "%1"=="ringtec" GOTO Make_ringtec
IF "%1"=="citron" GOTO Make_citron
IF "%1"=="yiyang" GOTO Make_yiyang
IF "%1"=="txtc" GOTO Make_txtc
IF "%1"=="skycom" GOTO Make_skycom
IF "%1"=="mediaring" GOTO Make_mediaring

:Make_libs
cd palm1lib
A51 AC97.A51 %A51_OPT% 
C51 AC97REG.C %C51_OPT%
A51 DSP_MEM1.A51 %A51_OPT%
A51 DSP_MEM2.A51 %A51_OPT% 
A51 DSPEXEC.A51 %A51_OPT% 
A51 SDRAM_DSP.A51 %A51_OPT%
A51 MEMCPY_I.A51 %A51_OPT%
A51 MEMCPY_C.A51 %A51_OPT%
A51 P_CODCPY.A51 %A51_OPT%
A51 P_IOPORT.A51 %A51_OPT%
A51 P_MACRO.A51 %A51_OPT%
A51 C2USHORT.A51 %A51_OPT%
A51 USHORT2P.A51 %A51_OPT%
A51 P_HIBYTE.A51 %A51_OPT%
A51 P_MEMCMP.A51 %A51_OPT%
A51 P_MEMCPY.A51 %A51_OPT%
A51 P_MEMSET.A51 %A51_OPT%
A51 P_STRCAT.A51 %A51_OPT%
A51 P_STRCHR.A51 %A51_OPT%
A51 P_STRCMP.A51 %A51_OPT%
A51 P_STRCPY.A51 %A51_OPT%
A51 P_STRLEN.A51 %A51_OPT%
A51 SDRAM_RD.A51 %A51_OPT% 
A51 SDRAM_WR.A51 %A51_OPT% 
C51 RUN_11M.C %C51_OPT% 
C51 RUN_22M.C %C51_OPT% 
C51 RUN_33M.C %C51_OPT% 
C51 SWITCHPG.C %C51_OPT% 
C51 l3_led.C %C51_OPT% 
C51 cam_led.C %C51_OPT% 
C51 led.C %C51_OPT%
A51 md5_fast.A51 %A51_OPT%
A51 flash_wr.A51 %A51_OPT%
A51 p_nocase.A51 %A51_OPT%
C51 Sdram_rw.c %C51_OPT%
C51 Sdram_op.c %C51_OPT%
C51 Sdram_str.c %C51_OPT%
C51 DSP.C %C51_OPT% 
C51 p_cnvt.c %C51_OPT%
C51 p_misc.c %C51_OPT%
C51 p_rand.c %C51_OPT%
C51 p_keyid.c %C51_OPT%
C51 p_atoi.c %C51_OPT%
C51 p_atol.c %C51_OPT%
C51 p_itoa.c %C51_OPT%
C51 p_proxy.c %C51_OPT%
C51 solofile.c %C51_OPT%
cd ..\lib
erase palm1lib.lib
LIB51 CREATE palm1lib.lib
cd ..\palm1lib
LIB51 ADD AC97.OBJ,AC97REG.OBJ,DSP_MEM1.OBJ,DSP_MEM2.OBJ,DSPEXEC.OBJ,SDRAM_DSP.OBJ,MEMCPY_I.OBJ,MEMCPY_C.OBJ TO %LIB_PATH%palm1lib.lib
LIB51 ADD USHORT2P.OBJ,P_MACRO.OBJ,C2USHORT.OBJ,P_HIBYTE.OBJ TO %LIB_PATH%palm1lib.lib
LIB51 ADD P_CODCPY.OBJ,P_IOPORT.OBJ,P_MEMCMP.OBJ,P_MEMCPY.OBJ,P_MEMSET.OBJ TO %LIB_PATH%palm1lib.lib
LIB51 ADD P_STRCAT.OBJ,P_STRCHR.OBJ,P_STRCMP.OBJ,P_STRCPY.OBJ,P_STRLEN.OBJ TO %LIB_PATH%palm1lib.lib
LIB51 ADD p_nocase.obj,flash_wr.obj,md5_fast.obj,RUN_11M.OBJ,RUN_22M.OBJ,RUN_33M.OBJ TO %LIB_PATH%palm1lib.lib
LIB51 ADD SDRAM_RD.OBJ,SDRAM_WR.OBJ,SWITCHPG.OBJ,l3_led.obj,cam_led.obj,led.obj TO %LIB_PATH%palm1lib.lib
LIB51 ADD sdram_str.obj,Sdram_op.obj,sdram_rw.obj,dsp.obj,p_cnvt.obj,p_misc.obj,p_keyid.obj,p_rand.obj TO %LIB_PATH%palm1lib.lib
LIB51 ADD p_itoa.obj,p_atoi.obj,p_atol.obj,p_proxy.obj,solofile.obj TO %LIB_PATH%palm1lib.lib
cd..
IF "%1"=="palm1lib" GOTO End

:Make_util
cd p_util
C51 md5.c %C51_OPT%
REM C51 sha1.c %C51_OPT%
C51 p_asc.c %C51_OPT%
C51 p_ltoa.c %C51_OPT%
C51 p_global.c %C51_OPT%
C51 Sdram_cd.c %C51_OPT%
C51 Sdram_ld.c %C51_OPT%
REM C51 vlan.c %C51_OPT%
cd ..\lib
erase p_util.lib
LIB51 CREATE p_util.lib
cd ..\p_util
LIB51 ADD md5.obj,p_asc.obj,p_ltoa.obj,p_global.obj TO %LIB_PATH%p_util.lib
LIB51 ADD Sdram_cd.obj,Sdram_ld.obj TO %LIB_PATH%p_util.lib
cd..
IF "%1"=="p_util" GOTO End

if not exist p_user goto End

:Make_tcpip
cd p_tcpip
C51 PPPoE.c %C51_OPT%
C51 ppp.c %C51_OPT%
C51 arp.c %C51_OPT%
C51 Ip.c %C51_OPT%
C51 tcpip.c %C51_OPT%
C51 icmp.c %C51_OPT%
C51 tcp.c %C51_OPT%
C51 Udp.c %C51_OPT%
C51 dhcp.c %C51_OPT%
C51 dns.c %C51_OPT%
C51 debug.c %C51_OPT%
cd ..\lib
erase p_tcpip.lib
LIB51 CREATE p_tcpip.lib
cd ..\p_tcpip
LIB51 ADD PPPoE.obj,ppp.obj,arp.obj,Ip.obj,tcpip.obj,icmp.obj,tcp.obj TO %LIB_PATH%p_tcpip.lib
LIB51 ADD Udp.obj,dhcp.obj,dns.obj,debug.obj TO %LIB_PATH%p_tcpip.lib
cd ..
IF "%1"=="p_tcpip" GOTO End

:Make_h323
cd p_h323
C51 h323msg.c %C51_OPT%
C51 h323.c %C51_OPT%
C51 h245.c %C51_OPT%
C51 h2250.c %C51_OPT%
C51 q931.c %C51_OPT%
C51 ras.c %C51_OPT%
C51 h323util.c %C51_OPT%
C51 ras_asn1.c %C51_OPT%
C51 h245asn1.c %C51_OPT%
C51 h235asn1.c %C51_OPT%
cd ..\lib
erase p_h323.lib
LIB51 CREATE p_h323.lib
cd ..\p_h323
LIB51 ADD h323msg.obj,h323.obj,h245.obj,h2250.obj,q931.obj,ras.obj,h323util.obj TO %LIB_PATH%p_h323.lib
LIB51 ADD ras_asn1.obj,h245asn1.obj,h235asn1.obj TO %LIB_PATH%p_h323.lib
cd..
IF "%1"=="p_h323" GOTO End

:Make_sip
cd p_sip
C51 sip_acc.c %C51_OPT%
C51 sip_auth.c %C51_OPT%
C51 sip_call.c %C51_OPT%
C51 sip_comp.c %C51_OPT%
C51 sip_core.c %C51_OPT%
C51 sip_trans.c %C51_OPT%
C51 sip_reg.c %C51_OPT%
C51 sip_rx.c %C51_OPT%
C51 sip_sdp.c %C51_OPT%
C51 sip_tsp.c %C51_OPT%
C51 sip_tu.c %C51_OPT%
C51 sip_util.c %C51_OPT%
cd ..\lib
erase p_sip.lib
LIB51 CREATE p_sip.lib
cd ..\p_sip
LIB51 ADD sip_acc.obj,sip_auth.obj,sip_call.obj,sip_comp.obj,sip_core.obj,sip_trans.obj TO %LIB_PATH%p_sip.lib
LIB51 ADD sip_reg.obj,sip_rx.obj,sip_sdp.obj,sip_tsp.obj,sip_tu.obj,sip_util.obj TO %LIB_PATH%p_sip.lib
cd..
IF "%1"=="p_sip" GOTO End

:Make_n2p
cd p_n2p
C51 n2p.c %C51_OPT%
C51 n2p_call.c %C51_OPT%
C51 n2p_door.c %C51_OPT%
C51 n2p_nat.c %C51_OPT%
C51 n2p_opal.c %C51_OPT%
C51 n2p_util.c %C51_OPT%
cd ..\lib
erase p_n2p.lib
LIB51 CREATE p_n2p.lib
cd ..\p_n2p
LIB51 ADD n2p.obj,n2p_call.obj,n2p_door.obj,n2p_nat.obj,n2p_opal.obj,n2p_util.obj TO %LIB_PATH%p_n2p.lib
cd..
IF "%1"=="p_n2p" GOTO End

:Make_wp
cd p_wp
C51 wp_call.c %C51_OPT%
C51 wp_media.c %C51_OPT%
cd ..\lib
erase p_wp.lib
LIB51 CREATE p_wp.lib
cd ..\p_wp
LIB51 ADD wp_call.obj,wp_media.obj TO %LIB_PATH%p_wp.lib
cd..
IF "%1"=="p_wp" GOTO End

:Make_iax2
cd p_iax2
C51 iax2.c %C51_OPT%
C51 iax2_comp.c %C51_OPT%
C51 iax2_rx.c %C51_OPT%
C51 iax2_session.c %C51_OPT%
C51 iax2_voice.c %C51_OPT%
cd..\lib
erase p_iax2.lib
LIB51 CREATE p_iax2.lib
cd ..\p_iax2
LIB51 ADD iax2.obj,iax2_comp.obj,iax2_rx.obj,iax2_session.obj,iax2_voice.obj TO %LIB_PATH%p_iax2.lib
cd..
IF "%1"=="p_iax2" GOTO END

:Make_epn
cd p_epn
C51 epn.c %C51_OPT%
cd..\lib
erase p_epn.lib
LIB51 CREATE p_epn.lib
cd ..\p_epn
LIB51 ADD epn.obj TO %LIB_PATH%p_epn.lib
cd..
IF "%1"=="p_epn" GOTO END

:Make_mgcp
cd p_mgcp
C51 mgcp_core.c %C51_OPT%
C51 mgcp_trans.c %C51_OPT%
C51 mgcp_auth.c %C51_OPT%
C51 mgcp_tsp.c %C51_OPT%
C51 mgcp_map.c %C51_OPT%
C51 mgcp_sdp.c %C51_OPT%
C51 mgcputil.c %C51_OPT%
cd ..\lib
erase p_mgcp.lib
LIB51 CREATE p_mgcp.lib
cd ..\p_mgcp
LIB51 ADD mgcp_core.obj,mgcp_trans.obj,mgcp_auth.obj,mgcp_tsp.obj,mgcp_sdp.obj,mgcp_map.obj,mgcputil.obj TO %LIB_PATH%p_mgcp.lib
cd..
IF "%1"=="p_mgcp" GOTO End

:Make_auvtech
cd p_user\auvtech
C51 auv_nat.c %C51_OPT%
C51 macenc.c %C51_OPT%
cd ..\..\lib
erase auvtech.lib
LIB51 CREATE auvtech.lib
cd ..\p_user\auvtech
LIB51 ADD macenc.obj, auv_nat.obj TO %LIB_PATH%auvtech.lib
cd..
cd ..
IF "%1"=="auvtech" GOTO End

:Make_asiainfo
cd p_user\asiainfo
C51 asiainfo.c %C51_OPT%
C51 AIVGR.c %C51_OPT%
cd ..\..\lib
erase asiainfo.lib
LIB51 CREATE asiainfo.lib
cd ..\p_user\asiainfo
LIB51 ADD asiainfo.obj, AIVGR.obj TO %LIB_PATH%asiainfo.lib
cd..
cd ..
IF "%1"=="asiainfo" GOTO End

:Make_ringtec
cd p_user\ringtec
C51 ringtec.c %C51_OPT%
cd ..\..\lib
erase ringtec.lib
LIB51 CREATE ringtec.lib
cd ..\p_user\ringtec
LIB51 ADD ringtec.obj TO %LIB_PATH%ringtec.lib
cd..
cd ..
IF "%1"=="ringtec" GOTO End

:Make_citron
cd p_user\citron
C51 citron.c %C51_OPT%
cd ..\..\lib
erase citron.lib
LIB51 CREATE citron.lib
cd ..\p_user\citron
LIB51 ADD citron.obj TO %LIB_PATH%citron.lib
cd..
cd ..
IF "%1"=="citron" GOTO End

:Make_txtc
cd p_user\txtc
C51 txtc.c %C51_OPT%
cd ..\..\lib
erase txtc.lib
LIB51 CREATE txtc.lib
cd ..\p_user\txtc
LIB51 ADD txtc.obj TO %LIB_PATH%txtc.lib
cd..
cd ..
IF "%1"=="txtc" GOTO End

:Make_skycom
cd p_user\skycom
C51 skycom_key.c %C51_OPT%
C51 skycom_money.c %C51_OPT%
cd ..\..\lib
erase skycom.lib
LIB51 CREATE skycom.lib
cd ..\p_user\skycom
LIB51 ADD skycom_key.obj, skycom_money.obj TO %LIB_PATH%skycom.lib
cd..
cd ..
IF "%1"=="skycom" GOTO End

:Make_yiyang
cd p_user\yiyang
C51 yiyang.c %C51_OPT%
cd ..\..\lib
erase yiyang.lib
LIB51 CREATE yiyang.lib
cd ..\p_user\yiyang
LIB51 ADD yiyang.obj TO %LIB_PATH%yiyang.lib
cd..
cd ..
IF "%1"=="yiyang" GOTO End

:Make_mediaring
cd p_user\mediaring
C51 mediaring.c %C51_OPT%
cd ..\..\lib
erase mediaring.lib
LIB51 CREATE mediaring.lib
cd ..\p_user\mediaring
LIB51 ADD mediaring.obj TO %LIB_PATH%mediaring.lib
cd..
cd ..
IF "%1"=="mediaring" GOTO End

:End
