-
Notifications
You must be signed in to change notification settings - Fork 1
/
prebuild.sh
61 lines (48 loc) · 1.11 KB
/
prebuild.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
56
57
58
59
#!/bin/bash
#
# Copyright (C) 2008 Zii Labs Pte Ltd
# All Rights Reserved.
#
# Run this script to setup the cmake environment for the build
# (generate the initial cache file, and generate the Makefiles)
#
# Usage: ./prebuild.sh [build arch] [build tree] [absolute path of srcdir]
BUILDARCH=$1
BUILDDIR=$2
SRCDIR=$3
if [[ $PLASZMAHOME = "" ]]; then
echo "PLASZMAHOME not set"
exit
fi
if [[ $APPHOME = "" ]]; then
echo "APPHOME not set"
exit
fi
# set defaults
if [[ $BUILDARCH = "" ]]; then
BUILDARCH=arm
fi
if [[ $BUILDDIR = "" ]]; then
BUILDDIR=build.$BUILDARCH
fi
if [[ $SRCDIR = "" ]]; then
SRCDIR=`pwd`
fi
if [[ -f $BUILDDIR ]]; then
echo "Err: Specified [build tree] path refers to a file"
exit
fi
if [[ ! -d $BUILDDIR ]]; then
mkdir -p $BUILDDIR
fi
if [[ ! -d $APPHOME/bin ]]; then
mkdir -p $APPHOME/bin
fi
if [[ ! -d $APPHOME/lib ]]; then
mkdir -p $APPHOME/lib
fi
#### Run Cmake to generate the Makefiles
echo "Generate the Makefiles"
cd $BUILDDIR
cmake -DCMAKE_TOOLCHAIN_FILE=$PLASZMAHOME/toolchain-s5tools-arm.cmake $SRCDIR
echo "Makefiles generated in $BUILDDIR"