1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
|
#**********************************************************************
#**********************************************************************
#** **
#** (C)Copyright 1985-2010, American Megatrends, Inc. **
#** **
#** All Rights Reserved. **
#** **
#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
#** **
#** Phone: (770)-246-8600 **
#** **
#**********************************************************************
#**********************************************************************
#**********************************************************************
# $Header: /Alaska/BIN/Core/FFS.mak 25 2/05/11 1:43p Artems $
#
# $Revision: 25 $
#
# $Date: 2/05/11 1:43p $
#**********************************************************************
# Revision History
# ----------------
# $Log: /Alaska/BIN/Core/FFS.mak $
#
# 25 2/05/11 1:43p Artems
# Added Nested FV support
#
# 24 10/19/10 10:37p Felixp
# UI Seciton generation command is updated to support strings with
# spaces.
#
# 23 8/30/10 11:27p Felixp
# Improvement(EIP 43254):
# Support for override of the module name string that is included into
# the FFS file user interface section is added.
# The string can be overridden using UI_NAME macro.
#
# 22 8/20/10 12:51p Felixp
# LZMA compression support
#
# 21 3/19/10 12:41p Felixp
#
# 20 3/18/10 5:49p Felixp
# New SDL token USE_CP_RESPONSE_FILE is added.
# When this option is enabled, all C-preprocessor(CP) options are passed
# via the response file.
# The token should be enabled when the length of the CP command line
# exceeds
# maximum supported limit. The token is disabled by default.
#
# 19 11/23/09 6:18p Felixp
# Version FFS section support is added.
#
# 18 10/22/07 6:11p Felixp
# New FFS_ALIGNMENT switch added to support FFS data alignment
#
# 17 9/05/07 6:15p Felixp
# TE Image support is disabled.
# This is work in progress. TE image support will be enabled in the
# future Core versions.
#
# 16 6/01/07 2:51p Felixp
# TE image support added.
# File header comments improved
#
# 15 3/30/07 4:43p Felixp
# Support for FFS_CHECKSUM added to control FFS checksum generation.
#
# 14 3/18/07 1:52p Felixp
# TE image support is commented out. More testing is required before this
# can be enabled
#
# 13 3/18/07 12:44p Felixp
# Support for TE images added
#
# 12 3/13/07 9:54a Felixp
# Global and CPU architecture specific macros are now passed
# to C preprocessor (used during DepEx and VFR compilation)
#
# 11 2/27/07 2:37p Markw
#
# 10 10/03/06 8:56a Felixp
# EXTRA_INCLUDES and EXTRA_DEFINES macros added to pass include
# directories and macro definitions for dependency expression
# preprocessing
#
# 9 8/24/06 9:06a Felixp
# Preliminary x64 support (work in progress)
#
# 8 5/19/06 6:14p Felixp
# 1. Support for EDK-based modules added.
# 2. MY_INCLUDES macro added to specify list of include directories
#
# 7 1/10/06 9:42a Felixp
# do not create UI section for RAW files
#
# 6 1/09/06 11:27a Felixp
# Support for UI section added
#
# 4 1/05/06 2:38p Felixp
# support of UI sections added
#
# 3 11/07/05 3:00p Davidd
# $(SILENT_OUT) removed for GenSection since new version of the utility
# supports silent execution.
#
# 2 11/07/05 10:07a Felixp
# support for FREFORM_GUID sections added (to support AMI resource
# sections)
#
# 1 1/28/05 12:43p Felixp
#
# 5 1/18/05 3:21p Felixp
# PrintDebugMessage renamed to Trace
#
# 3 1/14/05 12:35p Markw
# RAWFILE now can be anywhere in the project directory
#
# 2 1/12/05 3:16p Felixp
# support for separetely built sections added
#
# 1 12/23/04 9:41a Felixp
#
# 9 12/03/04 6:12p Felixp
# brief build mode added
#
# 8 11/03/04 7:36p Felixp
# package file handling chaned:
# 1. package file is now recreated during every build
# 2. we no longer need dummy attrib utility
#
# 7 7/13/04 10:42a Felixp
#
# 6 4/10/04 2:17p Felixp
#
# 5 4/07/04 1:02p Felixp
#
# 3 1/08/04 4:46p Felixp
# comments improved
#
# 2 12/09/03 11:50a Felixp
# Comments changed for the better HelpBuiler compatibility.
#
# 1 12/05/03 4:15p Felixp
#
#**********************************************************************
#<AMI_FHDR_START>
#
# Name: FFS.mak
#
# Description:
# This makefile defines process of Firmware File System File creation.
# The following macros have to be defined:
# BUILD_DIR - temporary files derectory
# SOURCE_DIR - source files derectory
# GUID - GUID of the FFS file to be created
# TYPE - FFS File Type.
# Possible Values:
# EFI_FV_FILETYPE_APPLICATION
# EFI_FV_FILETYPE_FREEFORM
# EFI_FV_FILETYPE_RAW
# EFI_FV_FILETYPE_PEIM
# EFI_FV_FILETYPE_PEI_CORE
# EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER
# EFI_FV_FILETYPE_DXE_CORE
# EFI_FV_FILETYPE_DRIVER
# EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
# FFSFILE - FFS File Name (including path)
# The following macros may be defined:
# COMPRESS - disables/enable compression within FFS file
# Possible values:
# 1 - enable compression
# <any other value> - disable compression
# DEPEX1,DEPEX1_TYPE - First Dependency Expression source file name(including path) and type
# DEPEX2,DEPEX2_TYPE - Second Dependency Expression source file(including path) name and type
# Possible Values for DEPEX1_TYPE,DEPEX2_TYPE:
# EFI_SECTION_PEI_DEPEX
# EFI_SECTION_DXE_DEPEX
# PEFILE - PE File Name
# BINFILE - Binary File Name
# RAWFILE - File Name
# SECTION - File Name (without path, BUILD_DIR used)
# RESOURCE, SECTION_GUID - Resource File Name and GUID of the resource section.
# The $(RESOURCE) file will be encapsulated into section of type EFI_SECTION_FREEFORM_SUBTYPE_GUID
# with GUID set to $(SECTION_GUID).
# EXTRA_INCLUDES - List include directories for dependency expression preprocessing
# EXTRA_DEFINES - List of macro definitions for dependency expression preprocessing
# FFS_CHECKSUM - 0 or 1. Enables/Disables FFS file checksum
# FFS_ALIGNMENT - FFS file data alignment. Supported values are from 0 to 7.
# FFS_ALIGNMENT value - FFS Data Alignment
# 0 or not specified - no alignment requirements
# 1 - 16 bytes
# 2 - 128 bytes
# 3 - 512 bytes
# 4 - 1K
# 5 - 4K
# 6 - 32K
# 7 - 64K
# VERSION - Build Number to be inserted into the version section
# VERSIONSTRING - Version string to be inserted into the version section
#<AMI_FHDR_END>
#**********************************************************************
!INCLUDE $(BUILD_DIR)\token.mak
PKGFILE=$(FFSFILE:.ffs=)
!IF "$(PKGFILE)"=="$(FFSFILE)"
PKGFILE=$(FFSFILE:.FFS=)
!IF "$(PKGFILE)"=="$(FFSFILE)"
PKGFILE=$(FFSFILE:.Ffs=)
!ENDIF
!ENDIF
PKGFILE=$(PKGFILE)__.pkg
all : $(PKGFILE)
!IFDEF DEPEX1
$(PKGFILE) : $(BUILD_DIR)\$(NAME)_DPX1.tmp
$(BUILD_DIR)\$(NAME)_DPX1.tmp : $(DEPEX1)
!IF "$(USE_CP_RESPONSE_FILE)"=="1"
$(CP) @<<$(BUILD_DIR)\$(NAME)CpOptions.txt $(DEPEX1) > $*.tmp1
$(CPFLAGS)
<<KEEP
!ELSE
$(CP) $(CPFLAGS) $(DEPEX1) > $*.tmp1
!ENDIF
$(GENDEPEX) -I $*.tmp1 -O $@ $(SILENT_OUT)
$(SILENT)del $*.tmp1
!ENDIF
!IFDEF DEPEX2
$(PKGFILE) : $(BUILD_DIR)\$(NAME)_DPX2.tmp
$(BUILD_DIR)\$(NAME)_DPX2.tmp : $(DEPEX2)
!IF "$(USE_CP_RESPONSE_FILE)"=="1"
$(CP) @<<$(BUILD_DIR)\$(NAME)CpOptions.txt $(DEPEX2) > $*.tmp1
$(CPFLAGS)
<<KEEP
!ELSE
$(CP) $(CPFLAGS) $(DEPEX2) > $*.tmp1
!ENDIF
$(GENDEPEX) -I $*.tmp1 -O $@ $(SILENT_OUT)
$(SILENT)del $*.tmp1
!ENDIF
!IFDEF PEFILE
$(PKGFILE) : $(PEFILE)
!ENDIF
!IFDEF BINFILE
$(PKGFILE) : $(BINFILE)
!ENDIF
!IFDEF RAWFILE
$(PKGFILE) : $(PROJECT_DIR)\$(RAWFILE)
!ENDIF
!IFDEF SECTION
$(PKGFILE) : $(BUILD_DIR)\$(SECTION)
!ENDIF
!IFDEF RESOURCE
!IF "$(SECTION_GUID)"==""
!ERROR SECTION_GUID for resource $(RESOURCE) is not defined
!ENDIF
$(PKGFILE) : $(RESOURCE)
!ENDIF
!IF "$(CREATE_UI_SECTION)"=="1" && "$(TYPE)"!="EFI_FV_FILETYPE_FREEFORM" && "$(TYPE)"!="EFI_FV_FILETYPE_RAW"
!IFNDEF UI_NAME
UI_NAME=$(NAME)
!ENDIF
!ENDIF
!IF DEFINED(VERSION) || DEFINED(VERSIONSTRING)
!IFNDEF VERSION
VERSION=0
!ENDIF
!ENDIF
!IF "$(LZMA_SUPPORT)" == "1"
COMPRESSION_TYPE = LZMA
!ELSE
COMPRESSION_TYPE = dummy
!ENDIF
!IF "$(COMPRESS)"==""
!ERROR COMPRESS variable is undefined for module $(NAME).
!ENDIF
!IF "$(FFS_CHECKSUM)"=="0"
FFS_ATTRIB_CHECKSUM=FALSE
!ELSE
FFS_ATTRIB_CHECKSUM=TRUE
!ENDIF
$(PKGFILE) :
@copy << $(PKGFILE) > NUL
PACKAGE.INF
[.]
BASE_NAME = DummyName
FFS_FILEGUID = $(GUID)
FFS_FILETYPE = $(TYPE)
FFS_ATTRIB_CHECKSUM = $(FFS_ATTRIB_CHECKSUM)
!IFDEF FFS_ALIGNMENT
FFS_ALIGNMENT = $(FFS_ALIGNMENT)
!ENDIF
IMAGE_SCRIPT =
{
!IFDEF DEPEX1
$(NAME)_DPX1.dpx
{
TYPE = $(DEPEX1_TYPE)
BIN = $(BUILD_DIR)\$(NAME)_DPX1.tmp
}
!ENDIF
!IFDEF DEPEX2
$(NAME)_DPX2.dpx
{
TYPE = $(DEPEX2_TYPE)
BIN = $(BUILD_DIR)\$(NAME)_DPX2.tmp
}
!ENDIF
!IF $(COMPRESS)==1
Compress ($(COMPRESSION_TYPE)) {
!ENDIF
!IFDEF PEFILE
$(NAME)_PE.pe
{
TYPE = EFI_SECTION_PE32
BIN = $(PEFILE)
}
!ENDIF
!IFDEF BINFILE
$(NAME)_BIN.sec
{
TYPE = EFI_SECTION_RAW
BIN = $(BINFILE)
}
!ENDIF
!IFDEF SECTION
$(BUILD_DIR)\$(SECTION)
!ENDIF
!IFDEF RESOURCE
$(NAME)_RES.sec
{
TYPE = EFI_SECTION_FREEFORM_SUBTYPE_GUID
BIN = $(RESOURCE)
GUID = $(SECTION_GUID)
}
!ENDIF
!IF DEFINED(FV_FILE) || DEFINED(FV_DESC)
$(NAME)_FV.sec
{
TYPE = EFI_SECTION_FIRMWARE_VOLUME_IMAGE
!IFNDEF FV_DESC
BIN = FV_FILE
!ELSE
FV_DESC = $(FV_DESC)
!ENDIF
}
!ENDIF
!IF "$(CREATE_UI_SECTION)"=="1" && "$(TYPE)"!="EFI_FV_FILETYPE_FREEFORM" && "$(TYPE)"!="EFI_FV_FILETYPE_RAW"
$(NAME)_UI.sec
{
TYPE = EFI_SECTION_USER_INTERFACE
STRING = $(UI_NAME)
}
!ENDIF
!IFDEF VERSION
$(NAME)_VER.sec
{
TYPE = EFI_SECTION_VERSION
BUILD_NO = VERSION
STRING = $(VERSIONSTRING)
}
!ENDIF
!IF $(COMPRESS)==1
}
!ENDIF
!IFDEF RAWFILE
$(PROJECT_DIR)\$(RAWFILE)
!ENDIF
}
<<KEEP
#**********************************************************************
#**********************************************************************
#** **
#** (C)Copyright 1985-2010, American Megatrends, Inc. **
#** **
#** All Rights Reserved. **
#** **
#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
#** **
#** Phone: (770)-246-8600 **
#** **
#**********************************************************************
#**********************************************************************
|