Resolve 910 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. : create a directory Xsrc with name clashes resolved
  2. : and run make in that directory
  3. : '$Header$'
  4. case $# in
  5. 1)
  6. ;;
  7. *) echo "$0: one argument expected" 1>&2
  8. exit 1
  9. ;;
  10. esac
  11. PW=`pwd`
  12. case $1 in
  13. main|emain)
  14. target=$PW/$1
  15. ;;
  16. Xlint)
  17. target=$1
  18. ;;
  19. *) echo "$0: $1: Illegal argument" 1>&2
  20. exit 1
  21. ;;
  22. esac
  23. if test -d ../Xsrc
  24. then
  25. :
  26. else mkdir ../Xsrc
  27. fi
  28. make longnames
  29. : remove code generating routines from the clashes list as they are defines.
  30. : code generating routine names start with C_
  31. sed '/^C_/d' < longnames > tmp$$
  32. cclash -c -l7 tmp$$ > ../Xsrc/Xclashes
  33. rm -f tmp$$
  34. cd ../Xsrc
  35. if cmp -s Xclashes clashes
  36. then
  37. :
  38. else
  39. mv Xclashes clashes
  40. fi
  41. rm -f makefile
  42. for i in `cat $PW/Cfiles`
  43. do
  44. cat >> makefile <<EOF
  45. $i: clashes $PW/$i
  46. cid -Fclashes < $PW/$i > $i
  47. EOF
  48. done
  49. make `cat $PW/Cfiles`
  50. rm -f makefile
  51. ed - $PW/makefile <<'EOF'
  52. /^#EXCLEXCL/,/^#INCLINCL/d
  53. w makefile
  54. q
  55. EOF
  56. make CURRDIR=$PW $target