|
|
@@ -1,34 +1,44 @@
|
|
|
#!/bin/sh
|
|
|
|
|
|
-cd $PWD
|
|
|
-if test ! -f stamp.$1
|
|
|
+#some files dont have any #ifdef HUB|LEAF
|
|
|
+#but they do have a header included which DOES
|
|
|
+#this can potentially cause major problems with sizeof(struct) etc...
|
|
|
+#temporary solution: MAKE CLEAN
|
|
|
+
|
|
|
+other=""
|
|
|
+
|
|
|
+if [ $1 = "hub" ]; then
|
|
|
+ other="leaf"
|
|
|
+fi
|
|
|
+
|
|
|
+if [ $1 = "leaf" ]; then
|
|
|
+ other="hub"
|
|
|
+fi
|
|
|
+
|
|
|
+
|
|
|
+if test ! -f stamp.$1 && test -f stamp.$other
|
|
|
then
|
|
|
flist="`find src -name \*.c`"
|
|
|
- cfiles="`grep -l \"def [H|L][U|E][B|A]\" $flist`"
|
|
|
+# cfiles="`grep -l \"def [H|L][U|E][B|A]\" $flist`"
|
|
|
echo "[*] Cleaning up files for $1 build"
|
|
|
- for s in $cfiles
|
|
|
+# for s in $cfiles
|
|
|
+ for s in $flist
|
|
|
do
|
|
|
bleh="`echo $s | cut -d / -f 2`";
|
|
|
if [ $bleh = "mod" ]; then
|
|
|
-#echo "src/mod/irc.mod/cmdsirc.c" | cut -d / -f 3
|
|
|
-#elif [ $1 = "binary" ]; then
|
|
|
mod="`echo $s | cut -d / -f 3`";
|
|
|
os="`echo src/mod/$mod | sed s/\\\.mod/\\\.o/g`";
|
|
|
-# echo "deleting $os"
|
|
|
- rm -f $os
|
|
|
-# fi
|
|
|
+ rm -f $os
|
|
|
else
|
|
|
os="`echo $s | sed s/\\\.c/\\\.o/g`";
|
|
|
if test -f $os
|
|
|
then
|
|
|
if test "`file $os | grep ELF`"
|
|
|
then
|
|
|
-# echo "Deleting $os"
|
|
|
rm -f $os
|
|
|
else
|
|
|
if test "`file $os | grep object`"
|
|
|
then
|
|
|
-# echo "Deleting $os"
|
|
|
rm -f $os
|
|
|
fi
|
|
|
fi
|