2 # Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
3 # This program and the accompanying materials
4 # are licensed and made available under the terms and conditions of the BSD License
5 # which accompanies this distribution. The full text of the license may be found at
6 # http://opensource.org/licenses/bsd-license.php
8 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 # In *inux environment, the build tools's source is required and need to be compiled
12 # firstly, please reference https://github.com/tianocore/tianocore.github.io/wiki/SourceForge-to-Github-Quick-Start
13 # to get how to setup build tool.
15 # Setup the environment for unix-like systems running a bash-like shell.
16 # This file must be "sourced" not merely executed. For example: ". edksetup.sh"
18 # CYGWIN users: Your path and filename related environment variables should be
19 # set up in the unix style. This script will make the necessary conversions to
22 # Please reference edk2 user manual for more detail descriptions at https://github.com/tianocore-docs/Docs/raw/master/User_Docs/EDK_II_UserManual_0_7.pdf
27 echo Please note
: This
script must be
\'sourced
\' so the environment can be changed.
29 echo "source edksetup.sh"
33 function SetWorkspace
()
36 # If WORKSPACE is already set, then we can return right now
38 if [ -n "$WORKSPACE" ]
43 if [ ! ${BASH_SOURCE[0]} -ef .
/edksetup.sh
]
45 echo Run this
script from the base of your tree. For example
:
46 echo " cd /Path/To/Edk/Root"
52 # Check for BaseTools/BuildEnv before dirtying the user's environment.
54 if [ ! -f BaseTools
/BuildEnv
] && [ -z "$EDK_TOOLS_PATH" ]
56 echo BaseTools not found
in your tree
, and EDK_TOOLS_PATH is not
set.
57 echo Please point EDK_TOOLS_PATH
at the directory that contains
58 echo the EDK2 BuildEnv
script.
65 export WORKSPACE
=`pwd`
72 if [ -n "$EDK_TOOLS_PATH" ]
74 .
$EDK_TOOLS_PATH/BuildEnv $
*
75 elif [ -f "$WORKSPACE/BaseTools/BuildEnv" ]
77 .
$WORKSPACE/BaseTools
/BuildEnv $
*
78 elif [ -n "$PACKAGES_PATH" ]
80 PATH_LIST
=$PACKAGES_PATH
81 PATH_LIST
=${PATH_LIST//:/ }
84 if [ -f "$DIR/BaseTools/BuildEnv" ]
86 export EDK_TOOLS_PATH
=$DIR/BaseTools
87 .
$DIR/BaseTools
/BuildEnv $
*
92 echo BaseTools not found
in your tree
, and EDK_TOOLS_PATH is not
set.
93 echo Please check that WORKSPACE or PACKAGES_PATH is not
set incorrectly
94 echo in your shell
, or point EDK_TOOLS_PATH
at the directory that contains
95 echo the EDK2 BuildEnv
script.
118 elif [ $# -eq 1 ] && [ "$1" != "BaseTools" ]