make.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/sh
  2. ## Copyright (c) 2014 Minoca Corp.
  3. ##
  4. ## This file is licensed under the terms of the GNU General Public License
  5. ## version 3. Alternative licensing terms are available. Contact
  6. ## info@minocacorp.com for details. See the LICENSE file at the root of this
  7. ## project for complete licensing information..
  8. ##
  9. ## Script Name:
  10. ##
  11. ## make.sh <directory> <make_arguments>
  12. ##
  13. ## Abstract:
  14. ##
  15. ## This script runs make somewhere while inside the Minoca OS environment.
  16. ## SRCROOT, DEBUG, and ARCH must be set.
  17. ##
  18. ## Author:
  19. ##
  20. ## Evan Green 13-May-2014
  21. ##
  22. ## Environment:
  23. ##
  24. ## Minoca (Windows) Build
  25. ##
  26. set -e
  27. SAVE_IFS="$IFS"
  28. IFS='
  29. '
  30. export SRCROOT=`echo $SRCROOT | sed 's_\\\\_/_g'`
  31. IFS="$SAVE_IFS"
  32. unset SAVE_IFS
  33. if test -z $SRCROOT; then
  34. echo "SRCROOT must be set."
  35. exit 1
  36. fi
  37. if test -z $ARCH; then
  38. echo "ARCH must be set."
  39. exit 1
  40. fi
  41. if test -z $DEBUG; then
  42. echo "DEBUG must be set."
  43. exit 1
  44. fi
  45. export TMPDIR=$PWD
  46. export TEMP=$TMPDIR
  47. SOURCE_DIRECTORY=$1
  48. shift
  49. if test -z $SOURCE_DIRECTORY; then
  50. echo "first argument must be source directory."
  51. fi
  52. OUTROOT="$SRCROOT/$ARCH$VARIANT$DEBUG"
  53. export PATH="$SRCROOT/tools/win32/mingw/bin;$OUTROOT/tools/bin;$OUTROOT/testbin;$SRCROOT/tools/win32/scripts;$SRCROOT/tools/win32/swiss;$SRCROOT/tools/win32/bin;$SRCROOT/tools/win32/ppython/app;$SRCROOT/tools/win32/ppython/App/Scripts;$PATH"
  54. cd $SOURCE_DIRECTORY
  55. echo Making in $PWD
  56. echo make "$@"
  57. make "$@"
  58. echo completed make "$@"