]> git.proxmox.com Git - mirror_edk2.git/blame - UnixPkg/build.sh
Update NT32 emulation platform to produce dummy CPU I/O 2 Protocol.
[mirror_edk2.git] / UnixPkg / build.sh
CommitLineData
7ee3b613
A
1#!/bin/bash
2#
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
8#
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.
11#
12
13set -e
14shopt -s nocasematch
15
16
17
18#
19# Setup workspace if it is not set
20#
21if [ -z "$WORKSPACE" ]
22then
23 echo Initializing workspace
24 cd ..
25 export EDK_TOOLS_PATH=`pwd`/BaseTools
26 echo $EDK_TOOLS_PATH
27 source edksetup.sh BaseTools
28else
29 echo Building from: $WORKSPACE
30fi
31
32#
33# Pick a default tool type for a given OS
34#
35TARGET_TOOLS=MYTOOLS
36case `uname` in
37 CYGWIN*) echo Cygwin not fully supported yet. ;;
38 Darwin*)
39 Major=$(uname -r | cut -f 1 -d '.')
40 if [[ $Major == 9 ]]
41 then
42 echo UnixPkg requires Snow Leopard or later OS
43 exit 1
44 else
45 TARGET_TOOLS=XCODE32
46 fi
47 ;;
48 Linux*) TARGET_TOOLS=ELFGCC ;;
49
50esac
51
52BUILD_ROOT_ARCH=$WORKSPACE/Build/Unix/DEBUG_"$TARGET_TOOLS"/IA32
53
54if [[ ! -f `which build` || ! -f `which GenFv` ]];
55then
56 # build the tools if they don't yet exist
57 echo Building tools
58 make -C $WORKSPACE/BaseTools
59else
60 echo using prebuilt tools
61fi
62
63
64for arg in "$@"
65do
66 if [[ $arg == run ]]; then
67 case `uname` in
68 Darwin*)
69 #
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
73 #
74 cp $WORKSPACE/UnixPkg/.gdbinit $WORKSPACE/Build/Unix/DEBUG_"$TARGET_TOOLS"/IA32
75 ;;
76 esac
77
78 /usr/bin/gdb $BUILD_ROOT_ARCH/SecMain -q -cd=$BUILD_ROOT_ARCH
79 exit
80 fi
81
82 if [[ $arg == cleanall ]]; then
83 make -C $WORKSPACE/BaseTools clean
84 fi
85done
86
87
88#
89# Build the edk2 UnixPkg
90#
91echo $PATH
92echo `which build`
93build -p $WORKSPACE/EdkShellPkg/EdkShellPkg.dsc -a IA32 -t $TARGET_TOOLS $1 $2 $3 $4 $5 $6 $7 $8
94build -p $WORKSPACE/UnixPkg/UnixPkg.dsc -a IA32 -t $TARGET_TOOLS $1 $2 $3 $4 $5 $6 $7 $8
95exit $?
96