xcode-amalgamate.sh 770 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. if [ $# -ne 1 ];
  3. then
  4. echo "Usage: mac-amalgamate.sh <target directory>"
  5. exit 1
  6. fi
  7. CWD=`pwd`
  8. LIBTOOL=`which libtool`
  9. TARGET="$1"
  10. if [ ! -e $LIBTOOL ];
  11. then
  12. echo "No such file: $LIBTOOL"
  13. exit 1
  14. fi
  15. if [ ! -d $TARGET ];
  16. then
  17. echo "No such target directory: $AR"
  18. exit 1
  19. fi
  20. echo "Using libtool : $LIBTOOL"
  21. echo "Amalgamating target static libs $TARGET"
  22. cd $TARGET
  23. mkdir tmp
  24. # Remove any old library still hanging around
  25. rm -f libgameplay-deps.a
  26. mv *.a ./tmp
  27. # Now use libtool to combine all the .a libs
  28. # You can use:
  29. # xcrun -sdk iphoneos lipo -info libgameplay-deps.a
  30. # To validate all the correct architectures are present.
  31. $LIBTOOL -static `find . -name "*.a" | xargs` -o libgameplay-deps.a
  32. # Clean up
  33. rm -rf ./tmp
  34. cd $CWD