Hamilton LaboratoriesHamilton C shell 2012User guideSamples

makecpgm.csh

Oregon Coast

makecpgm.csh
Previous | Next

#  "Make" the c programs in this directory.
#  Copyright (c) 1989-2012 by Hamilton Laboratories.  All rights reserved.
      
# Just discard any wildcards that don't produce matches.
set nonomatch = 2

proc make(cfile)

   # make (i.e., recompile) a given .c file if
   #   a) there's no corresponding .exe, or
   #   b) the .exe is older than the .c file or any of the .h headers (if
   #      there are any).

   set root = $cfile:r
   if (! -e $root.exe || ! `newer $root.exe $i *.h`) then
      cl -debug:none -Dcdecl= $cfile user32.lib
      rm $root.obj
   end
end

foreach i (*.c)
   make $i
end

Previous | Next