home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / build / hcc < prev    next >
Encoding:
Text File  |  1998-04-08  |  1.2 KB  |  46 lines

  1. #!/bin/sh
  2. #
  3. # The contents of this file are subject to the Netscape Public License
  4. # Version 1.0 (the "NPL"); you may not use this file except in
  5. # compliance with the NPL.  You may obtain a copy of the NPL at
  6. # http://www.mozilla.org/NPL/
  7. #
  8. # Software distributed under the NPL is distributed on an "AS IS" basis,
  9. # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10. # for the specific language governing rights and limitations under the
  11. # NPL.
  12. #
  13. # The Initial Developer of this code under the NPL is Netscape
  14. # Communications Corporation.  Portions created by Netscape are
  15. # Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16. # Reserved.
  17. #
  18.  
  19. #
  20. # Fix brain-damaged compilers that don't understand -o and -c together
  21. #
  22. DASH_C=0
  23. DASH_O=0
  24. for i in $*
  25. do
  26.    case $i in
  27.    -c)     DASH_C=1;;
  28.    -o)     DASH_O=1;;
  29.    *.c)    C_SRC=$i;;
  30.    *.s)    S_SRC=$i;;
  31.    *.o)    OBJECT=$i;;
  32.    esac
  33. done
  34.  
  35. cc $* || exit $?
  36.  
  37. # if there was no -c and -o we're done
  38. [ $DASH_C = 1 -a $DASH_O = 1 ] || exit 0
  39.  
  40. # cc always creates the .o from the .c name
  41. [ $C_SRC ] && OBJ=`basename $C_SRC .c`.o
  42. # or the .o from the .s name
  43. [ $S_SRC ] && OBJ=`basename $S_SRC .s`.o
  44.  
  45. [ -f $OBJECT ] || [ -f $OBJ ] && mv -f $OBJ $OBJECT 
  46.