3 # Copyright (c) 2008 - 2009, Apple, Inc. All rights reserved.
4 # All rights reserved. This program and the accompanying materials
5 # are licensed and made available under the terms and conditions of the BSD License
6 # which accompanies this distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 # Setup workspace if it is not set
21 if [ -z "$WORKSPACE" ]
23 echo Initializing workspace
25 export EDK_TOOLS_PATH
=`pwd`/BaseTools
27 source edksetup.sh BaseTools
29 echo Building from
: $WORKSPACE
33 # Pick a default tool type for a given OS
37 CYGWIN
*) echo Cygwin not fully supported yet.
;;
39 Major
=$
(uname
-r | cut
-f 1 -d '.')
42 echo UnixPkg requires Snow Leopard or later OS
48 Linux
*) TARGET_TOOLS
=ELFGCC
;;
52 BUILD_ROOT_ARCH
=$WORKSPACE/Build
/Unix
/DEBUG_
"$TARGET_TOOLS"/IA32
54 if [[ ! -f `which build` ||
! -f `which GenFv` ]];
56 # build the tools if they don't yet exist
58 make -C $WORKSPACE/BaseTools
60 echo using prebuilt tools
66 if [[ $arg == run
]]; then
70 # On Darwin we can't use dlopen, so we have to load the real PE/COFF images.
71 # This .gdbinit script sets a breakpoint that loads symbols for the PE/COFFEE
72 # images that get loaded in SecMain
74 cp $WORKSPACE/UnixPkg
/.gdbinit
$WORKSPACE/Build
/Unix
/DEBUG_
"$TARGET_TOOLS"/IA32
78 /usr
/bin
/gdb
$BUILD_ROOT_ARCH/SecMain
-q -cd=$BUILD_ROOT_ARCH
82 if [[ $arg == cleanall
]]; then
83 make -C $WORKSPACE/BaseTools clean
89 # Build the edk2 UnixPkg
93 build
-p $WORKSPACE/EdkShellPkg
/EdkShellPkg.dsc
-a IA32
-t $TARGET_TOOLS $1 $2 $3 $4 $5 $6 $7 $8
94 build
-p $WORKSPACE/UnixPkg
/UnixPkg.dsc
-a IA32
-t $TARGET_TOOLS $1 $2 $3 $4 $5 $6 $7 $8