maketype 1007 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/sh
  2. other=""
  3. if [ $1 = "hub" ]; then
  4. other="leaf"
  5. fi
  6. if [ $1 = "leaf" ]; then
  7. other="hub"
  8. fi
  9. if test ! -f stamp.$1 && test -f stamp.$other
  10. then
  11. #Find and remove .c files
  12. flist="`find src -name \*.c`"
  13. cfiles="`grep -l \"def [H|L][U|E][B|A]\" $flist`"
  14. echo "[*] Cleaning up files for $1 build"
  15. for s in $cfiles
  16. do
  17. bleh="`echo $s | cut -d / -f 2`";
  18. if [ $bleh = "mod" ]; then
  19. mod="`echo $s | cut -d / -f 3`";
  20. os="`echo src/mod/$mod | sed s/\\\.mod/\\\.o/g`";
  21. rm -f $os
  22. else
  23. os="`echo $s | sed s/\\\.c/\\\.o/g`";
  24. if test -f $os
  25. then
  26. if test "`file $os | grep ELF`"
  27. then
  28. rm -f $os
  29. else
  30. if test "`file $os | grep object`"
  31. then
  32. rm -f $os
  33. fi
  34. fi
  35. fi
  36. fi
  37. done
  38. #Now find and 'touch' header files
  39. flist="`find src -name \*.h`"
  40. cfiles="`grep -l \"def [H|L][U|E][B|A]\" $flist`"
  41. for s in $cfiles
  42. do
  43. touch $s
  44. done
  45. fi
  46. rm -f stamp.*
  47. touch stamp.$1