Rename Frame*Lib to *LibFramework to improve the speed that a module could be found...
[mirror_edk2.git] / BaseTools / toolsetup.bat
CommitLineData
589d5eaa 1@REM\r
2@REM Copyright (c) 2006, Intel Corporation\r
3@REM All rights reserved. This program and the accompanying materials\r
4@REM are licensed and made available under the terms and conditions of the BSD License\r
5@REM which accompanies this distribution. The full text of the license may be found at\r
6@REM http://opensource.org/licenses/bsd-license.php\r
7@REM\r
8@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
9@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
10@REM\r
11\r
12@echo off\r
13\r
14REM ##############################################################\r
15REM # You should not have to modify anything below this line\r
16REM #\r
17\r
18if /I "%1"=="-h" goto usage\r
19if /I "%1"=="-help" goto usage\r
20if /I "%1"=="--help" goto usage\r
21if /I "%1"=="/h" goto usage\r
22if /I "%1"=="/?" goto usage\r
23if /I "%1"=="/help" goto usage\r
24\r
25if NOT "%1"=="" set EDK_TOOLS_PATH=%1\r
26\r
27REM\r
28REM Check the required system environment variables\r
29REM\r
30\r
31:check_vc\r
32if defined VCINSTALLDIR goto setup_workspace\r
33if defined VS71COMNTOOLS (\r
34 call "%VS71COMNTOOLS%\vsvars32.bat"\r
35) else (\r
36 echo.\r
37 echo !!!WARNING!!! Cannot find Visual Studio !!!\r
38 echo.\r
39)\r
40\r
41:setup_workspace\r
42REM\r
43REM check the EDK_TOOLS_PATH\r
44REM\r
45if not defined EDK_TOOLS_PATH goto no_tools_path\r
46if exist %EDK_TOOLS_PATH% goto set_path\r
47echo.\r
48echo !!!WARNING!!! %EDK_TOOLS_PATH% doesn't exist. %WORKSPACE%\Tools will be used !!!\r
49echo.\r
50\r
51:no_tools_path\r
52if exist %WORKSPACE%\BaseTools (\r
53 set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
54) else (\r
55 echo.\r
56 echo !!!WARNING!!! No tools path found. Please set EDK_TOOLS_PATH !!!\r
57 echo.\r
58 goto end\r
59)\r
60\r
61:set_path\r
62if defined WORKSPACE_TOOLS_PATH goto check_path\r
63set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%\r
64set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
65goto path_ok\r
66\r
67:check_path\r
68if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok\r
69set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%\r
70set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
71echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this WORKSPACE\r
72\r
73:path_ok\r
74echo PATH = %PATH%\r
75echo.\r
76echo WORKSPACE = %WORKSPACE%\r
77echo EDK_TOOLS_PATH = %EDK_TOOLS_PATH%\r
78echo.\r
79\r
80REM\r
8fc4fc3a 81REM copy *.template to %WORKSPACE%\Conf\r
589d5eaa 82REM\r
8fc4fc3a 83if NOT exist %WORKSPACE%\Conf mkdir %WORKSPACE%\Conf\r
84if NOT exist %WORKSPACE%\Conf\FrameworkDatabase.db (\r
85 echo copying ... FrameworkDatabase.template to %WORKSPACE%\Conf\FrameworkDatabase.db\r
86 copy %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul\r
589d5eaa 87)\r
8fc4fc3a 88if NOT exist %WORKSPACE%\Conf\target.txt (\r
89 echo copying ... target.template to %WORKSPACE%\Conf\target.txt\r
90 copy %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
589d5eaa 91)\r
8fc4fc3a 92if NOT exist %WORKSPACE%\Conf\tools_def.txt (\r
93 echo copying ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt\r
94 copy %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
589d5eaa 95)\r
8fc4fc3a 96if NOT exist %WORKSPACE%\Conf\build_rule.txt (\r
97 echo copying ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt\r
98 copy %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
589d5eaa 99)\r
100\r
101REM\r
102REM copy XMLSchema to %EDK_TOOLS_PATH%\Conf\XMLSchema\r
103REM\r
104REM echo copying ... XMLSchema to %EDK_TOOLS_PATH%\Conf\XMLSchema\r
105REM xcopy %WORKSPACE%\Conf\XMLSchema %EDK_TOOLS_PATH%\Conf\XMLSchema /S /I /D /F /Q > nul\r
106\r
107REM\r
108REM Done!!!\r
109REM\r
110goto end\r
111\r
112:usage\r
113echo.\r
114echo "Usage: %0 [/? | /h | /help | -h | -help | --help] [tools_path]"\r
115echo.\r
116echo tools_path Tools' path. EDK_TOOLS_PATH will be set to this path.\r
117echo.\r
118\r
119:end\r
120@echo on\r
121\r