]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Conf/build_rule.template
Fix Bug to convert low Hex string to handle L'A' - L'F'
[mirror_edk2.git] / BaseTools / Conf / build_rule.template
CommitLineData
07a756b9 1#\r
c6094890 2# Copyright (c) 2007-2009, Intel Corporation\r
07a756b9 3#\r
4# All rights reserved. This program and the accompanying materials\r
5# are licensed and made available under the terms and conditions of the BSD License\r
6# which accompanies this distribution. The full text of the license may be found at\r
7# http://opensource.org/licenses/bsd-license.php\r
8\r
9# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11#\r
12# Filename: build_rule.template\r
13#\r
14\r
15## Syntax\r
16#\r
17# "*" is used to indicate that the source files will be processed at the same time.\r
18# "?" is used to indicate that the source files will be processed one by one.\r
19#\r
f285eb16 20# "[" <File-Type>[.<Build-Type>][.<Arch>][, <File-Type>[.<Build-Type>][.<Arch>]] "]" <EOL>\r
07a756b9 21# <InputFile[.<ToolChainFamily>]> <EOL>\r
f285eb16 22# (?|*).<File-Extension> [(\n|,) (?|*).<File-Extension>]\r
07a756b9 23#\r
24# <OutputFile[.<ToolChainFamily>]> <EOL>\r
25# <FileFullPath>\r
26#\r
f285eb16 27# <ExtraDependency>\r
28# <FileFullPath>\r
29#\r
07a756b9 30# <Command[.<ToolChainFamily>]> <EOL>\r
31# <Command1>\r
32# [<Command2>]\r
33#\r
f285eb16 34# <Build-Type> is the MODULE_TYPE in EDK2 or COMPONENT_TYPE in EDK.\r
35# Missing <InputFile> will cause an exception and break build.\r
36# Missing <Command> will cause that related build target won't be generated but\r
37# won't break build.\r
38#\r
07a756b9 39\r
40## Placeholders for string substitution\r
41#\r
42# ${src} Source file(s) to be built (full path)\r
43# ${s_path} Source file directory (absolute path)\r
44# ${s_dir} Source file relative directory within a module\r
45# (Note: ${s_dir} is always equals to "." if source file is given in absolute path.)\r
46# ${s_name} Source file name without path\r
47# ${s_base} Source file name without extension and path\r
48# ${s_ext} Source file extension\r
49#\r
50# ${dst} Destination file(s) built from ${src} (full path)\r
51# ${d_path} Destination file directory (absolute path)\r
52# ${d_name} Destination file name without path\r
53# ${d_base} Destination file name without extension and path\r
54# ${d_ext} Destination file extension\r
55#\r
56# (+) Directory separator\r
57#\r
58\r
59## Macro\r
60# $(WORKSPACE) Workspace directory\r
61# $(OUTPUT_DIR) Directory for intermediate files for building a module\r
62# $(DEBUG_DIR) Directory for files used to debug a module\r
63# $(BUILD_DIR) All files for building a platform will be put in this directory\r
64# $(BIN_DIR) Common directory for executable files\r
65# $(FV_DIR) Directory to store flash image files\r
66# $(INC) Search path of current module\r
a388ec43 67# $(INC_LIST) A file containing search pathes of current module\r
07a756b9 68# $(LIBS) Static library files of current module\r
69# $(<tool>_FLAGS) Tools flags of current module\r
70# $(MODULE_NAME) Current module name\r
71# $(MODULE_TYPE) Current module type\r
72# $(ARCH) Architecture of current module\r
73# $(TOOLCHAIN) Toolchain used to build current module\r
74# $(TARGET) Target of current module (DEBUG/RELEASE)\r
75# $(<tool>) Path of tool\r
76# $(EDK_TOOLS_PATH) Path of build tools\r
a388ec43 77# $(<FILE_TYPES>) File list of each file type\r
07a756b9 78# (Note: The macro name is derived from file type name. For example,\r
a388ec43 79# C-Code-File will have C_CODE_FILES macro.)\r
80# $(<FILE_TYPES_LIST>) Macro point to a file containing list of files of a file type\r
81# (\r
82# Note: The macro and file name are derived from file type name.\r
a7d37687 83# For example, C-Code-File will have C_CODE_FILES_LIST macro pointing\r
a388ec43 84# to $(OUTPUT_DIR)/c_code_files.lst. The list file and macro name\r
85# will be generated only when this macro is used in command line.\r
86# This is intended to get over the long command line limitation.\r
87# )\r
07a756b9 88#\r
89# $(CP) copy command\r
90# $(MV) move command\r
91# $(RM) delete command\r
92# $(MD) create dir command\r
93# $(RD) remove dir command\r
94#\r
95\r
96## Reserved File-Type\r
97#\r
d78f8ac7 98# Don't change following names of file types and their associated files,\r
07a756b9 99# which are also used in tools' code\r
100#\r
101# C-Code-File\r
102# C-Header-File\r
103# Dynamic-Library-File\r
104# Static-Library-File\r
105# Visual-Form-Representation-File\r
106# Unicode-Text-File\r
107#\r
108\r
f285eb16 109[C-Code-File]\r
07a756b9 110 <InputFile>\r
111 ?.c\r
112 ?.C\r
113 ?.cc\r
114 ?.CC\r
115 ?.cpp\r
116 ?.Cpp\r
117 ?.CPP\r
f285eb16 118\r
119 <ExtraDependency>\r
23fdff82 120 $(MAKE_FILE)\r
07a756b9 121\r
122 <OutputFile>\r
123 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
124\r
125 <Command.MSFT, Command.INTEL>\r
126 "$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}\r
127\r
128 <Command.GCC>\r
129 "$(CC)" -o ${dst} $(CC_FLAGS) $(INC) ${src}\r
130\r
f285eb16 131[C-Header-File]\r
07a756b9 132 <InputFile>\r
133 *.h, *.H\r
134\r
135 <OutputFile>\r
07a756b9 136\r
137 <Command>\r
138\r
139\r
f285eb16 140[Assembly-Code-File.COMMON.COMMON]\r
07a756b9 141 <InputFile.MSFT, InputFile.INTEL>\r
f285eb16 142 ?.asm, ?.Asm, ?.ASM\r
07a756b9 143\r
144 <InputFile.GCC>\r
145 ?.S\r
f285eb16 146\r
147 <ExtraDependency>\r
23fdff82 148 $(MAKE_FILE)\r
07a756b9 149\r
150 <OutputFile>\r
151 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
152\r
153 <Command.MSFT, Command.INTEL>\r
154 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
155 Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
ffe084ee 156 "$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii\r
07a756b9 157\r
158 <Command.GCC>\r
159 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
160 Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
161 "$(ASM)" -o ${dst} $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii\r
162\r
f285eb16 163[Assembly-Code-File.COMMON.IPF]\r
07a756b9 164 <InputFile>\r
165 ?.s\r
f285eb16 166\r
167 <ExtraDependency>\r
23fdff82 168 $(MAKE_FILE)\r
07a756b9 169\r
170 <OutputFile>\r
171 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
172\r
173 <Command.MSFT, Command.INTEL>\r
174 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
175 Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
176 "$(ASM)" -o ${dst} $(ASM_FLAGS) ${d_path}(+)${s_base}.iii\r
177\r
f285eb16 178[Visual-Form-Representation-File]\r
07a756b9 179 <InputFile>\r
180 ?.vfr\r
181 ?.Vfr\r
182 ?.VFR\r
f285eb16 183\r
184 <ExtraDependency>\r
23fdff82 185 $(MAKE_FILE)\r
07a756b9 186\r
187 <OutputFile>\r
188 $(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c\r
189\r
190 <Command>\r
77696b61 191 -$(MD) $(OUTPUT_DIR)(+)${s_dir} > NUL 2>&1\r
6ff04b8e 192 "$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
07a756b9 193 Trim --vfr-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
77696b61 194 -$(MD) ${d_path} > NUL 2>&1\r
30962c77 195 "$(VFR)" $(VFR_FLAGS) --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
07a756b9 196\r
f285eb16 197[Object-File]\r
07a756b9 198 <InputFile>\r
199 *.obj\r
200 *.o\r
201\r
202 <OutputFile>\r
203 $(OUTPUT_DIR)(+)$(MODULE_NAME).lib\r
204\r
205 <Command.MSFT, Command.INTEL>\r
a7d37687 206 "$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} $(OBJECT_FILES)\r
07a756b9 207\r
208 <Command.GCC>\r
a7d37687 209 "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) $(OBJECT_FILES)\r
07a756b9 210\r
f285eb16 211[Static-Library-File]\r
212 <InputFile>\r
2eab98c1 213 *.lib\r
07a756b9 214\r
f285eb16 215 <ExtraDependency>\r
4bf47781 216 $(MAKE_FILE)\r
9ba67b5c 217\r
07a756b9 218 <OutputFile>\r
219 $(DEBUG_DIR)(+)$(MODULE_NAME).dll\r
220\r
221 <Command.MSFT, Command.INTEL>\r
a7d37687 222 "$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) $(STATIC_LIBRARY_FILES)\r
07a756b9 223\r
224 <Command.GCC>\r
94119947 225 "$(DLINK)" -o ${dst} -Map $(DEBUG_DIR)(+)$(MODULE_NAME).map $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -\) $(DLINK2_FLAGS)\r
a7d37687 226\r
227[Static-Library-File.USER_DEFINED]\r
228 <InputFile>\r
229 *.lib\r
230\r
231 <ExtraDependency>\r
232 $(MAKE_FILE)\r
233\r
234 <OutputFile>\r
235 $(DEBUG_DIR)(+)$(MODULE_NAME)\r
236\r
237 <Command.MSFT, Command.INTEL>\r
238 "$(DLINK)" $(DLINK_FLAGS) $(DLINK_SPATH) $(STATIC_LIBRARY_FILES)\r
239\r
240 <Command.GCC>\r
241 "$(DLINK)" $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(STATIC_LIBRARY_FILES) -\) $(DLINK2_FLAGS)\r
07a756b9 242\r
f285eb16 243[Dynamic-Library-File]\r
07a756b9 244 <InputFile>\r
245 ?.dll\r
246\r
247 <OutputFile>\r
248 $(DEBUG_DIR)(+)$(MODULE_NAME).efi\r
249\r
250 <Command>\r
251 GenFw -e $(MODULE_TYPE) -o ${dst} ${src}\r
252 $(CP) ${dst} $(OUTPUT_DIR)\r
253 $(CP) ${dst} $(BIN_DIR)\r
254 -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)\r
255\r
f285eb16 256[Dependency-Expression-File]\r
07a756b9 257 <InputFile>\r
258 ?.dxs, ?.Dxs, ?.DXS\r
259\r
260 <OutputFile>\r
261 $(OUTPUT_DIR)(+)$(MODULE_NAME).depex\r
262\r
263 <Command>\r
58ce61eb 264 "$(PP)" $(CC_FLAGS) $(APP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
265 Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
266 GenDepex -t $(MODULE_TYPE) -o ${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
07a756b9 267\r
f285eb16 268[Acpi-Source-Language-File]\r
07a756b9 269 <InputFile>\r
270 ?.asl, ?.Asl, ?.ASL\r
271\r
272 <OutputFile>\r
ffe084ee 273 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.aml\r
07a756b9 274\r
f285eb16 275 <ExtraDependency>\r
276 $(MAKE_FILE)\r
277\r
07a756b9 278 <Command.MSFT, Command.INTEL>\r
64cd21af
LG
279 Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i ${src}\r
280 "$(ASLPP)" $(ASLPP_FLAGS) $(INC) /I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
281 "$(ASL)" -p ${dst} $(ASL_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
07a756b9 282\r
c6094890 283 <Command.GCC>\r
284 Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i ${src}\r
285 "$(ASLPP)" $(ASLPP_FLAGS) $(INC) -I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
286 "$(ASL)" -p ${dst} $(ASL_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
287\r
f0373115
LG
288[C-Code-File.AcpiTable]\r
289 <InputFile>\r
290 ?.c\r
291\r
292 <OutputFile>\r
ffe084ee 293 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi\r
f0373115
LG
294\r
295 <ExtraDependency>\r
296 $(MAKE_FILE)\r
297\r
298 <Command.MSFT, Command.INTEL>\r
299 "$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}\r
300 "$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
301 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
302\r
c6094890 303 <Command.GCC>\r
304 "$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}\r
305 "$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
306 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
307\r
f285eb16 308[Acpi-Table-Code-File]\r
07a756b9 309 <InputFile>\r
f0373115 310 ?.aslc, ?.act\r
07a756b9 311\r
312 <OutputFile>\r
ffe084ee 313 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi\r
07a756b9 314\r
f285eb16 315 <ExtraDependency>\r
316 $(MAKE_FILE)\r
317\r
07a756b9 318 <Command.MSFT, Command.INTEL>\r
a1c949f3
LG
319 "$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}\r
320 "$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
07a756b9 321 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
322\r
c6094890 323 <Command.GCC>\r
324 "$(ASLCC)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}\r
325 "$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
326 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
327\r
f285eb16 328[Masm16-Code-File]\r
07a756b9 329 <InputFile>\r
330 ?.asm16, ?.Asm16, ?.ASM16\r
331\r
f285eb16 332 <ExtraDependency>\r
333 $(MAKE_FILE)\r
334\r
07a756b9 335 <OutputFile>\r
336 $(OUTPUT_DIR)(+)${s_base}.com\r
337\r
338 <Command.MSFT, Command.INTEL>\r
339 cd $(OUTPUT_DIR)(+)${s_dir}\r
340 "$(ASM)" /nologo /c /omf /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${src}\r
341 "$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,\r
342\r
f285eb16 343[Microcode-File]\r
07a756b9 344 <InputFile>\r
576b299a 345 ?.txt, ?.TXT, ?.Txt, ?.mut\r
07a756b9 346\r
347 <OutputFile>\r
348 $(OUTPUT_DIR)(+)${s_base}.mcb\r
349\r
350 <Command>\r
351 GenFw -o ${dst} -m ${src}\r
352\r
f285eb16 353[Microcode-Binary-File]\r
07a756b9 354 <InputFile>\r
355 *.mcb\r
356\r
357 <OutputFile>\r
358 $(OUTPUT_DIR)(+)$(MODULE_NAME).bin\r
359\r
360 <Command>\r
a7d37687 361 GenFw -o ${dst} -j $(MICROCODE_BINARY_FILES)\r
25ab7ab1 362 -$(CP) ${dst} $(BIN_DIR)\r
07a756b9 363\r
f285eb16 364[EFI-Image-File]\r
365 <InputFile>\r
366 ?.efi, ?.Efi, ?.EFI\r
367\r
368 <OutputFile>\r
369\r
370 <Command>\r
371\r
e1b4bd14
LG
372[Unicode-Text-File]\r
373 <InputFile>\r
374 *.uni, *.Uni, *.UNI\r
375\r
376 <OutputFile>\r
377 $(DEBUG_DIR)(+)AutoGen.c\r
378 $(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h\r
379\r
380 <Command>\r