]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Sample/CommonTools.env
update EdkCompatibilityPkg version to 0.90
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / CommonTools.env
1 #/*++
2 #
3 # Copyright (c) 2004 - 2007, Intel Corporation
4 # All rights reserved. This program and the accompanying materials
5 # are licensed and made available under the terms and conditions of the BSD License
6 # which accompanies this distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php
8 #
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 #
12 # Module Name:
13 #
14 # CommonTools.env
15 #
16 # Abstract:
17 #
18 # This file should not need to be customized. Customizations should
19 # be done in LocalTools.env if at all possible.
20 #
21 # This file can be included by other makefiles.
22 #
23 # It defines variables used by the different toolchains. It first includes
24 # the user-customized LocalTools.env, and then uses those defines to
25 # define other variables.
26 #
27 # It basically has sections for different toolchains which define variables
28 # used to build.
29 #
30 #--*/
31
32 #
33 # Everything depends on EDK_SOURCE. Make sure it's defined
34 #
35 !IFNDEF EDK_SOURCE
36 !ERROR EDK_SOURCE environmental variable not set
37 !ENDIF
38
39 #
40 # Tools depend on BUILD_DIR. Make sure it's defined
41 #
42 !IFNDEF BUILD_DIR
43 !ERROR BUILD_DIR environmental variable not set. Should be set in PlatformTools.env
44 !ENDIF
45
46 #
47 # This include file gets customized by the developer. Get the customizations.
48 #
49 !INCLUDE $(EDK_SOURCE)\Sample\LocalTools.env
50
51 ################################################################################
52 #
53 # Define paths for EFI build tools
54 #
55 ################################################################################
56 !IFNDEF EDK_TOOLS_PATH
57 EDK_TOOLS_BIN = $(EDK_SOURCE)\Tools\Bin
58 !ELSE
59 EDK_TOOLS_BIN = $(EDK_TOOLS_PATH)\Bin
60 !ENDIF
61 EDK_TOOLS_DIR = $(EDK_SOURCE)\Sample\Tools
62 EDK_TOOLS_SOURCE = $(EDK_TOOLS_DIR)\Source
63 EDK_TOOLS_COMMON = $(EDK_TOOLS_DIR)\Source\Common
64 EDK_TOOLS_OUTPUT = $(BUILD_DIR)\Tools
65 PCCTS_DIR = $(EDK_SOURCE)\Other\Maintained\Tools\Pccts
66
67 #
68 # This include file gets some version info.
69 #
70 !INCLUDE $(EDK_SOURCE)\Sample\Version.env
71
72 #
73 # Macros to define the build tools
74 #
75 ANTLR = $(PCCTS_DIR)\bin\antlr
76 DLG = $(PCCTS_DIR)\bin\dlg
77 EXE2BIN = $(EDK_TOOLS_OUTPUT)\Strip
78 FWIMAGE = $(EDK_TOOLS_OUTPUT)\FwImage
79 GENDEPEX = $(EDK_TOOLS_OUTPUT)\GenDepex
80 GENFDIMAGE = $(EDK_TOOLS_OUTPUT)\GenFdImage
81 GENFFSFILE = $(EDK_TOOLS_OUTPUT)\GenFfsFile
82 GENFVIMAGE = $(EDK_TOOLS_OUTPUT)\GenFvImage
83 GENSECTION = $(EDK_TOOLS_OUTPUT)\GenSection
84 GENTEIMAGE = $(EDK_TOOLS_OUTPUT)\GenTEImage
85 GUIDCHK = $(EDK_TOOLS_OUTPUT)\GuidChk
86 MAKEDEPS = $(EDK_TOOLS_OUTPUT)\MakeDeps
87 PROCESSDSC = $(EDK_TOOLS_OUTPUT)\ProcessDsc
88 STRGATHER = $(EDK_TOOLS_OUTPUT)\StrGather
89 SETSTAMP = $(EDK_TOOLS_OUTPUT)\SetStamp
90 VFRCOMPILE = $(EDK_TOOLS_OUTPUT)\VfrCompile
91 GENAPRIORI = $(EDK_TOOLS_OUTPUT)\GenAprioriFile
92 MODIFYINF = $(EDK_TOOLS_OUTPUT)\ModifyInf
93
94 MAKE = nmake -nologo
95
96 #
97 # Everything else requires that TOOLCHAIN be defined. This should be defined
98 # by the calling makefile.
99 #
100 !IFNDEF TOOLCHAIN
101 !ERROR TOOLCHAIN not defined for $(EDK_SOURCE)\Sample\CommonTools.env
102 !ENDIF
103
104 ###############################################################################
105 #
106 # Specify the path and macros for ASL tools
107 #
108 ###############################################################################
109 !IF "$(EFI_ASL_LOCAL)" == "YES"
110 ASL = $(ASLPATH)\Iasl
111 !ELSE
112 ASL = $(EDK_TOOLS_BIN)\Iasl
113 !ENDIF
114
115 ASL_FLAGS =
116 C_FLAGS_ASL = /nologo /EP /C
117
118 ###############################################################################
119 #
120 # Specify the path and macros for IA32 tools
121 #
122 ###############################################################################
123
124 !IF "$(TOOLCHAIN)" == "TOOLCHAIN_IA32"
125
126 #
127 # Globally relevant flags. Options not appropriate for all builds may be
128 # appropriate in the processor architecture specific macros (xxx_ARCH_FLAGS) or
129 # in the platform specific macros (xxx_PROJ_FLAGS)
130 #
131 C_STD_INCLUDE = /X
132
133 !IF "$(EFI_GENERATE_INTERMEDIATE_FILE)" == "YES"
134
135 !IF "$(USE_VC8)" == "YES"
136 C_STD_FLAGS = /nologo /W4 /WX /EHs-c- /GR- /Gy /GS- /D USE_VC8 /c /Fa$* /FAsc /Fo$@ /FR$(@R).SBR $(INC)
137 !ELSE
138 C_STD_FLAGS = /nologo /W4 /WX /GX- /GR- /Gy /c /Fa$* /FAsc /Fo$@ /FR$(@R).SBR $(INC)
139 !ENDIF
140 ASM_STD_FLAGS = /nologo /Fl$*.lst $(INC)
141
142 !ELSE
143
144 !IF "$(USE_VC8)" == "YES"
145 C_STD_FLAGS = /nologo /W4 /WX /EHs-c- /GR- /Gy /GS- /D USE_VC8 /c /Fo$@ $(INC)
146 !ELSE
147 C_STD_FLAGS = /nologo /W4 /WX /GX- /GR- /Gy /c /Fo$@ $(INC)
148 !ENDIF
149 ASM_STD_FLAGS = /nologo $(INC)
150
151 !ENDIF
152
153 LINK_STD_FLAGS = /nologo /SUBSYSTEM:CONSOLE /NODEFAULTLIB /MAP /OPT:REF /BASE:0 /IGNORE:4001,4078,4086,4096,4108 $(BUILD_DIR)\IA32\CompilerStub.lib
154 LIB_STD_FLAGS = /nologo
155
156 #
157 # Build type specific flags. Globally relevant flags belong in the standard
158 # macros, xxx_STD_FLAGS defined above. Platform specific macros belong in the
159 # PlatformTools.env file in macros named xxx_PROJ_FLAGS.
160 #
161 C_ARCH_FLAGS = /D EFI32
162 ASM_ARCH_FLAGS = /W3 /WX /c /coff /Fo$@ /DEFI32
163 LINK_ARCH_FLAGS = /MACHINE:I386
164 LIB_ARCH_FLAGS =
165
166 ASM16_FLAGS = /nologo /c /omf /Fo$@
167 ASMLINK16_FLAGS =
168
169 #
170 # Build tools
171 #
172 CC = cl
173 LINK = link
174 LIB = lib
175 #
176 # When using VS ml to compile 16bit code, please add /omf compiler option
177 #
178 ASM = ml
179
180 !IF "$(EFI_ASSEMBLER_NAME)" == ""
181 ASM16 = $(MASMPATH)\bin\ml
182 ASMLINK16 = $(MASMPATH)\binr\link
183 ASMLINK = $(MASMPATH)\binr\link
184 !ELSE
185 ASM16 = $(EDK_TOOLS_BIN)\Ia32\$(EFI_ASSEMBLER_NAME)\bin\ml
186 ASMLINK16 = $(EDK_TOOLS_BIN)\Ia32\$(EFI_ASSEMBLER_NAME)\binr\link
187 ASMLINK = $(EDK_TOOLS_BIN)\Ia32\$(EFI_ASSEMBLER_NAME)\binr\link
188 !ENDIF
189
190 BSCMAKE = bscmake
191
192 !IF "$(EFI_SYMBOLIC_DEBUG)" == "YES"
193 ASM_ARCH_FLAGS = $(ASM_ARCH_FLAGS) /Zi /DDEBUG
194 C_STD_FLAGS = $(C_STD_FLAGS) /Zi /Gm /Fd$(DEST_DIR)\$(BASE_NAME)Obj
195 LINK_STD_FLAGS = $(LINK_STD_FLAGS) /DEBUG
196 !ENDIF
197
198 # END OF TOOLCHAIN_IA32
199 ###############################################################################
200
201 ###############################################################################
202 #
203 # Specify the path and macros for the X64 (also called x86-64, EM64T, AMD64) tools
204 #
205 ###############################################################################
206
207 !ELSEIF "$(TOOLCHAIN)" == "TOOLCHAIN_X64"
208
209 #
210 # Globally relevant flags. Options not appropriate for all builds may be
211 # appropriate in the processor architecture specific macros (xxx_ARCH_FLAGS) or
212 # in the platform specific macros (xxx_PROJ_FLAGS)
213 #
214 C_STD_INCLUDE = /X
215 !IF "$(EFI_GENERATE_INTERMEDIATE_FILE)" == "YES"
216 C_STD_FLAGS = /nologo /W4 /WX /EHs-c- /GR- /Gy /c /GS- /Fa$* /FAsc /Fo$@ /FR$(@R).SBR $(INC)
217 ASM_STD_FLAGS = /nologo /Fl$*.lst $(INC)
218 !ELSE
219 C_STD_FLAGS = /nologo /W4 /WX /EHs-c- /GR- /Gy /c /GS- /Fo$@ $(INC)
220 ASM_STD_FLAGS = /nologo $(INC)
221 !ENDIF
222 LINK_STD_FLAGS = /nologo /SUBSYSTEM:CONSOLE /NODEFAULTLIB /MAP /OPT:REF /BASE:0 /IGNORE:4001,4078,4086,4096,4108 $(BUILD_DIR)\X64\CompilerStub.lib
223 LIB_STD_FLAGS = /nologo
224
225 #
226 # Build type specific flags. Globally relevant flags belong in the standard
227 # macros, xxx_STD_FLAGS defined above. Platform specific macros belong in the
228 # PlatformTools.env file in macros named xxx_PROJ_FLAGS.
229 #
230 C_ARCH_FLAGS = /D EFIX64
231 ASM_ARCH_FLAGS = /W3 /WX /c /Fo$@ /DEFIX64
232 LINK_ARCH_FLAGS = /Machine:AMD64
233 LIB_ARCH_FLAGS =
234
235 ASM16_FLAGS = /nologo /c /omf /Fo$@
236 ASMLINK16_FLAGS =
237
238 #
239 # Build tools
240 #
241 !IF "$(EFI_COMPILER_X64_NAME)" == ""
242 !IF "$(USE_VC8_X64)" == "YES"
243 #
244 # Use VC8 as X64 compiler
245 #
246 CC = "$(VC8_X64_PATH)\cl"
247 LINK = "$(VC8_X64_PATH)\link"
248 LIB = "$(VC8_X64_PATH)\lib"
249 ASM = "$(VC8_X64_PATH)\ml64"
250 !ELSE
251 #
252 # Use DDK as X64 compiler
253 #
254 CC = $(WIN_DDK_X64_PATH)\cl
255 LINK = $(WIN_DDK_X64_PATH)\link
256 LIB = $(WIN_DDK_X64_PATH)\lib
257 ASM = $(WIN_DDK_X64_PATH)\ml64
258 !ENDIF
259 !ELSE
260 CC = $(EDK_TOOLS_BIN)\X64\$(EFI_COMPILER_X64_NAME)\cl
261 LINK = $(EDK_TOOLS_BIN)\X64\$(EFI_COMPILER_X64_NAME)\link
262 LIB = $(EDK_TOOLS_BIN)\X64\$(EFI_COMPILER_X64_NAME)\lib
263 ASM = $(EDK_TOOLS_BIN)\X64\$(EFI_COMPILER_X64_NAME)\ml64
264 !ENDIF
265
266 !IF "$(EFI_ASSEMBLER_NAME)" == ""
267 ASM16 = $(MASMPATH)\bin\ml
268 ASMLINK16 = $(MASMPATH)\binr\link
269 ASMLINK = $(MASMPATH)\binr\link
270 !ELSE
271 ASM16 = $(EDK_TOOLS_BIN)\Ia32\$(EFI_ASSEMBLER_NAME)\bin\ml
272 ASMLINK16 = $(EDK_TOOLS_BIN)\Ia32\$(EFI_ASSEMBLER_NAME)\binr\link
273 ASMLINK = $(EDK_TOOLS_BIN)\Ia32\$(EFI_ASSEMBLER_NAME)\binr\link
274 !ENDIF
275
276 BSCMAKE = bscmake
277
278 !IF "$(EFI_SYMBOLIC_DEBUG)" == "YES"
279 ASM_ARCH_FLAGS = $(ASM_ARCH_FLAGS) /Zi /DDEBUG
280 C_STD_FLAGS = $(C_STD_FLAGS) /Zi /Gm /Fd$(DEST_DIR)\$(BASE_NAME)Obj
281 LINK_STD_FLAGS = $(LINK_STD_FLAGS) /DEBUG
282 !ENDIF
283
284 # END OF TOOLCHAIN_X64
285 ###############################################################################
286
287 ###############################################################################
288 #
289 # Specify the path and macros for the IPF tools
290 #
291 ###############################################################################
292
293 !ELSEIF "$(TOOLCHAIN)" == "TOOLCHAIN_IPF"
294
295 #
296 # Globally relevant flags. Options not appropriate for all builds may be
297 # appropriate in the processor architecture specific macros (xxx_ARCH_FLAGS) or
298 # in the platform specific macros (xxx_PROJ_FLAGS)
299 #
300 C_STD_INCLUDE = /X
301
302 !IF "$(EFI_GENERATE_INTERMEDIATE_FILE)" == "YES"
303
304 !IF "$(USE_VC8_IPF)" == "YES"
305 C_STD_FLAGS = /nologo /W4 /WX /EHs-c- /GR- /Gy /GS- /c /Fa$* /FAsc /Fo$@ /FR$(@R).SBR $(INC)
306 !ELSE
307 !IF "$(USE_NEWDDK)" == "YES"
308 C_STD_FLAGS = /nologo /W4 /WX /EHs-c- /GR- /Gy /GS- /c /Fa$* /FAsc /Fo$@ /FR$(@R).SBR $(INC)
309 !ELSE
310 C_STD_FLAGS = /nologo /W4 /WX /GX- /GR- /Gy /c /Fa$* /FAsc /Fo$@ /FR$(@R).SBR $(INC)
311 !ENDIF
312 !ENDIF
313
314 !ELSE
315
316 !IF "$(USE_VC8_IPF)" == "YES"
317 C_STD_FLAGS = /nologo /W4 /WX /EHs-c- /GR- /Gy /GS- /c /Fo$@ $(INC)
318 !ELSE
319 !IF "$(USE_NEWDDK)" == "YES"
320 C_STD_FLAGS = /nologo /W4 /WX /EHs-c- /GR- /Gy /GS- /c /Fo$@ $(INC)
321 !ELSE
322 C_STD_FLAGS = /nologo /W4 /WX /GX- /GR- /Gy /c /Fo$@ $(INC)
323 !ENDIF
324 !ENDIF
325
326 !ENDIF
327
328 ASM_STD_FLAGS = $(INC)
329 LINK_STD_FLAGS = /nologo /SUBSYSTEM:CONSOLE /NODEFAULTLIB /MAP /OPT:REF /BASE:0 /IGNORE:4001,4078,4086,4096,4108
330 LIB_STD_FLAGS = /nologo
331
332 #
333 # Build type specific flags. Globally relevant flags belong in the standard
334 # macros, xxx_STD_FLAGS defined above. Platform specific macros belong in the
335 # PlatformTools.env file in macros named xxx_PROJ_FLAGS.
336 #
337 C_ARCH_FLAGS = /D EFI64
338 ASM_ARCH_FLAGS = -N us -X explicit -M ilp64 -N so -W4 -o $@
339 LINK_ARCH_FLAGS = /MACHINE:IA64
340 LIB_ARCH_FLAGS =
341
342 #
343 # This is used for preprocessing IPF Assembly files
344 #
345 C_FLAGS_PRO = /nologo /EP /C $(C_STD_FLAGS) $(C_ARCH_FLAGS) $(C_PROJ_FLAGS) $(C_STD_INCLUDE)
346
347 !IF "$(EFI_DEBUG)" == "YES"
348 ASM_ARCH_FLAGS = $(ASM_ARCH_FLAGS) -d debug
349 !ENDIF
350
351 #
352 # Build tools
353 #
354 !IF "$(EFI_COMPILER_NAME)" == ""
355 !IF "$(USE_VC8_IPF)" == "YES"
356 CC = "$(VC8_IPF_PATH)\cl"
357 LINK = "$(VC8_IPF_PATH)\link"
358 LIB = "$(VC8_IPF_PATH)\lib"
359 !ELSE
360 CC = $(EFI_IA64TOOLPATH)\cl
361 LINK = $(EFI_IA64TOOLPATH)\link
362 LIB = $(EFI_IA64TOOLPATH)\lib
363 !ENDIF
364 !ELSE
365 CC = $(EDK_TOOLS_BIN)\Ipf\$(EFI_COMPILER_NAME)\cl
366 LINK = $(EDK_TOOLS_BIN)\Ipf\$(EFI_COMPILER_NAME)\link
367 LIB = $(EDK_TOOLS_BIN)\Ipf\$(EFI_COMPILER_NAME)\lib
368 !ENDIF
369
370 !IF "$(EFI_ASSEMBLER_NAME)" == ""
371 !IF "$(USE_VC8_IPF)" == "YES"
372 ASM = "$(VC8_IPF_PATH)\ias"
373 ASMLINK = "$(VC8_IPF_PATH)\link"
374 !ELSE
375 ASM = $(EFI_IA64ASMPATH)\ias
376 ASMLINK = $(EFI_IA64ASMPATH)\link
377 !ENDIF
378 !ELSE
379 ASM = $(EDK_TOOLS_BIN)\Ipf\$(EFI_ASSEMBLER_NAME)\ias
380 ASMLINK = $(EDK_TOOLS_BIN)\Ipf\$(EFI_ASSEMBLER_NAME)\link
381 !ENDIF
382
383 BSCMAKE = bscmake
384
385 !IF "$(EFI_SYMBOLIC_DEBUG)" == "YES"
386 C_STD_FLAGS = $(C_STD_FLAGS) /Zi /Gm /Fd$(DEST_DIR)\$(BASE_NAME)Obj
387 LINK_STD_FLAGS = $(LINK_STD_FLAGS) /DEBUG
388 !ENDIF
389
390 # END TOOLCHAIN_IPF
391 ###############################################################################
392
393 ###############################################################################
394 #
395 # Define toolchain for building the EFI tools on an IA32 system.
396 #
397 ###############################################################################
398
399 !ELSEIF "$(TOOLCHAIN)" == "TOOLCHAIN_MSVC"
400
401 #
402 # Globally relevant flags. Options not appropriate for all builds may be
403 # appropriate in the processor architecture specific macros (xxx_ARCH_FLAGS) or
404 # in the platform specific macros (xxx_PROJ_FLAGS)
405 #
406 !IF "$(EFI_GENERATE_INTERMEDIATE_FILE)" == "YES"
407
408 !IF "$(USE_VC8)" == "YES"
409 C_STD_FLAGS = /nologo /W4 /WX /EHsc /Gy /D _CRT_SECURE_NO_DEPRECATE /D USE_VC8 /c /Fa$* /FAsc /Fo$@ /FR$(@R).SBR $(INC)
410 !ELSE
411 C_STD_FLAGS = /nologo /W4 /WX /GX /Gy /c /Fa$* /FAsc /Fo$@ /FR$(@R).SBR $(INC)
412 !ENDIF
413 ASM_STD_FLAGS = /nologo /Fl$*.lst $(INC)
414
415 !ELSE
416
417 !IF "$(USE_VC8)" == "YES"
418 C_STD_FLAGS = /nologo /W4 /WX /EHsc /Gy /D _CRT_SECURE_NO_DEPRECATE /D USE_VC8 /c /Fo$@ $(INC)
419 !ELSE
420 C_STD_FLAGS = /nologo /W4 /WX /GX /Gy /c /Fo$@ $(INC)
421 !ENDIF
422 ASM_STD_FLAGS = /nologo $(INC)
423
424 !ENDIF
425
426 LINK_STD_FLAGS = /nologo /SUBSYSTEM:CONSOLE /NODEFAULTLIB /MAP /OPT:REF
427 LIB_STD_FLAGS = /nologo
428
429 MSVS_LINK_LIBPATHS =
430
431 #
432 # Build type specific flags. Globally relevant flags belong in the standard
433 # macros, xxx_STD_FLAGS defined above. Platform specific macros belong in the
434 # PlatformTools.env file in macros named xxx_PROJ_FLAGS.
435 #
436
437 #
438 # Add a define to skip inclusion of Microsoft include file rpcasync.h, which
439 # results in a compile warning at W4.
440 #
441 C_ARCH_FLAGS = /Od /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D __RPCASYNC_H__
442 ASM_ARCH_FLAGS =
443 LINK_ARCH_FLAGS = /MACHINE:i386
444 LIB_ARCH_FLAGS =
445
446 #
447 # Always turn on debug for the build tools so that we can debug problems
448 # quickly.
449 # NOTE: Ideally all the tools makefiles should be updated to use LINK_FLAGS_EXE
450 # instead of L_FLAGS for linking. When this happens we can get rid of
451 # the L_FLAGS definition here.
452 #
453
454 #!IF "$(EFI_SYMBOLIC_DEBUG)" == "YES"
455 C_STD_FLAGS = $(C_STD_FLAGS) /Zi /Gm /Fd$(EDK_TOOLS_OUTPUT)\$(TARGET_NAME)Obj
456 LINK_ARCH_FLAGS = $(LINK_ARCH_FLAGS) /DEBUG
457 L_FLAGS = $(L_FLAGS) /DEBUG
458 #!ENDIF
459
460 #
461 # Clear any project flags when building tools
462 #
463 C_PROJ_FLAGS =
464 ASM_PROJ_FLAGS =
465 LINK_PROJ_FLAGS =
466 LIB_PROJ_FLAGS =
467 EBC_C_PROJ_FLAGS =
468 EBC_LINK_PROJ_FLAGS =
469 EBC_LIB_PROJ_FLAGS =
470
471 #
472 # Build tools
473 #
474 CC = cl
475 LINK = link
476 BSCMAKE = bscmake
477 ASM = ml
478 ASMLINK = link
479 #
480 # Use a different macro name for tools build to avoid conflict with environment
481 # variable LIB
482 #
483 LIB_EXE = lib
484
485 INC = -I $(EDK_SOURCE)\Foundation \
486 -I $(EDK_SOURCE)\Foundation\Efi \
487 -I $(EDK_SOURCE)\Foundation\Framework \
488 -I $(EDK_SOURCE)\Sample\Platform\Nt32 \
489 -I $(EDK_SOURCE)\Foundation\Core\Dxe \
490 -I $(EDK_SOURCE)\Foundation\Include \
491 -I $(EDK_SOURCE)\Foundation\Efi\Include \
492 -I $(EDK_SOURCE)\Foundation\Framework\Include \
493 -I $(EDK_SOURCE)\Foundation\Include\IndustryStandard \
494 -I $(EDK_SOURCE)\Foundation\Include\Ia32 \
495 -I $(EDK_SOURCE)\Foundation\Include\Pei \
496 -I $(EDK_SOURCE)\Foundation\Library\Pei\Include \
497 -I $(EDK_SOURCE)\Sample\Include \
498 -I "$(EDK_TOOLS_COMMON)"
499
500 # END TOOLCHAIN_MSVC
501 ###############################################################################
502
503 ###############################################################################
504 #
505 # Specify the path and macros for the EBC tools
506 #
507 ###############################################################################
508
509 !ELSEIF "$(TOOLCHAIN)" == "TOOLCHAIN_EBC"
510
511 !IF "$(EFI_GENERATE_INTERMEDIATE_FILE)" == "YES"
512 EBC_C_STD_FLAGS = /nologo /W3 /WX /c /Fa$* /FAsc /Fo$@ $(INC) /X
513 !ELSE
514 EBC_C_STD_FLAGS = /nologo /W3 /WX /c /Fo$@ $(INC) /X
515 !ENDIF
516
517 #
518 # All EBC entry point functions must be called EfiMain. Redefine it.
519 #
520 !IF "$(IMAGE_ENTRY_POINT)" == ""
521 IMAGE_ENTRY_POINT = EfiMain
522 !ENDIF
523 EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D $(IMAGE_ENTRY_POINT)=EfiMain
524 EBC_LINK_STD_FLAGS = /nologo /MACHINE:EBC /BASE:0 /OPT:REF /NODEFAULTLIB
525 EBC_LIB_STD_FLAGS = /nologo /MACHINE:EBC
526
527 #
528 # EBC tools path should be defined in LocalTools.env.
529 #
530 EBC_CC = $(EBC_TOOLS_PATH)\Bin\Iec
531 EBC_LINK = $(EBC_TOOLS_PATH)\Bin\Link
532 EBC_LIB = $(EBC_TOOLS_PATH)\Bin\Link /lib
533
534 !IF "$(EFI_SYMBOLIC_DEBUG)" == "YES"
535 EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /Zd /Zi
536 EBC_LINK_STD_FLAGS = $(EBC_LINK_STD_FLAGS) /DEBUG
537 !ENDIF
538
539 # END TOOLCHAIN_EBC
540
541 ###############################################################################
542 #
543 # Let the caller define a NULL toolchain if they don't care. This way you can
544 # pick up at least some defines.
545 #
546 ###############################################################################
547
548 !ELSEIF "$(TOOLCHAIN)" == ""
549
550 ###############################################################################
551 #
552 # You get this if the calling makefile did not define TOOLCHAIN_xxx before
553 # including this file.
554 #
555 ###############################################################################
556
557 !ELSE
558 !ERROR Unknown toolchain $(TOOLCHAIN) defined for $(EDK_SOURCE)\Sample\CommonTools.env use
559 !ENDIF
560
561
562 ###############################################################################
563 #
564 # These are standard settings for all tool chains
565 #
566 ###############################################################################
567
568 #
569 # These are standard build options
570 #
571 VERSION_FLAGS = /D EFI_SPECIFICATION_VERSION=$(EFI_SPECIFICATION_VERSION) \
572 /D PI_SPECIFICATION_VERSION=$(PI_SPECIFICATION_VERSION) \
573 /D TIANO_RELEASE_VERSION=$(TIANO_RELEASE_VERSION)
574 C_STD_FLAGS = $(C_STD_FLAGS) $(VERSION_FLAGS)
575 EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) $(VERSION_FLAGS)
576 C_FLAGS_ASL = $(C_FLAGS_ASL) $(VERSION_FLAGS)
577 VFRCOMPILE_FLAGS = $(VFRCOMPILE_FLAGS) -ppflag "$(VERSION_FLAGS)"
578 !IF "$(TOOLCHAIN)" != "TOOLCHAIN_IPF"
579 ASM_STD_FLAGS = $(ASM_STD_FLAGS) $(VERSION_FLAGS)
580 !ENDIF
581
582 !IF "$(EFI_DEBUG)" == "YES"
583 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_DEBUG
584 !ENDIF
585
586 !IF "$(EFI_DEBUG_CLEAR_MEMORY)" == "YES"
587 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_DEBUG_CLEAR_MEMORY
588 !ENDIF
589
590 !IF "$(EFI_PEI_PERFORMANCE)" == "YES"
591 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_PEI_PERFORMANCE /D EFI_DXE_PERFORMANCE
592 !ENDIF
593
594 !IF "$(EFI_ADDTIONAL_DRIVERS)" == "YES"
595 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_ADDTIONAL_DRIVERS
596 !ENDIF
597
598 !IF "$(EFI_USE_CUSTOM_COMPRESS)" == "YES"
599 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_USE_CUSTOM_COMPRESS
600 !ENDIF
601
602 !IF "$(EFI_UNLOCK_FWH)" == "YES"
603 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_UNLOCK_FWH
604 !ENDIF
605
606 !IF "$(EFI_DXE_PERFORMANCE)" == "YES"
607 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_DXE_PERFORMANCE
608 !ENDIF
609
610 !IF "$(EFI_S3_RESUME)" == "YES"
611 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_S3_RESUME
612 !ENDIF
613
614 !IF "$(EFI_SIZE_REDUCTION_APPLIED)" == "YES"
615 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_SIZE_REDUCTION_APPLIED
616 !ENDIF
617
618 !IF "$(EFI_PEI_REPORT_STATUS_CODE)" == "YES"
619 FEATURE_FLAGS = $(FEATURE_FLAGS) /D EFI_PEI_REPORT_STATUS_CODE_ON
620 !ENDIF
621
622 !IF "$(SIZE_REDUCTION_ISA_COMBINED)" == "YES"
623 FEATURE_FLAGS = $(FEATURE_FLAGS) /D SIZE_REDUCTION_ISA_COMBINED
624 !ENDIF
625
626 C_STD_FLAGS = $(C_STD_FLAGS) $(FEATURE_FLAGS)
627 EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) $(FEATURE_FLAGS)
628 C_FLAGS_ASL = $(C_FLAGS_ASL) $(FEATURE_FLAGS)
629 VFRCOMPILE_FLAGS = $(VFRCOMPILE_FLAGS) -ppflag "$(FEATURE_FLAGS)"
630 !IF "$(TOOLCHAIN)" != "TOOLCHAIN_IPF"
631 ASM_STD_FLAGS = $(ASM_STD_FLAGS) $(FEATURE_FLAGS)
632 !ENDIF
633
634 #
635 # This is used for preprocessing dependency files
636 #
637 C_FLAGS_DPX = /nologo /EP $(INC) $(VERSION_FLAGS) $(FEATURE_FLAGS)
638
639 ###############################################################################
640
641 ###############################################################################
642 #
643 # Collect final build flags for components. These flags are used to build
644 # any standard component and some non-standard components.
645 #
646 ###############################################################################
647 C_FLAGS = $(C_STD_FLAGS) $(C_ARCH_FLAGS) $(C_PROJ_FLAGS) $(C_STD_INCLUDE)
648 ASM_FLAGS = $(ASM_STD_FLAGS) $(ASM_ARCH_FLAGS) $(ASM_PROJ_FLAGS)
649 LINK_FLAGS_DLL = $(LINK_STD_FLAGS) $(LINK_ARCH_FLAGS) $(LINK_PROJ_FLAGS) /DLL
650 LINK_FLAGS_EXE = $(LINK_STD_FLAGS) $(LINK_ARCH_FLAGS) $(LINK_PROJ_FLAGS)
651 LIB_FLAGS = $(LIB_STD_FLAGS) $(LIB_ARCH_FLAGS) $(LIB_PROJ_FLAGS)
652 EBC_C_FLAGS = $(EBC_C_STD_FLAGS) $(EBC_C_ARCH_FLAGS) $(EBC_C_PROJ_FLAGS)
653 EBC_LINK_FLAGS = $(EBC_LINK_STD_FLAGS) $(EBC_LINK_ARCH_FLAGS) $(EBC_LINK_PROJ_FLAGS)
654 EBC_LIB_FLAGS = $(EBC_LIB_STD_FLAGS) $(EBC_LIB_ARCH_FLAGS) $(EBC_LIB_PROJ_FLAGS)
655
656 ###############################################################################
657 #
658 # define X64 denpendant driver files
659 #
660 ###############################################################################
661 !IF "$(EFI_BUILD_TARGET_X64)" == "YES"
662 BUILD_TARGET_PROCESSOR = X64
663 DXE_IPL = DxeIplX64
664 !ELSE
665 BUILD_TARGET_PROCESSOR = IA32
666 DXE_IPL = DxeIpl
667 !ENDIF
668 ###############################################################################
669 #
670 # define EFI specification denpendant driver files
671 #
672 ###############################################################################
673 !IF "$(UEFI_MODE)" == "YES"
674 UEFI_PREFIX = Uefi
675 ATAPI_PASS_THRU_INF = Sample\Bus\Pci\AtapiExtPassThru\Dxe\AtapiExtPassThru.inf
676 !IF "$(CAPSULE_INF)" == ""
677 CAPSULE_INF = Sample\Universal\Capsule\RuntimeDxe\Capsule.inf
678 !ENDIF
679 DEVPATH_INF = Sample\Universal\DevicePath\Dxe\DevicePath.inf
680 !ELSE
681 UEFI_PREFIX =
682 CAPSULE_INF =
683 DEVPATH_INF =
684 ATAPI_PASS_THRU_INF = Sample\Bus\Pci\AtapiPassThru\Dxe\AtapiPassThru.inf
685 !ENDIF
686 ###############################################################################
687 #
688 # define PIWG specification denpendant driver files
689 #
690 ###############################################################################
691 !IF "$(PI_MODE)" == "YES"
692 PI_PREFIX = Pi
693 !ELSE
694 PI_PREFIX =
695 !ENDIF
696 ###############################################################################
697 #
698 # define customized compress makefile
699 #
700 ###############################################################################
701 CUSTOMIZEDCOMPRESS_MAKEFILE = $(EDK_TOOLS_SOURCE)\CustomizedCompress\Makefile
702 COMPRESS_METHOD = Dummy
703 ###############################################################################
704 #
705 # define EFI_BINARY default path
706 #
707 ###############################################################################
708 !IFNDEF EFI_BINARY
709 EFI_BINARY=$(EDK_SOURCE)\Bin
710 !ENDIF
711
712 EFI_PLATFORM_BIN=$(EFI_BINARY)\$(PROJECT_NAME)$(BUILD_TARGET_DIRECTORY)