]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/toolsetup.bat
FatBinPkg: Update EBC/IA32/X64/IPF binaries
[mirror_edk2.git] / BaseTools / toolsetup.bat
index 98d0247aa1f356623e7d2dffaaeef56cadf26555..2afa8103ec7c6f64bb791482ed45487f55f1cfbc 100755 (executable)
@@ -22,32 +22,32 @@ pushd .
 @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
-  @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
-  @if /I "%1"=="Reconfig" (\r
+  if /I "%1"=="Reconfig" (\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
-  @if /I "%1"=="ForceRebuild" (\r
+  if /I "%1"=="ForceRebuild" (\r
     shift\r
     set FORCE_REBUILD=TRUE\r
     goto loop\r
@@ -246,7 +246,8 @@ goto end
   )\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
@@ -279,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
-      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
@@ -290,31 +292,16 @@ goto end
   echo PYTHON_FREEZER_PATH = %PYTHON_FREEZER_PATH%\r
   echo.\r
 \r
-  if defined VCINSTALLDIR goto VisualStudioAvailable\r
-  if defined VS100COMNTOOLS (\r
-    call "%VS100COMNTOOLS%\vsvars32.bat"\r
-  ) else (\r
-    if defined VS90COMNTOOLS (\r
-      call "%VS90COMNTOOLS%\vsvars32.bat"\r
-    ) else (\r
-      if defined VS80COMNTOOLS (\r
-        call "%VS80COMNTOOLS%\vsvars32.bat"\r
-      ) else (\r
-        if defined VS71COMNTOOLS (\r
-          call "%VS71COMNTOOLS%\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
-      )\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
-  if defined FORCE_REBUILD goto CleanAndBuild\r
-  goto IncrementalBuild\r
+  if not defined FORCE_REBUILD goto IncrementalBuild\r
 \r
 :CleanAndBuild\r
   pushd .\r
@@ -352,17 +339,17 @@ goto end
   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.\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
@@ -370,5 +357,3 @@ set FORCE_REBUILD=
 set RECONFIG=\r
 popd\r
 \r
-@echo on\r
-\r