maketype 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/sh
  2. #some files dont have any #ifdef HUB|LEAF
  3. #but they do have a header included which DOES
  4. #this can potentially cause major problems with sizeof(struct) etc...
  5. #temporary solution: MAKE CLEAN
  6. other=""
  7. if [ $1 = "hub" ]; then
  8. other="leaf"
  9. fi
  10. if [ $1 = "leaf" ]; then
  11. other="hub"
  12. fi
  13. if test ! -f stamp.$1 && test -f stamp.$other
  14. then
  15. flist="`find src -name \*.c`"
  16. # cfiles="`grep -l \"def [H|L][U|E][B|A]\" $flist`"
  17. echo "[*] Cleaning up files for $1 build"
  18. # for s in $cfiles
  19. for s in $flist
  20. do
  21. bleh="`echo $s | cut -d / -f 2`";
  22. if [ $bleh = "mod" ]; then
  23. mod="`echo $s | cut -d / -f 3`";
  24. os="`echo src/mod/$mod | sed s/\\\.mod/\\\.o/g`";
  25. rm -f $os
  26. else
  27. os="`echo $s | sed s/\\\.c/\\\.o/g`";
  28. if test -f $os
  29. then
  30. if test "`file $os | grep ELF`"
  31. then
  32. rm -f $os
  33. else
  34. if test "`file $os | grep object`"
  35. then
  36. rm -f $os
  37. fi
  38. fi
  39. fi
  40. fi
  41. done
  42. fi
  43. rm -f stamp.*
  44. touch stamp.$1