2008-02-22 17:31:23 +01:00
|
|
|
@REM @file
|
|
|
|
@REM Windows batch file to setup a WORKSPACE environment
|
2006-04-22 00:54:32 +02:00
|
|
|
@REM
|
2012-04-10 09:45:35 +02:00
|
|
|
@REM Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
2010-04-29 17:17:20 +02:00
|
|
|
@REM This program and the accompanying materials
|
2006-04-22 00:54:32 +02:00
|
|
|
@REM are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
@REM which accompanies this distribution. The full text of the license may be found at
|
|
|
|
@REM http://opensource.org/licenses/bsd-license.php
|
2006-05-09 08:11:05 +02:00
|
|
|
@REM
|
2006-04-22 00:54:32 +02:00
|
|
|
@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
@REM
|
|
|
|
|
2006-05-09 08:11:05 +02:00
|
|
|
@REM set CYGWIN_HOME=C:\cygwin
|
2006-04-22 00:54:32 +02:00
|
|
|
|
2008-02-22 17:31:23 +01:00
|
|
|
@REM usage:
|
|
|
|
@REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]
|
2006-06-09 17:26:28 +02:00
|
|
|
@REM if the argument, skip is present, only the paths and the
|
|
|
|
@REM test and set of environment settings are performed.
|
2006-04-22 00:54:32 +02:00
|
|
|
|
|
|
|
@REM ##############################################################
|
|
|
|
@REM # You should not have to modify anything below this line
|
|
|
|
@REM #
|
|
|
|
|
|
|
|
@echo off
|
|
|
|
|
2007-06-22 08:25:37 +02:00
|
|
|
@REM
|
|
|
|
@REM Set the WORKSPACE to the current working directory
|
|
|
|
@REM
|
2007-10-11 10:58:33 +02:00
|
|
|
pushd .
|
|
|
|
cd %~dp0
|
2010-01-26 03:42:37 +01:00
|
|
|
|
2010-01-26 05:58:56 +01:00
|
|
|
if not defined WORKSPACE (
|
|
|
|
@goto SetWorkSpace
|
2010-01-26 03:42:37 +01:00
|
|
|
)
|
|
|
|
|
2010-01-26 05:58:56 +01:00
|
|
|
if %WORKSPACE% == %CD% (
|
|
|
|
@REM Workspace is not changed.
|
|
|
|
@goto ParseArgs
|
|
|
|
)
|
|
|
|
|
|
|
|
:SetWorkSpace
|
2010-01-26 03:42:37 +01:00
|
|
|
@REM set new workspace
|
|
|
|
@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
|
2007-06-22 08:25:37 +02:00
|
|
|
set WORKSPACE=%CD%
|
2010-01-26 03:42:37 +01:00
|
|
|
set EFI_SOURCE=
|
|
|
|
set EDK_SOURCE=
|
2007-06-22 08:25:37 +02:00
|
|
|
|
2010-01-26 03:42:37 +01:00
|
|
|
:ParseArgs
|
2007-10-15 03:58:41 +02:00
|
|
|
@if /I "%1"=="-h" goto Usage
|
|
|
|
@if /I "%1"=="-help" goto Usage
|
|
|
|
@if /I "%1"=="--help" goto Usage
|
|
|
|
@if /I "%1"=="/h" goto Usage
|
|
|
|
@if /I "%1"=="/?" goto Usage
|
|
|
|
@if /I "%1"=="/help" goto Usage
|
2008-02-22 17:31:23 +01:00
|
|
|
|
2008-12-31 17:57:24 +01:00
|
|
|
@if /I not "%1"=="--nt32" goto no_nt32
|
2008-02-22 17:31:23 +01:00
|
|
|
|
|
|
|
@REM Flag, --nt32 is set
|
|
|
|
@REM The Nt32 Emluation Platform requires Microsoft Libraries
|
|
|
|
@REM and headers to interface with Windows.
|
|
|
|
|
2007-10-31 10:12:54 +01:00
|
|
|
if not defined VCINSTALLDIR (
|
2012-04-10 09:45:35 +02:00
|
|
|
if defined VS100COMNTOOLS (
|
|
|
|
call "%VS100COMNTOOLS%\vsvars32.bat"
|
2007-10-31 10:12:54 +01:00
|
|
|
) else (
|
2012-04-10 09:45:35 +02:00
|
|
|
if defined VS90COMNTOOLS (
|
|
|
|
call "%VS90COMNTOOLS%\vsvars32.bat"
|
2007-10-31 10:12:54 +01:00
|
|
|
) else (
|
2012-04-10 09:45:35 +02:00
|
|
|
if defined VS80COMNTOOLS (
|
|
|
|
call "%VS80COMNTOOLS%\vsvars32.bat"
|
2009-11-17 00:02:57 +01:00
|
|
|
) else (
|
2012-04-10 09:45:35 +02:00
|
|
|
if defined VS71COMNTOOLS (
|
|
|
|
call "%VS71COMNTOOLS%\vsvars32.bat"
|
|
|
|
) else (
|
|
|
|
echo.
|
|
|
|
echo !!! WARNING !!! Cannot find Visual Studio !!!
|
|
|
|
echo.
|
|
|
|
)
|
2009-11-17 00:02:57 +01:00
|
|
|
)
|
2007-10-31 10:12:54 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2007-10-11 10:58:33 +02:00
|
|
|
shift
|
|
|
|
|
2008-12-31 17:57:24 +01:00
|
|
|
:no_nt32
|
2008-02-22 17:31:23 +01:00
|
|
|
@if /I "%1"=="NewBuild" shift
|
|
|
|
@if not defined EDK_TOOLS_PATH set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
|
|
|
|
@IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
|
|
|
|
@call %EDK_TOOLS_PATH%\toolsetup.bat %*
|
2008-12-31 17:57:24 +01:00
|
|
|
@if /I "%1"=="Reconfig" shift
|
|
|
|
@goto check_cygwin
|
2008-02-22 17:31:23 +01:00
|
|
|
|
|
|
|
:BadBaseTools
|
|
|
|
@REM
|
|
|
|
@REM Need the BaseTools Package in order to build
|
|
|
|
@REM
|
2006-04-22 00:54:32 +02:00
|
|
|
echo.
|
2008-02-22 17:31:23 +01:00
|
|
|
echo !!! ERROR !!! The BaseTools Package was not found !!!
|
2006-04-22 00:54:32 +02:00
|
|
|
echo.
|
2008-02-22 17:31:23 +01:00
|
|
|
echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,
|
|
|
|
echo For example,
|
|
|
|
echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools
|
|
|
|
echo The setup script, toolsetup.bat must reside in this folder.
|
|
|
|
echo.
|
|
|
|
@goto end
|
|
|
|
|
2006-05-09 08:11:05 +02:00
|
|
|
:check_cygwin
|
2008-12-31 17:57:24 +01:00
|
|
|
@if exist c:\cygwin (
|
|
|
|
@set CYGWIN_HOME=c:\cygwin
|
2008-02-22 17:31:23 +01:00
|
|
|
) else (
|
2008-12-31 17:57:24 +01:00
|
|
|
@echo.
|
|
|
|
@echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!
|
|
|
|
@echo.
|
2008-02-22 17:31:23 +01:00
|
|
|
)
|
2006-04-22 00:54:32 +02:00
|
|
|
|
2006-07-24 18:03:47 +02:00
|
|
|
@if NOT "%1"=="" goto Usage
|
2008-12-31 17:57:24 +01:00
|
|
|
@goto end
|
2006-10-17 09:07:24 +02:00
|
|
|
|
2006-07-14 08:46:15 +02:00
|
|
|
:Usage
|
2008-12-31 17:57:24 +01:00
|
|
|
@echo.
|
|
|
|
@echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"
|
|
|
|
@echo --nt32 Call vsvars32.bat for NT32 platform build.
|
|
|
|
@echo.
|
|
|
|
@echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.
|
|
|
|
@echo.
|
|
|
|
@echo Note that target.template, tools_def.template and build_rules.template
|
|
|
|
@echo will be only copied to target.txt, tools_def.txt and build_rule.txt
|
|
|
|
@echo respectively if they do not exist. Using option [Reconfig] to force the copy.
|
|
|
|
@echo.
|
2008-02-22 17:31:23 +01:00
|
|
|
@goto end
|
2007-06-22 08:25:37 +02:00
|
|
|
|
2006-04-22 00:54:32 +02:00
|
|
|
:end
|
2008-02-22 17:31:23 +01:00
|
|
|
@popd
|
|
|
|
@echo on
|
2006-04-22 00:54:32 +02:00
|
|
|
|