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