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