]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - edksetup.bat
MdeModulePkg/Ps2Keyboard: Add missing PCD and protocol to DEC file
[mirror_edk2.git] / edksetup.bat
... / ...
CommitLineData
1@REM @file\r
2@REM Windows batch file to setup a WORKSPACE environment\r
3@REM\r
4@REM Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
5@REM This program and the accompanying materials\r
6@REM are licensed and made available under the terms and conditions of the BSD License\r
7@REM which accompanies this distribution. The full text of the license may be found at\r
8@REM http://opensource.org/licenses/bsd-license.php\r
9@REM\r
10@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12@REM\r
13\r
14@REM set CYGWIN_HOME=C:\cygwin\r
15\r
16@REM usage: \r
17@REM edksetup.bat [--nt32] [AntBuild] [Rebuild] [ForceRebuild] [Reconfig]\r
18@REM if the argument, skip is present, only the paths and the\r
19@REM test and set of environment settings are performed. \r
20\r
21@REM ##############################################################\r
22@REM # You should not have to modify anything below this line\r
23@REM #\r
24\r
25@echo off\r
26\r
27@REM\r
28@REM Set the WORKSPACE to the current working directory\r
29@REM\r
30pushd .\r
31cd %~dp0\r
32\r
33if not defined WORKSPACE (\r
34 goto SetWorkSpace\r
35)\r
36\r
37if %WORKSPACE% == %CD% (\r
38 @REM Workspace is not changed.\r
39 goto ParseArgs\r
40)\r
41\r
42:SetWorkSpace\r
43@REM set new workspace\r
44@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace\r
45if not defined WORKSPACE (\r
46 set WORKSPACE=%CD%\r
47 set EFI_SOURCE=\r
48 set EDK_SOURCE=\r
49)\r
50\r
51:ParseArgs\r
52if /I "%1"=="-h" goto Usage\r
53if /I "%1"=="-help" goto Usage\r
54if /I "%1"=="--help" goto Usage\r
55if /I "%1"=="/h" goto Usage\r
56if /I "%1"=="/?" goto Usage\r
57if /I "%1"=="/help" goto Usage\r
58\r
59if /I not "%1"=="--nt32" goto no_nt32\r
60\r
61@REM Flag, --nt32 is set\r
62@REM The Nt32 Emluation Platform requires Microsoft Libraries\r
63@REM and headers to interface with Windows.\r
64\r
65if not defined VCINSTALLDIR (\r
66 if defined VS140COMNTOOLS (\r
67 call "%VS140COMNTOOLS%\vsvars32.bat"\r
68 ) else (\r
69 if defined VS120COMNTOOLS (\r
70 call "%VS120COMNTOOLS%\vsvars32.bat"\r
71 ) else ( \r
72 if defined VS110COMNTOOLS (\r
73 call "%VS110COMNTOOLS%\vsvars32.bat"\r
74 ) else (\r
75 if defined VS100COMNTOOLS (\r
76 call "%VS100COMNTOOLS%\vsvars32.bat"\r
77 ) else (\r
78 if defined VS90COMNTOOLS (\r
79 call "%VS90COMNTOOLS%\vsvars32.bat"\r
80 ) else (\r
81 if defined VS80COMNTOOLS (\r
82 call "%VS80COMNTOOLS%\vsvars32.bat"\r
83 ) else (\r
84 if defined VS71COMNTOOLS (\r
85 call "%VS71COMNTOOLS%\vsvars32.bat"\r
86 ) else (\r
87 echo.\r
88 echo !!! WARNING !!! Cannot find Visual Studio !!!\r
89 echo.\r
90 )\r
91 )\r
92 )\r
93 )\r
94 )\r
95 )\r
96 )\r
97)\r
98shift\r
99\r
100:no_nt32\r
101\r
102if /I "%1"=="NewBuild" shift\r
103if exist %WORKSPACE%\BaseTools (\r
104 set EDK_TOOLS_PATH=%WORKSPACE%\BaseTools\r
105) else (\r
106 if defined PACKAGES_PATH (\r
107 for %%i IN (%PACKAGES_PATH%) DO (\r
108 if exist %%~fi\BaseTools (\r
109 set EDK_TOOLS_PATH=%%~fi\BaseTools\r
110 goto checkBaseTools\r
111 )\r
112 )\r
113 ) else (\r
114 echo.\r
115 echo !!! ERROR !!! Cannot find BaseTools !!!\r
116 echo. \r
117 goto BadBaseTools\r
118 )\r
119)\r
120if exist %EDK_TOOLS_PATH%\Source set BASE_TOOLS_PATH=%EDK_TOOLS_PATH%\r
121\r
122:checkBaseTools\r
123IF NOT EXIST "%EDK_TOOLS_PATH%\toolsetup.bat" goto BadBaseTools\r
124call %EDK_TOOLS_PATH%\toolsetup.bat %*\r
125if /I "%1"=="Reconfig" shift\r
126goto check_cygwin\r
127\r
128:BadBaseTools\r
129 @REM\r
130 REM Need the BaseTools Package in order to build\r
131 @REM\r
132 @echo.\r
133 @echo !!! ERROR !!! The BaseTools Package was not found !!!\r
134 @echo.\r
135 @echo Set the system environment variable, EDK_TOOLS_PATH to the BaseTools,\r
136 @echo For example,\r
137 @echo set EDK_TOOLS_PATH=C:\MyTools\BaseTools\r
138 @echo The setup script, toolsetup.bat must reside in this folder.\r
139 @echo.\r
140 goto end\r
141\r
142:check_cygwin\r
143if defined CYGWIN_HOME (\r
144 if not exist "%CYGWIN_HOME%" (\r
145 @echo.\r
146 @echo !!! WARNING !!! CYGWIN_HOME not found, gcc build may not be used !!!\r
147 @echo.\r
148 )\r
149) else (\r
150 if exist c:\cygwin (\r
151 set CYGWIN_HOME=c:\cygwin\r
152 ) else (\r
153 @echo.\r
154 @echo !!! WARNING !!! No CYGWIN_HOME set, gcc build may not be used !!!\r
155 @echo.\r
156 )\r
157)\r
158\r
159:cygwin_done\r
160if "%1"=="" goto end\r
161\r
162:Usage\r
163 @echo.\r
164 @echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [--nt32] [Reconfig]"\r
165 @echo --nt32 Call vsvars32.bat for NT32 platform build.\r
166 @echo.\r
167 @echo Reconfig Reinstall target.txt, tools_def.txt and build_rule.txt.\r
168 @echo.\r
169 @echo Note that target.template, tools_def.template and build_rules.template\r
170 @echo will only be copied to target.txt, tools_def.txt and build_rule.txt\r
171 @echo respectively if they do not exist. Use option [Reconfig] to force the copy.\r
172 @echo.\r
173 goto end\r
174\r
175:end\r
176 popd\r
177\r