home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / hcshdemo.zip / csh-os2.zip / SAMPLES / MAKECPGM.CSH < prev    next >
Text File  |  1993-09-28  |  742b  |  29 lines

  1. #    "Make" the c programs in this directory.
  2. #    Copyright (c) 1989 by Hamilton Laboratories.  All rights reserved.
  3.         
  4. alias compile      cl -AS -G2 -Ox  # Microsoft C switches
  5.  
  6. # Just discard any wildcards that don't produce matches.
  7. set nonomatch = 2
  8.  
  9. proc make(cfile)
  10.  
  11.     # make (i.e., recompile) a given .c file if
  12.     #   a) there's no corresponding .exe, or
  13.     #   b) the .exe is older than the .c file or any of the .h headers (if
  14.     #      there are any).
  15.  
  16.     set root = $cfile:r
  17.     if (! -e $root.exe || ! `newer $root.exe $i *.h`) then
  18.         compile $cfile
  19.         # mark .exe file as Presentation Manager window-compatible and
  20.         # long filename-aware.
  21.         markexe -tl $root.exe
  22.         rm $root.obj
  23.     end
  24. end
  25.  
  26. foreach i (*.c)
  27.     make $i
  28. end
  29.