]> git.proxmox.com Git - mirror_edk2.git/blame - UnixPkg/build64.sh
UnixPkg MiscSubClassPlatformDxe: Add en-US langdef to *.uni
[mirror_edk2.git] / UnixPkg / build64.sh
CommitLineData
67f86803 1#!/bin/bash
2#
3# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4# 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
67f86803 17#
18# Setup workspace if it is not set
19#
20if [ -z "$WORKSPACE" ]
21then
22 echo Initializing workspace
23 cd ..
24# This version is for the tools in the BaseTools project.
25# this assumes svn pulls have the same root dir
26# export EDK_TOOLS_PATH=`pwd`/../BaseTools
27# This version is for the tools source in edk2
28 export EDK_TOOLS_PATH=`pwd`/BaseTools
29 echo $EDK_TOOLS_PATH
30 source edksetup.sh BaseTools
31else
32 echo Building from: $WORKSPACE
33fi
34
35#
36# Pick a default tool type for a given OS
37#
38TARGET_TOOLS=MYTOOLS
a761d497 39UNIXPKG_TOOLS=GCC44
67f86803 40case `uname` in
41 CYGWIN*) echo Cygwin not fully supported yet. ;;
a761d497 42 Darwin*)
67f86803 43 Major=$(uname -r | cut -f 1 -d '.')
44 if [[ $Major == 9 ]]
45 then
46 echo UnixPkg requires Snow Leopard or later OS
47 exit 1
a761d497 48 else
67f86803 49 TARGET_TOOLS=XCODE32
a761d497 50 fi
67f86803 51 ;;
52 Linux*) TARGET_TOOLS=ELFGCC ;;
a761d497 53
67f86803 54esac
55
bb111c23 56BUILD_ROOT_ARCH=$WORKSPACE/Build/UnixX64/DEBUG_"$UNIXPKG_TOOLS"/X64
67f86803 57
58if [[ ! -f `which build` || ! -f `which GenFv` ]];
59then
60 # build the tools if they don't yet exist. Bin scheme
61 echo Building tools as they are not in the path
62 make -C $WORKSPACE/BaseTools
63elif [[ ( -f `which build` || -f `which GenFv` ) && ! -d $EDK_TOOLS_PATH/Source/C/bin ]];
64then
65 # build the tools if they don't yet exist. BinWrapper scheme
66 echo Building tools no $EDK_TOOLS_PATH/Source/C/bin directory
67 make -C $WORKSPACE/BaseTools
68else
69 echo using prebuilt tools
70fi
71
72
73for arg in "$@"
74do
75 if [[ $arg == run ]]; then
76 case `uname` in
a761d497 77 Darwin*)
67f86803 78 #
79 # On Darwin we can't use dlopen, so we have to load the real PE/COFF images.
80 # This .gdbinit script sets a breakpoint that loads symbols for the PE/COFFEE
81 # images that get loaded in SecMain
82 #
bb111c23 83 cp $WORKSPACE/UnixPkg/.gdbinit $WORKSPACE/Build/UnixX64/DEBUG_"$UNIXPKG_TOOLS"/X64
67f86803 84 ;;
a761d497 85 esac
67f86803 86
87 /usr/bin/gdb $BUILD_ROOT_ARCH/SecMain -q -cd=$BUILD_ROOT_ARCH
88 exit
89 fi
90
91 if [[ $arg == cleanall ]]; then
a761d497 92 make -C $WORKSPACE/BaseTools clean
45059fab 93 build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $TARGET_TOOLS -D SEC_ONLY -n 3 clean
94 build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $UNIXPKG_TOOLS -n 3 clean
95 exit $?
96 fi
97
98 if [[ $arg == clean ]]; then
99 build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $TARGET_TOOLS -D SEC_ONLY -n 3 clean
100 build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $UNIXPKG_TOOLS -n 3 clean
101 exit $?
67f86803 102 fi
a761d497 103
104
185969ed 105 if [[ $arg == shell ]]; then
bb111c23 106 build -p $WORKSPACE/GccShellPkg/GccShellPkg.dsc -a X64 -t $UNIXPKG_TOOLS -n 3 $2 $3 $4 $5 $6 $7 $8
185969ed 107 exit $?
108 fi
a761d497 109
110
67f86803 111done
112
113
114#
115# Build the edk2 UnixPkg
116#
117echo $PATH
118echo `which build`
bb111c23 119build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $TARGET_TOOLS -D SEC_ONLY -n 3 $1 $2 $3 $4 $5 $6 $7 $8 modules
120build -p $WORKSPACE/UnixPkg/UnixPkgX64.dsc -a X64 -t $UNIXPKG_TOOLS -n 3 $1 $2 $3 $4 $5 $6 $7 $8
121cp $WORKSPACE/Build/UnixX64/DEBUG_"$TARGET_TOOLS"/X64/SecMain $WORKSPACE/Build/UnixX64/DEBUG_"$UNIXPKG_TOOLS"/X64
67f86803 122exit $?
123