X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BeagleBoardPkg%2Fbuild.sh;h=87f29891ba0b58301e6317b28f7b58e3613c27ed;hb=f5df743f4860553a5fd7f045fd1b77d5654788ae;hp=94cabbe6239dea815bd6a3e535597d33a30065fa;hpb=2ef2b01e07c02db339f34004445734a2dbdd80e1;p=mirror_edk2.git diff --git a/BeagleBoardPkg/build.sh b/BeagleBoardPkg/build.sh index 94cabbe623..87f29891ba 100755 --- a/BeagleBoardPkg/build.sh +++ b/BeagleBoardPkg/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2008 - 2009, Apple, Inc. All rights reserved. -# All rights reserved. This program and the accompanying materials +# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
+# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php @@ -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 @@ -48,17 +51,22 @@ else fi # -# Pick a default tool type for a given OS +# Pick a default tool type for a given OS if no toolchain already defined # -case `uname` in - CYGWIN*) +if [ -z "$TARGET_TOOLS" ] +then + case `uname` in + CYGWIN*) TARGET_TOOLS=RVCT31CYGWIN ;; - Linux*) - # Not tested - TARGET_TOOLS=ELFGCC + Linux*) + if [[ ! -z `locate arm-linux-gnueabi-gcc` ]]; then + TARGET_TOOLS=ARMLINUXGCC + else + TARGET_TOOLS=ARMGCC + fi ;; - Darwin*) + Darwin*) Major=$(uname -r | cut -f 1 -d '.') if [[ $Major == 9 ]] then @@ -68,17 +76,27 @@ case `uname` in TARGET_TOOLS=XCODE32 fi ;; -esac + esac +fi + +TARGET=DEBUG +for arg in "$@" +do + if [[ $arg == RELEASE ]]; + then + TARGET=RELEASE + fi +done -BUILD_ROOT=$WORKSPACE/Build/BeagleBoard/DEBUG_"$TARGET_TOOLS" +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 +104,12 @@ 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 +if [[ $TARGET == RELEASE ]]; then + build -p $WORKSPACE/BeagleBoardPkg/BeagleBoardPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET -D DEBUG_TARGET=RELEASE $2 $3 $4 $5 $6 $7 $8 +else + build -p $WORKSPACE/BeagleBoardPkg/BeagleBoardPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET $1 $2 $3 $4 $5 $6 $7 $8 +fi + for arg in "$@" do @@ -94,7 +117,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 @@ -115,12 +138,12 @@ rm -f $FLASH_BOOT # # Ram starts at 0x80000000 -# OMAP 3530 TRM defines 0x80008208 as the entry point +# OMAP 3530 TRM defines 0x80008000 as the entry point # The reset vector is caught by the mask ROM in the OMAP 3530 so that is why this entry # point looks so strange. # OMAP 3430 TRM section 26.4.8 has Image header information. (missing in OMAP 3530 TRM) # -$GENERATE_IMAGE -D $WORKSPACE/BeagleBoardPkg/ConfigurationHeader.dat -E 0x80008208 -I $BUILD_ROOT/FV/BEAGLEBOARD_EFI.fd -O $FLASH_BOOT +$GENERATE_IMAGE -D $WORKSPACE/BeagleBoardPkg/ConfigurationHeader.dat -E 0x80008000 -I $BUILD_ROOT/FV/BEAGLEBOARD_EFI.fd -O $FLASH_BOOT echo Creating debugger scripts process_debug_scripts $WORKSPACE/BeagleBoardPkg/Debugger_scripts