-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathbuild.sh
executable file
·70 lines (62 loc) · 1.42 KB
/
build.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
60
61
62
63
64
65
66
67
68
69
#!/bin/sh
BASE_DIR=`pwd`
if test -z "$TARGET_OS"; then
TARGET_OS=`uname -s`
fi
if test -z "$MAKE"; then
MAKE=make
fi
if test -z "$CC"; then
CC=gcc
fi
if test -z "$CXX"; then
CXX=g++
fi
case "$TARGET_OS" in
Darwin)
#PLATFORM_CLIBS="-pthread"
#PLATFORM_CFLAGS=""
;;
Linux)
PLATFORM_CLIBS="-pthread"
;;
OS_ANDROID_CROSSCOMPILE)
PLATFORM_CLIBS="-pthread"
;;
CYGWIN_*)
PLATFORM_CLIBS="-lpthread"
;;
SunOS)
PLATFORM_CLIBS="-lpthread -lrt"
;;
FreeBSD)
PLATFORM_CLIBS="-lpthread"
MAKE=gmake
;;
NetBSD)
PLATFORM_CLIBS="-lpthread -lgcc_s"
;;
OpenBSD)
PLATFORM_CLIBS="-pthread"
;;
DragonFly)
PLATFORM_CLIBS="-lpthread"
;;
HP-UX)
PLATFORM_CLIBS="-pthread"
;;
*)
echo "Unknown platform!" >&2
exit 1
esac
rm -f build_config.mk
echo CC=$CC >> build_config.mk
echo CXX=$CXX >> build_config.mk
echo "MAKE=$MAKE" >> build_config.mk
echo "CFLAGS=" >> build_config.mk
echo "CFLAGS = -DNDEBUG -D__STDC_FORMAT_MACROS -Wall -O2 -Wno-sign-compare" >> build_config.mk
echo "CFLAGS += ${PLATFORM_CFLAGS}" >> build_config.mk
echo "CLIBS=" >> build_config.mk
echo "CLIBS += ${PLATFORM_CLIBS}" >> build_config.mk
echo "OUTPUT_DIR=${BASE_DIR}/output" >> build_config.mk
echo "HEADER_OUTPUT_DIR=${BASE_DIR}/output/include/sim" >> build_config.mk