home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / backup / star-1.3.1.tar.gz / star-1.3.1.tar / star-1.3.1 / conf / mkdep-sco.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1999-05-13  |  2KB  |  48 lines

  1. #!/bin/sh
  2. #ident "%W% %E% %Q%"
  3. ###########################################################################
  4. # Copyright 1999 by J. Schilling
  5. ###########################################################################
  6. #
  7. # Create dependency list with SCO's cc
  8. #
  9. ###########################################################################
  10. #
  11. # This script will probably not work correctly with a list of C-files
  12. # but as we don't need it with 'smake' or 'gmake' it seems to be sufficient.
  13. #
  14. ###########################################################################
  15. # This program is free software; you can redistribute it and/or modify
  16. # it under the terms of the GNU General Public License as published by
  17. # the Free Software Foundation; either version 2, or (at your option)
  18. # any later version.
  19. #
  20. # This program is distributed in the hope that it will be useful,
  21. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  23. # GNU General Public License for more details.
  24. #
  25. # You should have received a copy of the GNU General Public License
  26. # along with this program; see the file COPYING.  If not, write to
  27. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  28. ###########################################################################
  29. FILES=
  30.  
  31. for i in "$@"; do
  32.  
  33.     case "$i" in
  34.  
  35.     -*)    # ignore options
  36.         ;;
  37.     *.c)    if [ ! -z "$FILES" ]; then
  38.             FILES="$FILES "
  39.         fi
  40.         FILES="$FILES$i"
  41.         ;;
  42.     esac
  43. done
  44.  
  45. OFILES=`echo "$FILES" | sed 's;\(.*\).c;\1.o;'`
  46.  
  47. cc -H -E 2>&1 > /dev/null "$@" | grep -hv '^"' | sed -e "s;^;$OFILES: ;"
  48.