--- /dev/null
+@REM\r
+@REM Copyright (c) 2006, Intel Corporation\r
+@REM All rights reserved. This program and the accompanying materials\r
+@REM are licensed and made available under the terms and conditions of the BSD License\r
+@REM which accompanies this distribution. The full text of the license may be found at\r
+@REM http://opensource.org/licenses/bsd-license.php\r
+@REM\r
+@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+@REM\r
+\r
+@REM usage: edksetup.bat [Reconfig]\r
+@REM if the argument, skip is present, only the paths and the\r
+@REM test and set of environment settings are performed. \r
+\r
+@REM ##############################################################\r
+@REM # You should not have to modify anything below this line\r
+@REM #\r
+\r
+@echo off\r
+\r
+@REM\r
+@REM Set the WORKSPACE to the current working directory\r
+@REM\r
+if not defined WORKSPACE (\r
+ @set WORKSPACE=%CD%\r
+) else (\r
+ @echo WORKSPACE was already set to %WORKSPACE%\r
+)\r
+\r
+\r
+@if /I "%1"=="-h" goto Usage\r
+@if /I "%1"=="-help" goto Usage\r
+@if /I "%1"=="--help" goto Usage\r
+@if /I "%1"=="/h" goto Usage\r
+@if /I "%1"=="/?" goto Usage\r
+@if /I "%1"=="/help" goto Usage\r
+\r
+if defined CYGWIN_HOME goto NewBuild\r
+if exist c:\cygwin (\r
+ set CYGWIN_HOME=c:\cygwin\r
+) else (\r
+ echo.\r
+ echo !!! WARNING !!!! Not set CYGWIN_HOME, gcc build may not be used !!!\r
+ echo.\r
+)\r
+\r
+goto NewBuild\r
+\r
+:Usage\r
+echo.\r
+echo Usage: %0 [Reconfig]\r
+echo Reconfig: Reinstall target.txt, tools_def.txt, FrameworkDatabase.db. \r
+echo.\r
+echo Note that target.template, tools_def.template, FrameworkDatabase.template will be\r
+echo only copied to target.txt, tools_def.txt, FrameworkDatabase.db respectively if they\r
+echo are not existed. Using option [Reconfig] to do the force copy. \r
+echo.\r
+goto end\r
+\r
+:NewBuild\r
+@IF DEFINED EDK_TOOLS_PATH goto RunToolSetup\r
+\r
+@if exist %WORKSPACE%\BaseTools (\r
+ @set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
+) else (\r
+ echo.\r
+ echo The WORKSPACE does not contain a BaseTools directory and\r
+ echo the EDK_TOOLS_PATH is not set\r
+ echo.\r
+ goto Usage\r
+)\r
+\r
+:RunToolSetup\r
+@if /I "%1"=="Reconfig" (\r
+ @call %EDK_TOOLS_PATH%\toolsetup.bat Reconfig\r
+) else (\r
+ @call %EDK_TOOLS_PATH%\toolsetup.bat\r
+)\r
+\r
+:end\r
+@echo on\r
+\r