maketype 891 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. cd $PWD
  3. if test ! -f stamp.$1
  4. then
  5. flist="`find src -name \*.c`"
  6. cfiles="`grep -l \"def [H|L][U|E][B|A]\" $flist`"
  7. echo "[*] Cleaning up files for $1 build"
  8. for s in $cfiles
  9. do
  10. bleh="`echo $s | cut -d / -f 2`";
  11. if [ $bleh = "mod" ]; then
  12. #echo "src/mod/irc.mod/cmdsirc.c" | cut -d / -f 3
  13. #elif [ $1 = "binary" ]; then
  14. mod="`echo $s | cut -d / -f 3`";
  15. os="`echo src/mod/$mod | sed s/\\\.mod/\\\.o/g`";
  16. # echo "deleting $os"
  17. rm -f $os
  18. # fi
  19. else
  20. os="`echo $s | sed s/\\\.c/\\\.o/g`";
  21. if test -f $os
  22. then
  23. if test "`file $os | grep ELF`"
  24. then
  25. # echo "Deleting $os"
  26. rm -f $os
  27. else
  28. if test "`file $os | grep object`"
  29. then
  30. # echo "Deleting $os"
  31. rm -f $os
  32. fi
  33. fi
  34. fi
  35. fi
  36. done
  37. fi
  38. rm -f stamp.*
  39. touch stamp.$1