home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / program / m2posx02 / m2ppx.g < prev    next >
Text File  |  1993-10-23  |  1KB  |  34 lines

  1. # GULAM-Script for processing m2-files with preprocessor commands.
  2. # Output is a file, which can be compiled by a m2-compiler
  3. # Environment variables:
  4. #  PATH:   must contain the directories, where the programs can be found
  5. #  GNUINC: full path, where the GNU-C-preprocessor searches for include files
  6. #  TEMP:   directory for temporary files (RAM-disk or so)
  7. #
  8. # Parameters:
  9. #  $1: Name that identifies the compiler, e.g. LPRM2, HM2,...-- see PORTAB.M2H
  10. #      for valid names
  11. #  $2: Inputfile, m2 source code with preprocessor commands
  12. #  $3: Outputfile, m2 source code
  13. #
  14. # Programs: (all programs must be in a directory mentioned in PATH)
  15. #  cpp:  the preprocessor (gcc-cpp.ttp or gcc.ttp)
  16. #  x2d1: removes multiple blank lines and does LF->CR/LF translation
  17. #  rm:   removes the temporary file
  18. #
  19. # Switches:
  20. #  -P: removes sync lines (for the C-compiler) from cpp output
  21. #  -D<name>: defines the compiler
  22. #  -imacros <file>: full path of file PORTAB.M2H.
  23. #       NOTE: This was -i in versions 1.X of the GNU-C-preprocessor
  24. #
  25. # Sample call (in gulam): m2ppx LPRM2 file.ipp m:\file.mod
  26. #
  27. echo $2
  28. cpp -P -D$1 -imacros f:\usr\include\m2\portab.m2h $2 ${TEMP}\cpp_tmp.999
  29. x2d1 <${TEMP}\cpp_tmp.999 >$3
  30. rm ${TEMP}\cpp_tmp.999
  31.  
  32.