make.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/sh
  2. ## Copyright (c) 2014 Minoca Corp. All Rights Reserved.
  3. ##
  4. ## Script Name:
  5. ##
  6. ## make.sh <directory> <make_arguments>
  7. ##
  8. ## Abstract:
  9. ##
  10. ## This script runs make somewhere while inside the Minoca OS environment.
  11. ## SRCROOT, DEBUG, and ARCH must be set.
  12. ##
  13. ## Author:
  14. ##
  15. ## Evan Green 13-May-2014
  16. ##
  17. ## Environment:
  18. ##
  19. ## Minoca (Windows) Build
  20. ##
  21. set -e
  22. SAVE_IFS="$IFS"
  23. IFS='
  24. '
  25. export SRCROOT=`echo $SRCROOT | sed 's_\\\\_/_g'`
  26. IFS="$SAVE_IFS"
  27. unset SAVE_IFS
  28. if test -z $SRCROOT; then
  29. echo "SRCROOT must be set."
  30. exit 1
  31. fi
  32. if test -z $ARCH; then
  33. echo "ARCH must be set."
  34. exit 1
  35. fi
  36. if test -z $DEBUG; then
  37. echo "DEBUG must be set."
  38. exit 1
  39. fi
  40. export TMPDIR=$PWD
  41. export TEMP=$TMPDIR
  42. SOURCE_DIRECTORY=$1
  43. shift
  44. if test -z $SOURCE_DIRECTORY; then
  45. echo "first argument must be source directory."
  46. fi
  47. OUTROOT="$SRCROOT/$ARCH$VARIANT$DEBUG"
  48. export PATH="$SRCROOT/tools/win32/mingw/bin;$SRCROOT/tools;$OUTROOT/bin;$OUTROOT/bin/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"
  49. cd $SOURCE_DIRECTORY
  50. echo Making in $PWD
  51. echo make "$@"
  52. make "$@"
  53. echo completed make "$@"