-
Notifications
You must be signed in to change notification settings - Fork 1
/
x_drm_es.sh
executable file
·55 lines (44 loc) · 1.26 KB
/
x_drm_es.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
DEF_PREFIX=~/Tools/crosscompile/gcc-aarch64/bin/aarch64-none-linux-gnu-
if [ "$#" -gt 0 ]; then
if [ "$1" = "rv" ]; then
DEF_PREFIX=~/Tools/crosscompile/gcc-riscv64/bin/riscv64-unknown-linux-gnu-
shift
fi
fi
TOOL_PREFIX=${TOOL_PREFIX:-$DEF_PREFIX}
DEF_CXX=${TOOL_PREFIX}g++
DEF_DISASM=${TOOL_PREFIX}objdump
CXX=${CXX:-$DEF_CXX}
CXX_OPTS="-std=c++11 -ffast-math -ftree-vectorize -pthread"
TGT_DIR=${TGT_DIR:-./tgt}
DISASM=${DISASM:-$DEF_DISASM}
if [ "$#" -gt 0 ]; then
if [ "$1" = "prepare" ]; then
if [ ! -d $TGT_DIR ]; then
mkdir $TGT_DIR
fi
cp src/etc/mim/*.* $TGT_DIR
cp -r src/etc/mim/inc $TGT_DIR
cd $TGT_DIR
CC=${TOOL_PREFIX}gcc ./build_mimics.sh
exit
fi
fi
if [ ! -d "$TGT_DIR" ]; then
echo "no target dir"
exit
fi
TGT_INC=$TGT_DIR/inc
TGT_LIB=$TGT_DIR/lib
PROG_INCS="-I src -I inc -I $TGT_INC -I $TGT_INC/drm -I $TGT_INC/drm/drm"
PROG_SRCS="`ls src/*.cpp`"
PROG_LIBS="-L$TGT_LIB -lgbm -ldrm -lEGL -lGLESv2 -ldl"
PROG_DEFS="-DEGL_API_FB -D__DRM__ -DDRM_ES -DOGLSYS_LINUX_INPUT"
EXE_PATH=$TGT_DIR/crosscore_demo
echo "Compiling $EXE_PATH with $CXX..."
$CXX $CXX_OPTS $PROG_INCS $PROG_SRCS $PROG_DEFS $PROG_LIBS -o $EXE_PATH $*
if [ -f $EXE_PATH ]; then
echo "Compiled OK, disassembling..."
$DISASM -SC $EXE_PATH > $EXE_PATH.txt
fi