make.sh
810 Bytes
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
#!/bin/sh
PRJ=oven_control
TARGET=app-prime-gui
if [ -n "$1" ]
then
PRJ=$(basename $1)
fi
if [ -z "$CP_DIR" ]
then
CP_DIR=../release
fi
image_filename=${TARGET}
target_filename=${image_filename}
QMAKE=/opt/toolchain/${FA_CHIPSET}/${FA_PRODUCT}/usr/bin/qmake
case $1 in
debug)
OUTPUT_DIR=debug${TAG}
DEBUG_OPTION=" CONFIG+=debug"
;;
*)
OUTPUT_DIR=release${TAG}
DEBUG_OPTION=""
;;
esac
rm -Rf release${TAG} && mkdir -p release${TAG} && cd release${TAG} && ${QMAKE} ../${PRJ}/${PRJ}.pro -r ${SPEC} ${DEBUG_OPTION} && make && cd ..
if [ $? -ne 0 ]
then
exit $?
fi
for DEST_DIR in ${CP_DIR}
do
echo "copy from ${OUTPUT_DIR}/${image_filename} to ${DEST_DIR}/$target_filename"
mkdir -p ${DEST_DIR}/
cp ${OUTPUT_DIR}/${image_filename} ${DEST_DIR}/${target_filename}
done