forked from EDeijl/CPHConsoleApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathios-full-build.sh
executable file
·51 lines (39 loc) · 1.17 KB
/
ios-full-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
#!/bin/bash
#
# This script build for iOS on all 3 architectures and then copies each version of the
# static library to XCode
if [ ! -d ghc-ios-scripts ] ; then
echo "the ghc-ios scripts are not installed, please run git submodule update"
exit 1
fi
source settings.env
if [ "$IOS_SCRIPTS" = "" -o "$XCODE_PROJECT_BUILD_DIR" = "" ]; then
echo "Either IOS_SCRIPTS or XCODE_PROJECT_BUILD_DIR is not set"
exit 1
fi
for arch in i386 arm; do
env IOS_SCRIPTS=$IOS_SCRIPTS XCODE_PROJECT_BUILD_DIR=$XCODE_PROJECT_BUILD_DIR ./ios-$arch-build.sh $@
#cabal-ios install && \
#cabal-ios configure -fios $@ && \
#cabal-ios build exe:CPConsoleAppStaticLib
[ $? -eq 0 ] || exit 1
done
echo
echo Merging libraries
echo
lipo dist/arm/build/CPConsoleAppStaticLib/CPConsoleAppStaticLib.a dist/i386/build/CPConsoleAppStaticLib/CPConsoleAppStaticLib.a -create -output CPConsoleAppStaticLib.a
echo
echo Copying libraries
echo
for file in *.h; do
mv "$file" $XCODE_PROJECT_BUILD_DIR/lib/
done
mv CPConsoleAppStaticLib.a $XCODE_PROJECT_BUILD_DIR/lib/
echo
echo Copying config file
echo
cp HaskelliOS.xcconfig $XCODE_PROJECT_BUILD_DIR/
echo
echo Cleaning up
echo
rm -rf liba.a dist/