home *** CD-ROM | disk | FTP | other *** search
/ BUG 4 / BUGCD1997_05.BIN / aplic / clip4win / clip4win.exe / C4W30E.HUF / BIN / C4WBUILD.BAT next >
DOS Batch File  |  1995-07-24  |  2KB  |  120 lines

  1. @echo off
  2.     if %1x == x goto usage
  3.     if %1 == @ echo on
  4.     if %1 == @ shift
  5.     set _d_=
  6.  
  7.     if %C4WLINKER%x == BLINKERx goto compile
  8.  
  9. :guess
  10.     if exist %1.rmk goto ownrmk
  11.  
  12. :compile
  13.     clipper %1 /n /w
  14.     if errorlevel 1 goto comerr
  15.  
  16.     if exist clip4win.def set _d_=clip4win
  17.     if exist oo.def set _d_=oo
  18.     if exist %1.def set _d_=%1
  19.  
  20.     if %C4WLINKER%x == BLINKERx goto blinker
  21.     if exist %1.bli goto blinker
  22.     if exist %1.msl goto link
  23.     if %BLINKER%x == x goto link
  24.  
  25. :blinker
  26.     if exist %1.bli goto blinker1
  27.     if exist %1.lnk goto blinker2
  28.     blinker fi %1 lib %2wbrowset,c4wclass,topclass,clip4win deffile %_d_%.def
  29.     if errorlevel 1 goto linkerr
  30.     goto blinker3
  31.  
  32. :blinker1
  33.     blinker @%1.bli
  34.     if errorlevel 1 goto linkerr
  35.     goto blinker3
  36.  
  37. :blinker2
  38.     blinker @%1.lnk
  39.     if errorlevel 1 goto linkerr
  40.     goto blinker3
  41.  
  42. :blinker3
  43.     if exist %1.res goto res
  44.     if exist %1.rc goto rc
  45.     goto exit
  46.  
  47. :link
  48.     if exist %1.msl goto link1
  49.     if exist %1.lnk goto link2
  50.     if %_d_%x == x goto deferr
  51.     link /se:900 %1,,nul,%2wbrowset+c4wclass+topclass+clip4win,%_d_%.def
  52.     if errorlevel 1 goto linkerr
  53.     goto link3
  54.  
  55. :link1
  56.     link @%1.msl
  57.     if errorlevel 1 goto linkerr
  58.     goto link3
  59.  
  60. :link2
  61.     link @%1.lnk
  62.     if errorlevel 1 goto linkerr
  63.     goto link3
  64.  
  65. :link3
  66.     if exist %1.res goto res
  67.     if exist %1.rc goto rc
  68.     goto exit
  69.  
  70. :rc
  71.     rc -r %1
  72.     if errorlevel 1 goto rcerr
  73.  
  74. :res
  75.     rc -k %1
  76.     if errorlevel 1 goto reserr
  77.     goto exit
  78.  
  79. :ownrmk
  80.     rmake %1 /dC4WLINKER:%C4WLINKER% /dBLINKER:%BLINKER% /dC4WRC:%C4WRC%
  81.     goto exit
  82.  
  83. :comerr
  84.     echo Compile failed!
  85.     echo If you need help, run C4WBUILD with no parameters.
  86.     goto exit
  87.  
  88. :deferr
  89.     echo Link not attempted - no .DEF file found!
  90.     echo If you need help, run C4WBUILD with no parameters.
  91.     goto exit
  92.  
  93. :linkerr
  94.     echo Link failed - maybe you need to specify libs?
  95.     echo For help, run C4WBUILD with no parameters.
  96.     goto exit
  97.  
  98. :rcerr
  99.     echo RC -R %1 failed!
  100.     goto exit
  101.  
  102. :reserr
  103.     echo RC -K %1 failed!
  104.     goto exit
  105.  
  106. :usage
  107.     echo Syntax:    C4WBUILD name [libs]      Just name, not name.PRG
  108.     echo ......
  109.     echo If libs are specified for BLINKER, separate and end them with ","
  110.     echo Example:
  111.     echo .......    C4WBUILD YOURFILE OTABT,
  112.     echo .......
  113.     echo If libs are specified for MS LINK, separate and end them with "+"
  114.     echo Example:
  115.     echo .......    C4WBUILD YOURFILE OTABT+
  116.     goto exit
  117.  
  118. :exit
  119.     set _d_=
  120.