home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / 9TXT / ZE32V270.ZIP / CC.BA_ / CC.BA
Text File  |  1997-01-16  |  4KB  |  119 lines

  1. REM How to use this file
  2. REM ====================
  3.  
  4. REM Add the file  'c:\zeus\zexample\CC.BAT' to the Compiler setup RunFile 
  5. REM making sure to check the 'Use other file' option. Then just compile any 
  6. REM file using the Alt-F10 command to see the results.
  7.  
  8. Echo . Example Batch Compile > %2
  9. Echo . ===================== >> %2
  10. Echo . >> %2
  11. Echo . Below is the description of the batch file arguments:  >> %2
  12. Echo . >> %2
  13. Echo . The file being compiled is '%1' (argument #1) >> %2
  14. Echo . The error file to be generated is '%2' (argument #2) >> %2
  15. Echo . The file being compiled without extension is '%3' (argument #3) >> %2
  16. Echo . >> %2
  17. Echo . For example we are now compiling the file '%1' to generate the   >> %2
  18. Echo . error output file '%2' and could possibly do this using the      >> %2
  19. Echo . following batch file (Borland example) >> %2
  20. Echo . >> %2
  21. Echo . BCC +c:\work\zeus\zeus1.cfg -c %1 >> %2
  22. Echo . >> %2
  23. Echo . For more information on how to configure the compiler support refer    >> %2
  24. Echo . to the section 'Setting up the Compiler' in the online help. For an    >> %2
  25. Echo . example of typical batch files edit the 'CC.BAT' and copy the examples >> %2
  26. Echo . given at the end of this file.                                         >> %2
  27.  
  28. GOTO exit
  29.  
  30. Other Related Information
  31. =========================
  32.  
  33. See Also:
  34.    PM.BAT   -   Example of a Project Make file in batch file format
  35.    ZMI.EXE  -   The Zeus Macro Intepreter. A powerful batch scripting language.
  36.    ZMI.ZM   -   Example of a Zeus Macro Intepreter script file.
  37.  
  38. Information on Writing Batch Files for Zeus
  39. ===========================================
  40.  
  41. The information below shows what your batch file should look like. In
  42. some cases your batch file may only need to be one line long and has 
  43. the following format.
  44.  
  45.       ProgramToRun [OPTIONS] %1 >> %2
  46.  
  47. The command line is made up of the following parts:
  48.  
  49.       ProgramToRun - Your compiler full path and filename goes here
  50.       [OPTIONS]    - Any options required by the ProgramToRun
  51.       %1 >> %2    - File and pipe information supplied by Zeus
  52.    
  53. As an example here is a batch file for the Borland C++ compiler:
  54.  
  55.       BCC +c:\work\zeus\zeus1.cfg -c %1 >> %2
  56.  
  57. To get Zeus to strip a error listing file into an errors only file you would
  58. have a batch file that looks like this:
  59.  
  60.       REM Run the compiler to produce a listing file
  61.       ProgramToRun [OPTIONS] %1
  62.  
  63.       REM Take the listing file and generate a Zeus error file 
  64.       Strip [listing file] Error Warning > %2
  65.  
  66. In this case the [listing file] is the output listing file created by your
  67. compiler. For more information on using strip run Strip ?
  68.  
  69. Sample of how to Write an Extension Sensitive Compile
  70. =====================================================
  71.  
  72. To make Zeus compile a file based on extension you would use a batch
  73. file simular to the one shown below.
  74.  
  75.     @echo off
  76.     
  77.     REM ------------------------------------------------------------
  78.     REM These give you an idea on what gets passed to the batch file
  79.     REM ------------------------------------------------------------
  80.     
  81.     echo Argument #1) %1
  82.     echo Argument #2) %2
  83.     echo Argument #3) %3
  84.     
  85.     REM -------------------------
  86.     REM See if we have a CPP file
  87.     REM -------------------------
  88.     
  89.     IF NOT %1 == %3.cpp GOTO MAKE
  90.        CL @C:\ZEUS\ZEUS.RSP -c %1 >> %2
  91.        GOTO exit
  92.     
  93.     REM -------------------------
  94.     REM See if we have a MAK file
  95.     REM -------------------------
  96.     
  97.     :MAKE
  98.     
  99.     IF NOT %1 == %3.mak GOTO ERROR
  100.        nmake -f%1 >> %2
  101.        GOTO exit
  102.     
  103.     REM -------------------
  104.     REM Unknown file format
  105.     REM -------------------
  106.     
  107.     :ERROR
  108.     
  109.     echo Error compiling file '%1' as this file extension is not supported! > %2
  110.     
  111.     :exit
  112.     
  113.     REM --------------------------------------------------------------
  114.     REM Add this pause and set the visible state to normal if you are
  115.     REM having trouble getting this stuff to work.
  116.     REM --------------------------------------------------------------
  117.     
  118.     REM pause
  119.