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