3 @rem # Copyright
(c
) 2007, Intel Corporation
4 @rem # All rights reserved. This program and the accompanying materials
5 @rem # are licensed and made available under the terms and conditions of the BSD License
6 @rem # which accompanies this distribution. The full text of the license may be found at
7 @rem # http
://opensource.org
/licenses
/bsd
-license.php
9 @rem # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN
"AS IS" BASIS
,
10 @rem # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND
, EITHER EXPRESS OR IMPLIED.
18 @rem # This script provides single module build
, clean and
find function
19 @rem # based on module name.
21 @rem # The auto
-generated module.list file records all module names
22 @rem # described in the current platform.dsc.
29 @rem initilize local variable
81 @rem no other paramters
82 if "%FUNCTION%"=="rebuild" goto build
88 @rem
if no input
, build all
90 if "%FUNCTION%"=="rebuild" (
91 nmake
-nologo
-f Makefile clean
93 nmake
-nologo
-f Makefile all
96 @rem
then try to build special targets
: all
, fast
, tools.
97 if /I
"%MODULE%"=="all" (
98 @rem build all modules and tools.
99 if "%FUNCTION%"=="rebuild" (
100 nmake
-nologo
-f Makefile cleanall
102 nmake
-nologo
-f Makefile all
105 if /I
"%MODULE%"=="fast" (
106 @rem build fast target to skip FV
=NULL modules.
107 if "%FUNCTION%"=="rebuild" (
108 nmake
-nologo
-f Makefile clean
110 nmake
-nologo
-f Makefile fast
113 if /I
"%MODULE%"=="tools" (
114 @rem build all tools.
115 if "%FUNCTION%"=="rebuild" (
116 nmake
-nologo
-f Makefile cleantools
118 nmake
-nologo
-f Makefile build_tools
120 echo All tools are built.
123 @rem build single module
, update build makefiles
124 if "%FUNCTION%"=="rebuild" (
125 nmake
-nologo
-f module.mak
%MODULE%Clean
2>NUL
127 nmake
-nologo
-f Makefile flashmap
> NUL
2>&1
128 nmake
-nologo
-f Makefile makefiles
129 if errorlevel 1 goto builderror
130 @rem check whether input module name is described in current dsc file.
131 findstr
/I
/C
:" %MODULE% " module.list
> NUL
135 findstr
/I
/C
:"%MODULE%" module.list
> NUL
136 if errorlevel 1 goto finderror
137 for /F
%%A in
('findstr /I /C:"%MODULE%" module.list') do echo %%A
139 echo Warning
!!! Your specified module name can
't be found.
140 echo One of the above modules may be what you want to build.
143 @rem build this module
144 nmake -nologo -f module.mak %MODULE%Build
146 if "%FUNCTION%"=="rebuild" (
147 echo Module %MODULE% is rebuilt.
149 echo Module %MODULE% is built.
152 @rem output build time.
155 echo Start time %StartTime%
156 echo End time %EndTime%
160 @rem if no input, default clean all build directories.
162 nmake -nologo -f Makefile clean
165 @rem first try to clean special tasks: all, modules and tools
166 if /I "%MODULE%"=="all" (
167 nmake -nologo -f Makefile cleanall
170 if /I "%MODULE%"=="modules" (
171 nmake -nologo -f Makefile cleanbuilds
174 if /I "%MODULE%"=="tools" (
175 nmake -nologo -f Makefile cleantools
178 @rem clean single module
179 @rem check whether input module name is in module.list file.
180 if not exist module.list (
181 echo Module list info doesn't
exist.
182 echo Processing dsc file to generate module list info.
183 nmake
-nologo
-f Makefile flashmap
> NUL
2>&1
184 nmake
-nologo
-f Makefile makefiles
> error.log
2>&1
185 if errorlevel 1 goto builderror
187 findstr
/I
/C
:" %MODULE% " module.list
> NUL
190 findstr
/I
/C
:"%MODULE%" module.list
> NUL
191 if errorlevel 1 goto finderror
192 for /F
%%A in
('findstr /I /C:"%MODULE%" module.list') do echo %%A
194 echo Warning
!!! Your specified module name can
't be found.
195 echo One of the above modules may be what you want to clean.
198 @rem clean this module
199 nmake -nologo -f module.mak %MODULE%Clean 2>NUL
201 echo Module %MODULE% is cleaned.
205 @rem find match module name by subname.
206 if "%UPDATE%"=="TRUE" (
207 echo Processing dsc file to update module list info.
208 nmake -nologo -f Makefile flashmap > NUL 2>&1
209 nmake -nologo -f Makefile makefiles > error.log 2>&1
210 if errorlevel 1 goto builderror
212 if not exist module.list (
213 echo Module list info doesn't
exist.
214 echo Processing dsc file to generate module list info.
215 nmake
-nologo
-f Makefile flashmap
> NUL
2>&1
216 nmake
-nologo
-f Makefile makefiles
> error.log
2>&1
217 if errorlevel 1 goto builderror
222 if "%VERBOSE%"=="TRUE" (
225 @rem only output module name without module.inf file name
226 for /F
%%A in
(module.list
) do echo %%A
229 @rem display match module name
231 if "%VERBOSE%"=="TRUE" (
232 findstr
/I
/C
:"%MODULE%" module.list
233 if errorlevel 1 goto notfind
235 findstr
/I
/C
:"%MODULE%" module.list
> NUL
236 if errorlevel 1 goto notfind
237 for /F
%%A in
('findstr /I /C:"%MODULE%" module.list') do echo %%A
243 echo build or clean single module based on module name after tools are built.
245 echo build
[/r
] [/c
] [/f
] [/h
] [modulename
]
247 echo build
[/r
] [modulename
]
248 echo build single module
, such as build DxeMain.
249 echo If /r is specified
, the target will be rebuit after cleaned first.
250 echo if no input modulename or modulename is all
, then build all
251 echo Specail build targets
: all
, fast
, tools.
252 echo These special targets may
not exist in your tip main makefile.
253 echo build
- build all tools and modules
254 echo build all
- build all tools and modules
255 echo build fast
- build all without FV
=NULL modules
256 echo build tools
- build all tools.
258 echo build
/c
[modulename
]
259 echo build clean
[modulename
]
260 echo remove the temp generated
files for single module
261 echo if no input modulename
, then clean all
262 echo Specail clean targets
: all
, modules
, tools.
263 echo These special targets may
not exist in your tip main makefile.
264 echo build
/c
- clean up all build directories
265 echo build
/c all
- clean up all build directories and binary dirs.
266 echo build
/c modules
- clean up all build directories except
for tools.
267 echo build
/c tools
- clean up only tools directory.
269 echo build
/f
[/a
] [/v
] [subname
]
270 echo find all matched modulename with the sub string of module name.
271 echo option
/a re
-processes dsc
files to update module name list.
272 echo option
/v outputs module name and module.inf file name both.
276 echo display help information.
281 echo Warning
!!! Your specified module name can
't be found.
282 echo Try to use /f /a options to update module name list.
286 echo Warning!!! Your specified module name can't be found.
287 echo Try to
use /f to
find modules that you want to build.
288 echo Or
use /h to get the helpinfo of this script.
292 if exist error.log
type error.log
294 if not exist Tools\ProcessDsc.exe
(
296 echo Error
!!! Build tools may
not be ready. Try to build tools first.
299 del module.
* > NUL
2>&1
303 if exist error.log
del error.log