mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-19 12:22:43 +00:00
Add initial refactoring script and hints for android-mips
This commit is contained in:
parent
36a3fa526a
commit
e2e2af1998
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
BUILD=1
|
||||
FLAGS=""
|
||||
PREFIX="/data/data/org.radare.radare2installer/radare2"
|
||||
|
||||
type pax
|
||||
@ -8,16 +9,22 @@ type pax
|
||||
|
||||
cd `dirname $PWD/$0` ; cd ..
|
||||
|
||||
# we need a more recent ndk to build the mergedlib for mips
|
||||
|
||||
case "$1" in
|
||||
"mips")
|
||||
NDK_ARCH=mips
|
||||
STATIC_BUILD=0
|
||||
STRIP=mips-linux-android-strip
|
||||
# FLAGS="-mlong-calls"
|
||||
# export LDFLAGS="-fuse-ld=gold"
|
||||
;;
|
||||
"mips64")
|
||||
NDK_ARCH=mips64
|
||||
STATIC_BUILD=0
|
||||
STRIP=mips64el-linux-android-strip
|
||||
# FLAGS="-mlong-calls"
|
||||
# export LDFLAGS="-fuse-ld=gold"
|
||||
;;
|
||||
"arm")
|
||||
NDK_ARCH=arm
|
||||
@ -87,7 +94,7 @@ echo NDK_ARCH: ${NDK_ARCH}
|
||||
echo "Using NDK_ARCH: ${NDK_ARCH}"
|
||||
echo "Using STATIC_BUILD: ${STATIC_BUILD}"
|
||||
|
||||
export CFLAGS="-fPIC -fPIE"
|
||||
export CFLAGS="-fPIC -fPIE ${FLAGS}"
|
||||
|
||||
if [ "${BUILD}" = 1 ]; then
|
||||
if [ -z "${NDK}" ]; then
|
||||
|
33
sys/ref.sh
Executable file
33
sys/ref.sh
Executable file
@ -0,0 +1,33 @@
|
||||
# create .h from .c
|
||||
# > git grep R_API open.c |cut -d : -f 2- | sed -e 's, {,;,'
|
||||
|
||||
# find files with \r\n
|
||||
# > git grep `printf "\r\n"`
|
||||
|
||||
# find and replace
|
||||
|
||||
case "$1" in
|
||||
h)
|
||||
git grep ^R_API $2 |cut -d : -f 2- | sed -e 's, {,;,'
|
||||
;;
|
||||
g)
|
||||
git grep "$2"
|
||||
;;
|
||||
n)
|
||||
shift
|
||||
while : ; do
|
||||
A="$1"
|
||||
perl -ne 's/\r\n/\n/g;print' < $A > $A._
|
||||
mv $A._ $A
|
||||
shift
|
||||
[ -z "$1" ] && break
|
||||
done
|
||||
;;
|
||||
*)
|
||||
echo "Usage sys/ref.sh [action] [...]"
|
||||
echo " h [path] # print R_API function signatures from C to H"
|
||||
echo " s [sed] # perform regex on a bunch of files"
|
||||
echo " n [newlines] # newlines replacements"
|
||||
echo " g [regex] [path] # perform regex on a bunch of files"
|
||||
;;
|
||||
esac
|
Loading…
x
Reference in New Issue
Block a user