3 # Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>
4 # Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 # Setup workspace if it is not set
22 if [ -z "$WORKSPACE" ]
24 echo Initializing workspace
25 if [ ! -e `pwd`/edksetup.sh
]
29 # This version is for the tools in the BaseTools project.
30 # this assumes svn pulls have the same root dir
31 # export EDK_TOOLS_PATH=`pwd`/../BaseTools
32 # This version is for the tools source in edk2
33 export EDK_TOOLS_PATH
=`pwd`/BaseTools
35 source edksetup.sh BaseTools
37 echo Building from
: $WORKSPACE
41 # Pick a default tool type for a given OS
48 CYGWIN
*) echo Cygwin not fully supported yet.
;;
50 Major
=$
(uname
-r | cut
-f 1 -d '.')
53 echo UnixPkg requires Snow Leopard or later OS
59 # NETWORK_SUPPORT="-D NETWORK_SUPPORT"
60 BUILD_NEW_SHELL
="-D BUILD_NEW_SHELL"
61 BUILD_FAT
="-D BUILD_FAT"
65 if [ -z "$TARGET_TOOLS" ]
67 TARGET_TOOLS
=$UNIXPKG_TOOLS
70 BUILD_ROOT_ARCH
=$WORKSPACE/Build
/EmuUnixX64
/DEBUG_
"$UNIXPKG_TOOLS"/X64
72 if [[ ! -f `which build` ||
! -f `which GenFv` ]];
74 # build the tools if they don't yet exist. Bin scheme
75 echo Building tools as they are not
in the path
76 make -C $WORKSPACE/BaseTools
77 elif [[ ( -f `which build` ||
-f `which GenFv` ) && ! -d $EDK_TOOLS_PATH/Source
/C
/bin
]];
79 # build the tools if they don't yet exist. BinWrapper scheme
80 echo Building tools no
$EDK_TOOLS_PATH/Source
/C
/bin directory
81 make -C $WORKSPACE/BaseTools
83 echo using prebuilt tools
89 if [[ $arg == run
]]; then
93 # On Darwin we can't use dlopen, so we have to load the real PE/COFF images.
94 # This .gdbinit script sets a breakpoint that loads symbols for the PE/COFFEE
95 # images that get loaded in SecMain
97 cp $WORKSPACE/InOsEmuPkg
/Unix
/.gdbinit
$WORKSPACE/Build
/EmuUnixX64
/DEBUG_
"$UNIXPKG_TOOLS"/X64
101 /usr
/bin
/gdb
$BUILD_ROOT_ARCH/SecMain
-q -cd=$BUILD_ROOT_ARCH -x $WORKSPACE/InOsEmuPkg
/Unix
/GdbRun
105 if [[ $arg == cleanall
]]; then
106 make -C $WORKSPACE/BaseTools clean
107 build
-p $WORKSPACE/InOsEmuPkg
/Unix
/UnixX64.dsc
-a X64
-t $TARGET_TOOLS -D SEC_ONLY
-n 3 clean
108 build
-p $WORKSPACE/InOsEmuPkg
/Unix
/UnixX64.dsc
-a X64
-t $UNIXPKG_TOOLS -n 3 clean
109 build
-p $WORKSPACE/ShellPkg
/ShellPkg.dsc
-a X64
-t $UNIXPKG_TOOLS -n 3 clean
113 if [[ $arg == clean
]]; then
114 build
-p $WORKSPACE/InOsEmuPkg
/Unix
/UnixX64.dsc
-a X64
-t $TARGET_TOOLS -D SEC_ONLY
-n 3 clean
115 build
-p $WORKSPACE/InOsEmuPkg
/Unix
/UnixX64.dsc
-a X64
-t $UNIXPKG_TOOLS -n 3 clean
123 # Build the edk2 UnixPkg
125 if [[ $TARGET_TOOLS == $UNIXPKG_TOOLS ]]; then
126 build
-p $WORKSPACE/InOsEmuPkg
/Unix
/UnixX64.dsc
-a X64
-t $UNIXPKG_TOOLS -D UNIX_SEC_BUILD
$NETWORK_SUPPORT $BUILD_NEW_SHELL $BUILD_FAT -n 3 $1 $2 $3 $4 $5 $6 $7 $8
128 build
-p $WORKSPACE/InOsEmuPkg
/Unix
/UnixX64.dsc
-a X64
-t $TARGET_TOOLS -D UNIX_SEC_BUILD
-D SKIP_MAIN_BUILD
-n 3 $1 $2 $3 $4 $5 $6 $7 $8 modules
129 build
-p $WORKSPACE/InOsEmuPkg
/Unix
/UnixX64.dsc
-a X64
-t $UNIXPKG_TOOLS $NETWORK_SUPPORT $BUILD_NEW_SHELL $BUILD_FAT -n 3 $1 $2 $3 $4 $5 $6 $7 $8
130 cp $WORKSPACE/Build
/EmuUnixX64
/DEBUG_
"$TARGET_TOOLS"/X64
/SecMain
$WORKSPACE/Build
/EmuUnixX64
/DEBUG_
"$UNIXPKG_TOOLS"/X64