2015-04-29 21:55:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-06-17 22:59:13 +00:00
|
|
|
# Requires GNU Make, but some distros probably don't have the gmake symlink.
|
|
|
|
[ -z "$MAKE" ] && MAKE=make
|
|
|
|
|
2015-09-21 21:40:17 +00:00
|
|
|
while : ; do
|
|
|
|
if [ -f sys/rebuild.sh ]; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
cd ..
|
|
|
|
if [ "`pwd`" = / ]; then
|
|
|
|
echo "Cant find sys/rebuild.sh"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2015-04-29 21:55:03 +00:00
|
|
|
Rebuild() {
|
2015-09-21 21:40:17 +00:00
|
|
|
cd "$1" || exit 1
|
2017-06-17 22:59:13 +00:00
|
|
|
$MAKE clean
|
|
|
|
$MAKE -j8 || exit 1
|
2015-04-29 21:55:03 +00:00
|
|
|
cd -
|
|
|
|
}
|
|
|
|
|
2015-10-30 23:51:44 +00:00
|
|
|
Build() {
|
|
|
|
cd "$1" || exit 1
|
2017-06-17 22:59:13 +00:00
|
|
|
$MAKE -j8 || exit 1
|
2015-10-30 23:51:44 +00:00
|
|
|
cd -
|
|
|
|
}
|
|
|
|
|
2015-09-21 21:40:17 +00:00
|
|
|
RebuildIOSDebug() {
|
2015-10-31 02:45:14 +00:00
|
|
|
Rebuild libr/debug
|
2015-11-16 23:57:22 +00:00
|
|
|
# Rebuild libr/util
|
|
|
|
# Rebuild libr/core
|
2015-09-21 21:40:17 +00:00
|
|
|
Rebuild binr/radare2
|
2017-06-17 22:59:13 +00:00
|
|
|
$MAKE -C binr/radare2 ios-sign
|
2015-09-21 21:40:17 +00:00
|
|
|
if [ -n "${IOSIP}" ]; then
|
|
|
|
scp binr/radare2/radare2 root@"${IOSIP}:."
|
|
|
|
else
|
|
|
|
echo "Set IOSIP environment variable to scp the radare2 program"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-04-29 21:55:03 +00:00
|
|
|
RebuildJava() {
|
|
|
|
Rebuild shlr/java
|
|
|
|
Rebuild libr/asm
|
|
|
|
Rebuild libr/bin
|
2015-05-11 16:30:06 +00:00
|
|
|
Rebuild libr/core
|
2015-04-29 21:55:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RebuildCapstone() {
|
|
|
|
Rebuild shlr/capstone
|
|
|
|
Rebuild libr/asm
|
|
|
|
Rebuild libr/anal
|
|
|
|
}
|
|
|
|
|
|
|
|
RebuildSdb() {
|
|
|
|
Rebuild shlr/sdb
|
2016-12-19 02:05:42 +00:00
|
|
|
Rebuild libr/util
|
|
|
|
}
|
|
|
|
|
2017-06-05 10:38:39 +00:00
|
|
|
RebuildFs() {
|
|
|
|
Rebuild shlr/grub
|
|
|
|
Rebuild libr/fs
|
|
|
|
}
|
|
|
|
|
2015-04-29 21:55:03 +00:00
|
|
|
RebuildBin() {
|
|
|
|
Rebuild libr/bin
|
|
|
|
Rebuild libr/core
|
|
|
|
}
|
|
|
|
|
2016-01-27 00:56:24 +00:00
|
|
|
RebuildGdb() {
|
|
|
|
Rebuild shlr/gdb
|
|
|
|
Rebuild libr/io
|
|
|
|
Rebuild libr/debug
|
|
|
|
}
|
|
|
|
|
2017-08-11 10:23:57 +00:00
|
|
|
RebuildZip() {
|
|
|
|
Rebuild shlr/zip
|
|
|
|
Rebuild libr/io
|
|
|
|
}
|
|
|
|
|
2018-04-11 00:32:27 +00:00
|
|
|
RebuildTcc() {
|
|
|
|
Rebuild shlr/tcc
|
|
|
|
}
|
|
|
|
|
2015-04-29 21:55:03 +00:00
|
|
|
case "$1" in
|
2017-06-12 07:57:30 +00:00
|
|
|
grub|fs)RebuildFs; ;;
|
2015-04-29 21:55:03 +00:00
|
|
|
bin) RebuildBin ; ;;
|
2016-01-27 00:56:24 +00:00
|
|
|
gdb) RebuildGdb ; ;;
|
2015-04-29 21:55:03 +00:00
|
|
|
sdb) RebuildSdb ; ;;
|
2016-12-19 02:05:42 +00:00
|
|
|
spp) RebuildSpp ; ;;
|
2018-04-11 00:32:27 +00:00
|
|
|
tcc) RebuildTcc ; ;;
|
2015-04-29 21:55:03 +00:00
|
|
|
bin) RebuildBin ; ;;
|
2017-08-11 10:23:57 +00:00
|
|
|
zip) RebuildZip ; ;;
|
2015-04-29 21:55:03 +00:00
|
|
|
java) RebuildJava ; ;;
|
2015-09-21 21:40:17 +00:00
|
|
|
iosdbg) RebuildIOSDebug ; ;;
|
2015-04-29 21:55:03 +00:00
|
|
|
capstone|cs) RebuildCapstone ; ;;
|
|
|
|
*)
|
2016-01-27 00:56:24 +00:00
|
|
|
echo "Usage: sys/rebuild.sh [gdb|java|capstone|sdb|iosdbg|cs|sdb|bin]"
|
2015-04-29 21:55:03 +00:00
|
|
|
;;
|
|
|
|
esac
|