3 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 # Copyright (c) 2010, 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
44 # 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 DuetPkg requires Snow Leopard or later OS
65 BUILD_ROOT_ARCH
=$WORKSPACE/Build
/DuetPkg
$PROCESSOR/DEBUG_
"$TARGET_TOOLS"/$PROCESSOR
66 FLOPPY_IMAGE
=$WORKSPACE/Build
/DuetPkg
$PROCESSOR/floppy.img
68 if [[ ! -f `which build` ||
! -f `which GenFv` ]];
70 # build the tools if they don't yet exist. Bin scheme
71 echo Building tools as they are not
in the path
72 make -C $WORKSPACE/BaseTools
73 elif [[ ( -f `which build` ||
-f `which GenFv` ) && ! -d $EDK_TOOLS_PATH/Source
/C
/bin
]];
75 # build the tools if they don't yet exist. BinWrapper scheme
76 echo Building tools no
$EDK_TOOLS_PATH/Source
/C
/bin directory
77 make -C $WORKSPACE/BaseTools
79 echo using prebuilt tools
85 if [[ $arg == qemu
]]; then
87 qemu
-fda $FLOPPY_IMAGE -boot a $
*
91 if [[ $arg == cleanall
]]; then
92 make -C $WORKSPACE/BaseTools clean
93 build
-p $WORKSPACE/DuetPkg
/DuetPkg
$Processor.dsc
-a $PROCESSOR -t $TARGET_TOOLS -n 3 clean
97 if [[ $arg == clean
]]; then
98 build
-p $WORKSPACE/DuetPkg
/DuetPkg
$Processor.dsc
-a $PROCESSOR -t $TARGET_TOOLS -n 3 clean
105 # Build the edk2 DuetPkg
107 echo Running edk2 build
for DuetPkg
$Processor
108 build
-p $WORKSPACE/DuetPkg
/DuetPkg
$Processor.dsc
-a $PROCESSOR -t $TARGET_TOOLS -n 3 $
*
109 echo Running DuetPkg
/PostBuild.sh
110 $WORKSPACE/DuetPkg
/PostBuild.sh
$PROCESSOR $TARGET_TOOLS
111 echo Running DuetPkg
/CreateBootDisk.sh
113 $WORKSPACE/DuetPkg
/CreateBootDisk.sh
file $FLOPPY_IMAGE /dev
/null FAT12
$PROCESSOR $TARGET_TOOLS