home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / m2posx14 / bin / m2ppx.g next >
Text File  |  1994-05-31  |  1KB  |  35 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 have to 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. #  -undef: no predefined (non-standard) macros
  21. #  -P: removes sync lines (for the C-compiler) from cpp output
  22. #  -D<name>: defines the M2-compiler
  23. #  -imacros <file>: full path of file PORTAB.M2H.
  24. #       NOTE: This was -i in versions 1.X of the GNU-C-preprocessor
  25. #
  26. # Sample call (in gulam): m2ppx LPRM2 file.ipp m:\file.mod
  27. #
  28. echo $2
  29. cpp -undef -P -D$1 -imacros e:\m2\posix\include\portab.m2h $2 ${TEMP}\cpp_tmp.999
  30. x2d1 <${TEMP}\cpp_tmp.999 >$3
  31. rm ${TEMP}\cpp_tmp.999
  32.  
  33.