]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BeagleBoardPkg/build.sh
Add support for a RELASE build
[mirror_edk2.git] / BeagleBoardPkg / build.sh
index 94cabbe6239dea815bd6a3e535597d33a30065fa..8eaa1dbdfd14192359a1da99e72d0dacd3073090 100755 (executable)
@@ -41,6 +41,9 @@ if [ -z "$WORKSPACE" ]
 then
   echo Initializing workspace
   cd ..
+# Uses an external BaseTools project 
+#  export EDK_TOOLS_PATH=`pwd`/../BaseTools
+# Uses the BaseTools in edk2
   export EDK_TOOLS_PATH=`pwd`/BaseTools
   source edksetup.sh BaseTools
 else
@@ -70,15 +73,23 @@ case `uname` in
       ;;
 esac
 
-BUILD_ROOT=$WORKSPACE/Build/BeagleBoard/DEBUG_"$TARGET_TOOLS"
+TARGET=DEBUG
+for arg in "$@"
+do
+  if [[ $arg == RELEASE ]]; then
+    TARGET=RELEASE
+  fi
+done
+
+BUILD_ROOT=$WORKSPACE/Build/BeagleBoard/"$TARGET"_"$TARGET_TOOLS"
 GENERATE_IMAGE=$WORKSPACE/BeagleBoardPkg/Tools/generate_image
 FLASH_BOOT=$BUILD_ROOT/FV/BeagleBoard_EFI_flashboot.fd
 
-if  [[ ! -f `which build` || ! -f `which GenFv` ]];
+if  [[ ! -e $EDK_TOOLS_PATH/Source/C/bin ]];
 then
   # build the tools if they don't yet exist
-  echo Building tools
-  make -C $WORKSPACE/BaseTools
+  echo Building tools: $EDK_TOOLS_PATH
+  make -C $EDK_TOOLS_PATH
 else
   echo using prebuilt tools
 fi
@@ -86,7 +97,7 @@ fi
 #
 # Build the edk2 BeagleBoard code
 #
-build -p $WORKSPACE/BeagleBoardPkg/BeagleBoardPkg.dsc -a ARM -t $TARGET_TOOLS $1 $2 $3 $4 $5 $6 $7 $8
+build -p $WORKSPACE/BeagleBoardPkg/BeagleBoardPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET $1 $2 $3 $4 $5 $6 $7 $8
 
 for arg in "$@"
 do
@@ -94,7 +105,7 @@ do
     # no need to post process if we are doing a clean
     exit
   elif [[ $arg == cleanall ]]; then
-    make -C BaseTools/ clean
+    make -C $EDK_TOOLS_PATH clean
     make -C $WORKSPACE/BeagleBoardPkg/Tools clean
     exit