home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / make.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1995-07-17  |  878 b   |  44 lines

  1. #!/bin/ksh
  2.  
  3. HERE=$PWD
  4.  
  5. if [ "$1" = "-q" ]
  6. then
  7.   shift
  8. else
  9.   case " $* " in
  10.     *\ -k\ *) kflag=y ;;
  11.     *) kflag= ;;
  12.   esac
  13.   error=
  14.   for mf in `find . -name makefile -print | sed -n -e 's@./@@' -e '/\// p' | sort`
  15.   do
  16.     echo --------------------------------------- Making $* in ${mf%/*}
  17.     cd $HERE/${mf%/*}
  18.     if [ "$kflag" ]
  19.     then
  20.       make $* || error=y
  21.     else
  22.       make $* || exit 1
  23.     fi
  24.   done
  25.   test "$error" && exit 1
  26. fi
  27.  
  28. cd $HERE
  29. echo --------------------------------------- Making \"$*\" for library
  30.  
  31. echo > makefile.oi
  32. echo > makefile.rf2
  33. for oh in `find . -name makefile.oh -print | sed 's/^.\///' | sort`
  34. do
  35.   prefix=${oh%/*}
  36.   sed -e "s/^/OBJS += /" -e "s?&/?$prefix/?g" $oh >> makefile.oi
  37.   sed -e "s?&/?$prefix/?g" $oh >> makefile.rf2
  38. done
  39.  
  40. update makefile.rf2 makefile.rf
  41. rm makefile.rf2
  42.  
  43. make.exe $*
  44.