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
|
2014-10-30 18:09:25 +01:00
|
|
|
@REM Copyright (c) 2006 - 2014, 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 (
|
2014-02-24 15:09:00 +01:00
|
|
|
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.
|
2014-02-24 15:09:00 +01:00
|
|
|
goto ParseArgs
|
2010-01-26 05:58:56 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
:SetWorkSpace
|
2010-01-26 03:42:37 +01:00
|
|
|
@REM set new workspace
|
|
|
|
@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
|
2015-10-08 11:29:09 +02:00
|
|
|
if not defined WORKSPACE (
|
|
|
|
set WORKSPACE=%CD%
|
|
|
|
set EFI_SOURCE=
|
|
|
|
set EDK_SOURCE=
|
|
|
|
)
|
2007-06-22 08:25:37 +02:00
|
|
|
|
2010-01-26 03:42:37 +01:00
|
|
|
:ParseArgs
|
2014-02-24 15:09:00 +01: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
|
|
|
|
2014-02-24 15:09:00 +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 (
|
2014-10-30 18:09:25 +01:00
|
|
|
if defined VS120COMNTOOLS (
|
|
|
|
call "%VS120COMNTOOLS%\vsvars32.bat"
|
2007-10-31 10:12:54 +01:00
|
|
|
) else (
|
2014-10-30 18:09:25 +01:00
|
|
|
if defined VS110COMNTOOLS (
|
|
|
|
call "%VS110COMNTOOLS%\vsvars32.bat"
|
2007-10-31 10:12:54 +01:00
|
|
|
) else (
|
2014-10-30 18:09:25 +01:00
|
|
|
if defined VS100COMNTOOLS (
|
|
|
|
call "%VS100COMNTOOLS%\vsvars32.bat"
|
2009-11-17 00:02:57 +01:00
|
|
|
) else (
|
2014-10-30 18:09:25 +01:00
|
|
|
if defined VS90COMNTOOLS (
|
|
|
|
call "%VS90COMNTOOLS%\vsvars32.bat"
|
2012-04-10 09:45:35 +02:00
|
|
|
) else (
|
2014-10-30 18:09:25 +01:00
|
|
|
if defined VS80COMNTOOLS (
|
|
|
|
call "%VS80COMNTOOLS%\vsvars32.bat"
|
2013-09-04 09:41:04 +02:00
|
|
|
) else (
|
2014-10-30 18:09:25 +01:00
|
|
|
if defined VS71COMNTOOLS (
|
|
|
|
call "%VS71COMNTOOLS%\vsvars32.bat"
|
|
|
|
) else (
|
|
|
|
echo.
|
|
|
|
echo !!! WARNING !!! Cannot find Visual Studio !!!
|
|
|
|
echo.
|
|
|
|
)
|
2013-09-04 09:41:04 +02:00
|
|
|
)
|
2012-04-10 09:45:35 +02:00
|
|
|
)
|
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
|
2015-10-08 11:29:09 +02:00
|
|
|
|
2014-02-24 15:09:00 +01:00
|
|
|
if /I "%1"=="NewBuild" shift
|
2015-10-08 11:29:09 +02:00
|
|
|
if exist %WORKSPACE%\BaseTools (
|
|
|
|
set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools
|
|
|
|
) else (
|
|
|
|
if defined PACKAGES_PATH (
|
|
|
|
for %%i IN (%PACKAGES_PATH%) DO (
|
|
|
|
if exist %%~fi\BaseTools (
|
|
|
|
set EDK_TOOLS_PATH=%%~fi\BaseTools
|
|
|
|
goto checkBaseTools
|
|
|
|
)
|
|
|
|
)
|
|
|
|
) else (
|
|
|
|
echo.
|
|
|
|
echo !!! ERROR !!! Cannot find BaseTools !!!
|
|
|
|
echo.
|
|
|
|
goto BadBaseTools
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%
|
|
|
|
|
|
|
|
:checkBaseTools
|
2014-02-24 15:09:00 +01:00
|
|
|
IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools
|
|
|
|
call %EDK_TOOLS_PATH%\toolsetup.bat %*
|
|
|
|
if /I "%1"=="Reconfig" shift
|
|
|
|
goto check_cygwin
|
2008-02-22 17:31:23 +01:00
|
|
|
|
|
|
|
:BadBaseTools
|
|
|
|
@REM
|
2014-02-24 15:09:00 +01:00
|
|
|
REM Need the BaseTools Package in order to build
|
2008-02-22 17:31:23 +01:00
|
|
|
@REM
|
2014-02-24 15:09:00 +01:00
|
|
|
@echo.
|
|
|
|
@echo !!! ERROR !!! The BaseTools Package was not found !!!
|
|
|
|
@echo.
|
|
|
|
@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
|
2008-02-22 17:31:23 +01:00
|
|
|
|
2006-05-09 08:11:05 +02:00
|
|
|
:check_cygwin
|
2014-02-24 15:14:13 +01:00
|
|
|
if defined CYGWIN_HOME (
|
|
|
|
if not exist "%CYGWIN_HOME%" (
|
|
|
|
@echo.
|
|
|
|
@echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!
|
|
|
|
@echo.
|
|
|
|
)
|
|
|
|
) else (
|
2014-02-24 15:09:00 +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
|
|
|
)
|
2014-02-24 15:14:13 +01:00
|
|
|
)
|
2006-04-22 00:54:32 +02:00
|
|
|
|
2014-02-24 15:14:13 +01:00
|
|
|
:cygwin_done
|
|
|
|
if "%1"=="" 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
|
2014-02-24 15:14:13 +01:00
|
|
|
@echo will only be copied to target.txt, tools_def.txt and build_rule.txt
|
|
|
|
@echo respectively if they do not exist. Use option [Reconfig] to force the copy.
|
2008-12-31 17:57:24 +01:00
|
|
|
@echo.
|
2014-02-24 15:09:00 +01:00
|
|
|
goto end
|
2007-06-22 08:25:37 +02:00
|
|
|
|
2006-04-22 00:54:32 +02:00
|
|
|
:end
|
2014-02-24 15:09:00 +01:00
|
|
|
popd
|
2006-04-22 00:54:32 +02:00
|
|
|
|