]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/toolsetup.bat
Correct parameter UINTN to UINT32. Fix UINTN conver to UINT32
[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
e8f5c5c0 25if /I "%1"=="Reconfig" (\r
26 if NOT "%2"=="" set EDK_TOOLS_PATH=%2\r
27) else (\r
28 if NOT "%1"=="" set EDK_TOOLS_PATH=%1\r
29)\r
589d5eaa 30\r
31REM\r
32REM Check the required system environment variables\r
33REM\r
34\r
35:check_vc\r
36if defined VCINSTALLDIR goto setup_workspace\r
37if defined VS71COMNTOOLS (\r
38 call "%VS71COMNTOOLS%\vsvars32.bat"\r
39) else (\r
40 echo.\r
41 echo !!!WARNING!!! Cannot find Visual Studio !!!\r
42 echo.\r
43)\r
44\r
45:setup_workspace\r
46REM\r
47REM check the EDK_TOOLS_PATH\r
48REM\r
49if not defined EDK_TOOLS_PATH goto no_tools_path\r
50if exist %EDK_TOOLS_PATH% goto set_path\r
51echo.\r
e8f5c5c0 52echo !!!WARNING!!! %EDK_TOOLS_PATH% doesn't exist. %WORKSPACE%\BaseTools will be used !!!\r
589d5eaa 53echo.\r
54\r
55:no_tools_path\r
56if exist %WORKSPACE%\BaseTools (\r
57 set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
58) else (\r
59 echo.\r
60 echo !!!WARNING!!! No tools path found. Please set EDK_TOOLS_PATH !!!\r
61 echo.\r
62 goto end\r
63)\r
64\r
65:set_path\r
66if defined WORKSPACE_TOOLS_PATH goto check_path\r
67set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%\r
68set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
69goto path_ok\r
70\r
71:check_path\r
72if "%EDK_TOOLS_PATH%"=="%WORKSPACE_TOOLS_PATH%" goto path_ok\r
73set PATH=%EDK_TOOLS_PATH%\Bin;%EDK_TOOLS_PATH%\Bin\Win32;%PATH%\r
74set WORKSPACE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
75echo Resetting the PATH variable to include the EDK_TOOLS_PATH for this WORKSPACE\r
76\r
77:path_ok\r
78echo PATH = %PATH%\r
79echo.\r
80echo WORKSPACE = %WORKSPACE%\r
81echo EDK_TOOLS_PATH = %EDK_TOOLS_PATH%\r
82echo.\r
83\r
84REM\r
8fc4fc3a 85REM copy *.template to %WORKSPACE%\Conf\r
589d5eaa 86REM\r
e8f5c5c0 87if NOT exist %WORKSPACE%\Conf (\r
88 mkdir %WORKSPACE%\Conf\r
89) else (\r
90 if /I "%1"=="Reconfig" (\r
91 echo.\r
92 echo Over-writing the files in the WORKSPACE\Conf directory\r
93 echo using the default template files\r
94 echo.\r
95 )\r
96)\r
8fc4fc3a 97if NOT exist %WORKSPACE%\Conf\FrameworkDatabase.db (\r
98 echo copying ... FrameworkDatabase.template to %WORKSPACE%\Conf\FrameworkDatabase.db\r
99 copy %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul\r
e8f5c5c0 100) else (\r
101 if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\FrameworkDatabase.template %WORKSPACE%\Conf\FrameworkDatabase.db > nul\r
589d5eaa 102)\r
8fc4fc3a 103if NOT exist %WORKSPACE%\Conf\target.txt (\r
104 echo copying ... target.template to %WORKSPACE%\Conf\target.txt\r
105 copy %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
e8f5c5c0 106) else (\r
107 if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\target.template %WORKSPACE%\Conf\target.txt > nul\r
589d5eaa 108)\r
8fc4fc3a 109if NOT exist %WORKSPACE%\Conf\tools_def.txt (\r
110 echo copying ... tools_def.template to %WORKSPACE%\Conf\tools_def.txt\r
111 copy %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
e8f5c5c0 112) else (\r
113 if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt > nul\r
589d5eaa 114)\r
8fc4fc3a 115if NOT exist %WORKSPACE%\Conf\build_rule.txt (\r
116 echo copying ... build_rule.template to %WORKSPACE%\Conf\build_rule.txt\r
117 copy %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
e8f5c5c0 118) else (\r
119 if /I "%1"=="Reconfig" copy /Y %EDK_TOOLS_PATH%\Conf\build_rule.template %WORKSPACE%\Conf\build_rule.txt > nul\r
589d5eaa 120)\r
121\r
122REM\r
123REM copy XMLSchema to %EDK_TOOLS_PATH%\Conf\XMLSchema\r
124REM\r
125REM echo copying ... XMLSchema to %EDK_TOOLS_PATH%\Conf\XMLSchema\r
126REM xcopy %WORKSPACE%\Conf\XMLSchema %EDK_TOOLS_PATH%\Conf\XMLSchema /S /I /D /F /Q > nul\r
127\r
128REM\r
129REM Done!!!\r
130REM\r
131goto end\r
132\r
133:usage\r
134echo.\r
e8f5c5c0 135echo "Usage: %0 [/? | /h | /help | -h | -help | --help] [Reconfig] [tools_path]"\r
589d5eaa 136echo.\r
137echo tools_path Tools' path. EDK_TOOLS_PATH will be set to this path.\r
138echo.\r
139\r
140:end\r
141@echo on\r
142\r