-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·49 lines (45 loc) · 915 Bytes
/
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
#!/usr/bin/env bash
# Bash script will eventually be replaced with a make file
TARGET=$1
# Check we need a library??
cd rust-sdl
./configure
make
RESULT=$?
if [ $RESULT -ne 0 ] ; then
echo "Failed to make dependancies"
cd -
exit $RESULT
fi
cd -
# Make the bin directory
if [ ! -d "bin" ]; then
mkdir bin
fi
# Make the libs directory
if [ ! -d "libs" ]; then
mkdir libs
fi
# Scrape them
rm libs/*
mv rust-sdl/*.dummy libs
mv rust-sdl/*.so libs
mv rust-sdl/*.dylib libs
mv rust-sdl/*.dll libs
# Check what project we want to build, or all of them
# Hack it for now
if [ $TARGET ]; then
cd src/$TARGET
./build.sh
cd -
else
DIRS=$(find src -maxdepth 1 -type d )
for DIR in $DIRS; do
if [ ! $DIR == 'src' ]; then
cd $DIR
echo "Building $DIR..."
./build.sh
cd -
fi
done
fi