]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/toolsetup.bat
BaseTool: Fixed the incorrect cache key.
[mirror_edk2.git] / BaseTools / toolsetup.bat
index 3801ce033ff619d50df66cb2bf296f6c26359151..33d50f58ad87df6909ae7dbcc691cd5503e3789e 100755 (executable)
@@ -1,18 +1,18 @@
 @REM @file\r
-@REM   This stand-alone program is typically called by the edksetup.bat file, \r
+@REM   This stand-alone program is typically called by the edksetup.bat file,\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 - 2017, Intel Corporation. All rights reserved.<BR>\r
+@REM Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 @REM (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\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 License which 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 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 \r
+@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR\r
 @REM IMPLIED.\r
 @REM\r
 \r
@@ -118,16 +118,13 @@ if /I "%1"=="/?" goto Usage
 :set_PATH\r
   if defined WORKSPACE_TOOLS_PATH goto check_PATH\r
   if not defined EDK_TOOLS_BIN (\r
-    if exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
-      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
-    ) else (\r
-      set "PATH=%EDK_TOOLS_PATH%\Bin\Win32;%PATH%"\r
+    set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
+    if not exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
       echo.\r
       echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!\r
       echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32\r
       echo Or configure EDK_TOOLS_BIN env to point Win32 directory.\r
-      echo. \r
-      goto check_build_environment\r
+      echo.\r
     )\r
   )\r
   set PATH=%EDK_TOOLS_BIN%;%PATH%\r
@@ -137,16 +134,13 @@ if /I "%1"=="/?" goto Usage
 :check_PATH\r
   if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto PATH_ok\r
   if not defined EDK_TOOLS_BIN (\r
-    if exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
-      set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
-    ) else (\r
-      set "PATH=%EDK_TOOLS_PATH%\Bin\Win32;%PATH%"\r
+    set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
+    if not exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
       echo.\r
       echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!\r
       echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32\r
       echo Or configure EDK_TOOLS_BIN env to point Win32 directory.\r
-      echo. \r
-      goto check_build_environment\r
+      echo.\r
     )\r
   )\r
   set PATH=%EDK_TOOLS_BIN%;%PATH%\r
@@ -188,7 +182,7 @@ if NOT exist %CONF_PATH% (
     )\r
   )\r
 )\r
\r
+\r
 :CopyConf\r
 if NOT exist %CONF_PATH% (\r
   mkdir %CONF_PATH%\r
@@ -260,6 +254,7 @@ echo.
 if defined FORCE_REBUILD goto check_build_environment\r
 if defined REBUILD goto check_build_environment\r
 if not exist "%EDK_TOOLS_PATH%" goto check_build_environment\r
+if not exist "%EDK_TOOLS_BIN%"  goto check_build_environment\r
 \r
 IF NOT EXIST "%EDK_TOOLS_BIN%\BootSectImage.exe" goto check_c_tools\r
 IF NOT EXIST "%EDK_TOOLS_BIN%\EfiLdrImage.exe" goto check_c_tools\r
@@ -309,7 +304,7 @@ goto end
       set PYTHON_HOME=%PYTHONHOME%\r
     ) else (\r
       echo.\r
-      echo !!! ERROR !!! Binary python tools are missing. PYTHON_HOME environment variable is not set. \r
+      echo !!! ERROR !!! Binary python tools are missing. PYTHON_HOME environment variable is not set.\r
       echo PYTHON_HOME is required to build or execute the python tools.\r
       echo.\r
       goto end\r
@@ -322,12 +317,12 @@ goto end
     echo !!! WARNING !!! PYTHON_FREEZER_PATH environment variable is not set.\r
     echo Setup environment to run Python scripts directly.\r
     echo.\r
-    set "PATH=%PATH%;%BASE_TOOLS_PATH%\BinWrappers\WindowsLike"\r
+    set "PATH=%BASE_TOOLS_PATH%\BinWrappers\WindowsLike;%PATH%"\r
   )\r
 \r
   set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python\r
   set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%\r
-  \r
+\r
   echo                PATH = %PATH%\r
   echo         PYTHON_HOME = %PYTHON_HOME%\r
   echo          PYTHONPATH = %PYTHONPATH%\r
@@ -390,11 +385,11 @@ goto end
   @echo.\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         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         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         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