]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/toolsetup.bat
Update IntelFspWrapperPkg according to FSP1.1.
[mirror_edk2.git] / BaseTools / toolsetup.bat
index 2f657ba9677015d3be7959d8332f0303a0a1ee2a..2afa8103ec7c6f64bb791482ed45487f55f1cfbc 100755 (executable)
@@ -3,10 +3,10 @@
 @REM   however it may be executed directly from the BaseTools project folder\r
 @REM   if the file is not executed within a WORKSPACE\BaseTools folder.\r
 @REM\r
 @REM   however it may be executed directly from the BaseTools project folder\r
 @REM   if the file is not executed within a WORKSPACE\BaseTools folder.\r
 @REM\r
-@REM Copyright (c) 2006 - 2008, Intel Corporation.  All rights reserved.\r
+@REM Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 @REM\r
 @REM This program and the accompanying materials are licensed and made available\r
 @REM\r
 @REM This program and the accompanying materials are licensed and made available\r
-@REM under the terms and conditions of the BSD Licensewhich accompanies this \r
+@REM under the terms and conditions of the BSD License which accompanies this \r
 @REM distribution.  The full text of the license may be found at:\r
 @REM   http://opensource.org/licenses/bsd-license.php\r
 @REM\r
 @REM distribution.  The full text of the license may be found at:\r
 @REM   http://opensource.org/licenses/bsd-license.php\r
 @REM\r
@@ -22,32 +22,32 @@ pushd .
 @REM # You should not have to modify anything below this line\r
 @REM #\r
 \r
 @REM # You should not have to modify anything below this line\r
 @REM #\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"=="/help" goto Usage\r
-@if /I "%1"=="/?" goto Usage\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"=="/help" goto Usage\r
+if /I "%1"=="/?" goto Usage\r
 \r
 \r
 :loop\r
 \r
 \r
 :loop\r
-  @if "%1"=="" goto setup_workspace\r
-  @if /I "%1"=="--nt32" (\r
+  if "%1"=="" goto setup_workspace\r
+  if /I "%1"=="--nt32" (\r
     @REM Ignore --nt32 flag\r
     shift\r
     goto loop\r
   )\r
     @REM Ignore --nt32 flag\r
     shift\r
     goto loop\r
   )\r
-  @if /I "%1"=="Reconfig" (\r
+  if /I "%1"=="Reconfig" (\r
     shift\r
     set RECONFIG=TRUE\r
     goto loop\r
   )\r
     shift\r
     set RECONFIG=TRUE\r
     goto loop\r
   )\r
-  @if /I "%1"=="Rebuild" (\r
+  if /I "%1"=="Rebuild" (\r
     shift\r
     set REBUILD=TRUE\r
     goto loop\r
   )\r
     shift\r
     set REBUILD=TRUE\r
     goto loop\r
   )\r
-  @if /I "%1"=="ForceRebuild" (\r
+  if /I "%1"=="ForceRebuild" (\r
     shift\r
     set FORCE_REBUILD=TRUE\r
     goto loop\r
     shift\r
     set FORCE_REBUILD=TRUE\r
     goto loop\r
@@ -131,7 +131,7 @@ pushd .
   )\r
   echo EDK_TOOLS_PATH      = %EDK_TOOLS_PATH%\r
   if defined BASE_TOOLS_PATH (\r
   )\r
   echo EDK_TOOLS_PATH      = %EDK_TOOLS_PATH%\r
   if defined BASE_TOOLS_PATH (\r
-    echo BASE_TOOLS_PATH     = %EDK_TOOLS_PATH%\r
+    echo BASE_TOOLS_PATH     = %BASE_TOOLS_PATH%\r
   )\r
   echo.\r
 \r
   )\r
   echo.\r
 \r
@@ -158,31 +158,36 @@ if NOT exist %WORKSPACE%\Conf (
   )\r
 )\r
 \r
   )\r
 )\r
 \r
-if NOT exist %WORKSPACE%\Conf\FrameworkDatabase.db (\r
-  echo copying ... FrameworkDatabase.template to %WORKSPACE%\Conf\FrameworkDatabase.db\r
-  copy %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul\r
-) else (\r
-  if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul\r
-)\r
-\r
 if NOT exist %WORKSPACE%\Conf\target.txt (\r
   echo copying ... target.template to %WORKSPACE%\Conf\target.txt\r
 if NOT exist %WORKSPACE%\Conf\target.txt (\r
   echo copying ... target.template to %WORKSPACE%\Conf\target.txt\r
+  if NOT exist %EDK_TOOLS_PATH%\Conf\target.template (\r
+    echo Error: target.template is missing at folder %EDK_TOOLS_PATH%\Conf\\r
+  )\r
   copy %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
 ) else (\r
   copy %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
 ) else (\r
+  if defined RECONFIG echo over-write ... target.template to %WORKSPACE%\Conf\target.txt\r
   if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
 )\r
 \r
 if NOT exist %WORKSPACE%\Conf\tools_def.txt (\r
   echo copying ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt\r
   if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
 )\r
 \r
 if NOT exist %WORKSPACE%\Conf\tools_def.txt (\r
   echo copying ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt\r
+  if NOT exist %EDK_TOOLS_PATH%\Conf\tools_def.template (\r
+    echo Error: tools_def.template is missing at folder %EDK_TOOLS_PATH%\Conf\\r
+  )\r
   copy %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
 ) else (\r
   copy %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
 ) else (\r
+  if defined RECONFIG echo over-write ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt\r
   if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
 )\r
 \r
 if NOT exist %WORKSPACE%\Conf\build_rule.txt (\r
   echo copying ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt\r
   if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
 )\r
 \r
 if NOT exist %WORKSPACE%\Conf\build_rule.txt (\r
   echo copying ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt\r
+  if NOT exist %EDK_TOOLS_PATH%\Conf\build_rule.template (\r
+    echo Error: build_rule.template is missing at folder %EDK_TOOLS_PATH%\Conf\\r
+  )\r
   copy %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
 ) else (\r
   copy %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
 ) else (\r
+  if defined RECONFIG echo over-write ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt\r
   if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
 )\r
 \r
   if defined RECONFIG copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
 )\r
 \r
@@ -226,7 +231,7 @@ goto end
     echo tested versions of the tools have been tested and included in the\r
     echo EDK II repository.\r
     echo.\r
     echo tested versions of the tools have been tested and included in the\r
     echo EDK II repository.\r
     echo.\r
-    echo If you really want to build the tools, use the FORCE_REBUILD option.\r
+    echo If you really want to build the tools, use the ForceRebuild option.\r
     echo.\r
     goto end\r
   )\r
     echo.\r
     goto end\r
   )\r
@@ -241,14 +246,15 @@ goto end
   )\r
   set PATH=%BASE_TOOLS_PATH%\Bin\Win32;%PATH%\r
 \r
   )\r
   set PATH=%BASE_TOOLS_PATH%\Bin\Win32;%PATH%\r
 \r
-  set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python\r
+  set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python\r
+  set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%\r
 \r
   if not defined PYTHON_HOME (\r
     if defined PYTHONHOME (\r
       set PYTHON_HOME=%PYTHONHOME%\r
     ) else (\r
       echo.\r
 \r
   if not defined PYTHON_HOME (\r
     if defined PYTHONHOME (\r
       set PYTHON_HOME=%PYTHONHOME%\r
     ) else (\r
       echo.\r
-      echo  !!! ERROR !!! PYTHON is required to build or execute the tools !!!\r
+      echo  !!! ERROR !!! PYTHON_HOME is required to build or execute the tools, please set it. !!!\r
       echo.\r
       goto end\r
     )\r
       echo.\r
       goto end\r
     )\r
@@ -274,8 +280,9 @@ goto end
       echo !!! WARNING !!! Will not be able to compile Python programs to .exe\r
       echo Will setup environment to run Python scripts directly.\r
       echo.\r
       echo !!! WARNING !!! Will not be able to compile Python programs to .exe\r
       echo Will setup environment to run Python scripts directly.\r
       echo.\r
-      set PYTHONPATH=%BASE_TOOLS_PATH%\Source\Python\r
-      set PATH=%PYTHONPATH%\build;%PYTHONPATH%\GenFds;%PYTHONPATH%\Trim;%PATH%\r
+      set PATH=%BASETOOLS_PYTHON_SOURCE%\Trim;%PATH%\r
+      set PATH=%BASETOOLS_PYTHON_SOURCE%\GenFds;%PATH%\r
+      set PATH=%BASETOOLS_PYTHON_SOURCE%\build;%PATH%\r
       set PATHEXT=%PATHEXT%;.py\r
     )\r
   )\r
       set PATHEXT=%PATHEXT%;.py\r
     )\r
   )\r
@@ -285,23 +292,16 @@ goto end
   echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%\r
   echo.\r
 \r
   echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%\r
   echo.\r
 \r
-  if defined VCINSTALLDIR goto VisualStudioAvailable\r
-  if defined VS71COMNTOOLS (\r
-    call "%VS71COMNTOOLS%\vsvars32.bat"\r
-  ) else (\r
-    if defined VS80COMNTOOLS (\r
-      call "%VS80COMNTOOLS%\vsvars32.bat"\r
-    ) else (\r
-      echo.\r
-      echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!!\r
-      echo.\r
-      goto end\r
-    )\r
+  call "%EDK_TOOLS_PATH%\get_vsvars.bat"\r
+  if not defined VCINSTALLDIR (\r
+    @echo.\r
+    @echo !!! ERROR !!!! Cannot find Visual Studio, required to build C tools !!!\r
+    @echo.\r
+    goto end\r
   )\r
 \r
 :VisualStudioAvailable\r
   )\r
 \r
 :VisualStudioAvailable\r
-  if defined FORCE_REBUILD goto CleanAndBuild\r
-  goto IncrementalBuild\r
+  if not defined FORCE_REBUILD goto IncrementalBuild\r
 \r
 :CleanAndBuild\r
   pushd .\r
 \r
 :CleanAndBuild\r
   pushd .\r
@@ -339,17 +339,17 @@ goto end
   goto end\r
 \r
 :Usage\r
   goto end\r
 \r
 :Usage\r
-  echo.\r
+  @echo.\r
   echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]"\r
   echo  Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]]"\r
-  echo.\r
-  echo         base_tools_path   BaseTools project path, BASE_TOOLS_PATH will be set to this path. \r
-  echo         edk_tools_path    EDK_TOOLS_PATH will be set to this path.\r
-  echo         Rebuild           If sources are available perform an Incremental build, only \r
-  echo                           build those updated tools.\r
-  echo         ForceRebuild      If sources are available, rebuild all tools regardless of \r
-  echo                           whether they have been updated or not.\r
-  echo         Reconfig          Reinstall target.txt, tools_def.txt and build_rule.txt.\r
-echo.\r
+  @echo.\r
+  @echo         base_tools_path   BaseTools project path, BASE_TOOLS_PATH will be set to this path. \r
+  @echo         edk_tools_path    EDK_TOOLS_PATH will be set to this path.\r
+  @echo         Rebuild           If sources are available perform an Incremental build, only \r
+  @echo                           build those updated tools.\r
+  @echo         ForceRebuild      If sources are available, rebuild all tools regardless of \r
+  @echo                           whether they have been updated or not.\r
+  @echo         Reconfig          Reinstall target.txt, tools_def.txt and build_rule.txt.\r
+  @echo.\r
 \r
 :end\r
 set REBUILD=\r
 \r
 :end\r
 set REBUILD=\r
@@ -357,5 +357,3 @@ set FORCE_REBUILD=
 set RECONFIG=\r
 popd\r
 \r
 set RECONFIG=\r
 popd\r
 \r
-@echo on\r
-\r