]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/toolsetup.bat
Changed customized build to USER_DEFINED
[mirror_edk2.git] / BaseTools / toolsetup.bat
index 3f474a04f3a10fc5c2337b1895db9c8da16e154a..edf1efd08a3f1b6159c7af5d866196872f38cf4f 100644 (file)
@@ -22,7 +22,11 @@ if /I "%1"=="/h" goto usage
 if /I "%1"=="/?" goto usage\r
 if /I "%1"=="/help" goto usage\r
 \r
-if NOT "%1"=="" set EDK_TOOLS_PATH=%1\r
+if /I "%1"=="Reconfig" (\r
+  if NOT "%2"=="" set EDK_TOOLS_PATH=%2\r
+) else (\r
+  if NOT "%1"=="" set EDK_TOOLS_PATH=%1\r
+)\r
 \r
 REM\r
 REM Check the required system environment variables\r
@@ -45,7 +49,7 @@ REM
 if not defined EDK_TOOLS_PATH goto no_tools_path\r
 if exist %EDK_TOOLS_PATH% goto set_path\r
 echo.\r
-echo !!!WARNING!!! %EDK_TOOLS_PATH% doesn't exist. %WORKSPACE%\Tools will be used !!!\r
+echo !!!WARNING!!! %EDK_TOOLS_PATH% doesn't exist. %WORKSPACE%\BaseTools will be used !!!\r
 echo.\r
 \r
 :no_tools_path\r
@@ -78,24 +82,41 @@ echo EDK_TOOLS_PATH = %EDK_TOOLS_PATH%
 echo.\r
 \r
 REM\r
-REM copy *.template to %EDK_TOOLS_PATH%\Conf\r
+REM copy *.template to %WORKSPACE%\Conf\r
 REM\r
-if NOT exist %EDK_TOOLS_PATH%\Conf mkdir %EDK_TOOLS_PATH%\Conf\r
-if NOT exist %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.db (\r
-  echo copying ... FrameworkDatabase.template to %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.db\r
-  copy %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.db > nul\r
+if NOT exist %WORKSPACE%\Conf (\r
+  mkdir %WORKSPACE%\Conf\r
+) else (\r
+  if /I "%1"=="Reconfig" (\r
+    echo.\r
+    echo  Over-writing the files in the WORKSPACE\Conf directory\r
+    echo  using the default template files\r
+    echo.\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 /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul\r
 )\r
-if NOT exist %EDK_TOOLS_PATH%\Conf\target.txt (\r
-  echo copying ... target.template to %EDK_TOOLS_PATH%\Conf\target.txt\r
-  copy %EDK_TOOLS_PATH%\Conf\target.template %EDK_TOOLS_PATH%\Conf\target.txt > nul\r
+if NOT exist %WORKSPACE%\Conf\target.txt (\r
+  echo copying ... target.template to %WORKSPACE%\Conf\target.txt\r
+  copy %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
+) else (\r
+  if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
 )\r
-if NOT exist %EDK_TOOLS_PATH%\Conf\tools_def.txt (\r
-  echo copying ... tools_def.template to %EDK_TOOLS_PATH%\Conf\tools_def.txt\r
-  copy %EDK_TOOLS_PATH%\Conf\tools_def.template %EDK_TOOLS_PATH%\Conf\tools_def.txt > nul\r
+if NOT exist %WORKSPACE%\Conf\tools_def.txt (\r
+  echo copying ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt\r
+  copy %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
+) else (\r
+  if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
 )\r
-if NOT exist %EDK_TOOLS_PATH%\Conf\build_rule.txt (\r
-  echo copying ... build_rule.template to %EDK_TOOLS_PATH%\Conf\build_rule.txt\r
-  copy %EDK_TOOLS_PATH%\Conf\build_rule.template %EDK_TOOLS_PATH%\Conf\build_rule.txt > nul\r
+if NOT exist %WORKSPACE%\Conf\build_rule.txt (\r
+  echo copying ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt\r
+  copy %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
+) else (\r
+  if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
 )\r
 \r
 REM\r
@@ -111,7 +132,7 @@ goto end
 \r
 :usage\r
 echo.\r
-echo  "Usage: %0 [/? | /h | /help | -h | -help | --help] [tools_path]"\r
+echo  "Usage: %0 [/? | /h | /help | -h | -help | --help] [Reconfig] [tools_path]"\r
 echo.\r
 echo                      tools_path       Tools' path. EDK_TOOLS_PATH will be set to this path.\r
 echo.\r