1 | #!/bin/sh
|
---|
2 |
|
---|
3 | die()
|
---|
4 | {
|
---|
5 | echo ERROR: $*
|
---|
6 | exit 1
|
---|
7 | }
|
---|
8 |
|
---|
9 | with_system_nvtt=false
|
---|
10 | for i in "$@"
|
---|
11 | do
|
---|
12 | case $i in
|
---|
13 | --with-system-nvtt ) with_system_nvtt=true ;;
|
---|
14 | esac
|
---|
15 | done
|
---|
16 |
|
---|
17 | cd "$(dirname $0)"
|
---|
18 | # Now in build/workspaces/ (where we assume this script resides)
|
---|
19 |
|
---|
20 | echo "Updating bundled third-party dependencies..."
|
---|
21 | echo
|
---|
22 |
|
---|
23 | # Build/update bundled external libraries
|
---|
24 | (cd ../../libraries/fcollada/src && make) || die "FCollada build failed"
|
---|
25 | echo
|
---|
26 | (cd ../../libraries/spidermonkey-tip && ./build.sh) || die "SpiderMonkey build failed"
|
---|
27 | echo
|
---|
28 | if [ "$with_system_nvtt" = "false" ]; then
|
---|
29 | (cd ../../libraries/nvtt && ./build.sh) || die "NVTT build failed"
|
---|
30 | fi
|
---|
31 | echo
|
---|
32 |
|
---|
33 | # Make sure workspaces/gcc exists.
|
---|
34 | mkdir -p gcc
|
---|
35 |
|
---|
36 | # Now build premake and run it to create the makefiles
|
---|
37 | cd ../premake
|
---|
38 | make -C src || die "Premake build failed"
|
---|
39 |
|
---|
40 | echo
|
---|
41 |
|
---|
42 | # If we're in bash then make HOSTTYPE available to Premake, for primitive arch-detection
|
---|
43 | export HOSTTYPE="$HOSTTYPE"
|
---|
44 |
|
---|
45 | src/bin/premake --outpath ../workspaces/gcc --collada "$@" --target gnu || die "Premake failed"
|
---|