]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Conf/build_rule.template
updated WinNtSerialIoDxe driver not to create new child handle if RemainingDeviepath...
[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
3b6c90a1 130 "$(SYMRENAME)" $(SYMRENAME_FLAGS) ${dst}\r
07a756b9 131\r
f285eb16 132[C-Header-File]\r
07a756b9 133 <InputFile>\r
134 *.h, *.H\r
135\r
136 <OutputFile>\r
07a756b9 137\r
138 <Command>\r
139\r
140\r
f285eb16 141[Assembly-Code-File.COMMON.COMMON]\r
07a756b9 142 <InputFile.MSFT, InputFile.INTEL>\r
f285eb16 143 ?.asm, ?.Asm, ?.ASM\r
07a756b9 144\r
145 <InputFile.GCC>\r
3b6c90a1 146 ?.S, ?.s\r
f285eb16 147\r
148 <ExtraDependency>\r
23fdff82 149 $(MAKE_FILE)\r
07a756b9 150\r
151 <OutputFile>\r
152 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
153\r
154 <Command.MSFT, Command.INTEL>\r
155 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
156 Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
ffe084ee 157 "$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii\r
07a756b9 158\r
159 <Command.GCC>\r
160 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
161 Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
162 "$(ASM)" -o ${dst} $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii\r
163\r
f285eb16 164[Assembly-Code-File.COMMON.IPF]\r
07a756b9 165 <InputFile>\r
166 ?.s\r
f285eb16 167\r
168 <ExtraDependency>\r
23fdff82 169 $(MAKE_FILE)\r
07a756b9 170\r
171 <OutputFile>\r
172 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
173\r
174 <Command.MSFT, Command.INTEL>\r
175 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
176 Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
177 "$(ASM)" -o ${dst} $(ASM_FLAGS) ${d_path}(+)${s_base}.iii\r
178\r
f285eb16 179[Visual-Form-Representation-File]\r
07a756b9 180 <InputFile>\r
181 ?.vfr\r
182 ?.Vfr\r
183 ?.VFR\r
f285eb16 184\r
185 <ExtraDependency>\r
23fdff82 186 $(MAKE_FILE)\r
07a756b9 187\r
188 <OutputFile>\r
189 $(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c\r
190\r
191 <Command>\r
77696b61 192 -$(MD) $(OUTPUT_DIR)(+)${s_dir} > NUL 2>&1\r
6ff04b8e 193 "$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
07a756b9 194 Trim --vfr-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
77696b61 195 -$(MD) ${d_path} > NUL 2>&1\r
30962c77 196 "$(VFR)" $(VFR_FLAGS) --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
07a756b9 197\r
f285eb16 198[Object-File]\r
07a756b9 199 <InputFile>\r
200 *.obj\r
201 *.o\r
202\r
203 <OutputFile>\r
204 $(OUTPUT_DIR)(+)$(MODULE_NAME).lib\r
205\r
206 <Command.MSFT, Command.INTEL>\r
3b6c90a1 207 "$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} @$(OBJECT_FILES_LIST)\r
07a756b9 208\r
209 <Command.GCC>\r
c9c705a8 210 "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) @"$(OBJECT_FILES_LIST)"\r
07a756b9 211\r
f285eb16 212[Static-Library-File]\r
213 <InputFile>\r
2eab98c1 214 *.lib\r
07a756b9 215\r
f285eb16 216 <ExtraDependency>\r
4bf47781 217 $(MAKE_FILE)\r
9ba67b5c 218\r
07a756b9 219 <OutputFile>\r
220 $(DEBUG_DIR)(+)$(MODULE_NAME).dll\r
221\r
222 <Command.MSFT, Command.INTEL>\r
3b6c90a1 223 "$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST)\r
07a756b9 224\r
225 <Command.GCC>\r
c9c705a8 226 "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) @"$(STATIC_LIBRARY_FILES_LIST)" -\) $(DLINK2_FLAGS)\r
3b6c90a1 227 "$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst}\r
a7d37687 228\r
229[Static-Library-File.USER_DEFINED]\r
230 <InputFile>\r
231 *.lib\r
232\r
233 <ExtraDependency>\r
234 $(MAKE_FILE)\r
235\r
236 <OutputFile>\r
237 $(DEBUG_DIR)(+)$(MODULE_NAME)\r
238\r
239 <Command.MSFT, Command.INTEL>\r
3b6c90a1 240 "$(DLINK)" $(DLINK_FLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST)\r
a7d37687 241\r
242 <Command.GCC>\r
3b6c90a1 243 "$(DLINK)" $(DLINK_FLAGS) -\( $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) -\) $(DLINK2_FLAGS)\r
07a756b9 244\r
f285eb16 245[Dynamic-Library-File]\r
07a756b9 246 <InputFile>\r
247 ?.dll\r
248\r
249 <OutputFile>\r
250 $(DEBUG_DIR)(+)$(MODULE_NAME).efi\r
251\r
252 <Command>\r
253 GenFw -e $(MODULE_TYPE) -o ${dst} ${src}\r
254 $(CP) ${dst} $(OUTPUT_DIR)\r
255 $(CP) ${dst} $(BIN_DIR)\r
256 -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)\r
257\r
f285eb16 258[Dependency-Expression-File]\r
07a756b9 259 <InputFile>\r
260 ?.dxs, ?.Dxs, ?.DXS\r
261\r
262 <OutputFile>\r
263 $(OUTPUT_DIR)(+)$(MODULE_NAME).depex\r
264\r
265 <Command>\r
58ce61eb 266 "$(PP)" $(CC_FLAGS) $(APP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
267 Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
268 GenDepex -t $(MODULE_TYPE) -o ${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
07a756b9 269\r
f285eb16 270[Acpi-Source-Language-File]\r
07a756b9 271 <InputFile>\r
272 ?.asl, ?.Asl, ?.ASL\r
273\r
274 <OutputFile>\r
ffe084ee 275 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.aml\r
07a756b9 276\r
f285eb16 277 <ExtraDependency>\r
278 $(MAKE_FILE)\r
279\r
07a756b9 280 <Command.MSFT, Command.INTEL>\r
64cd21af
LG
281 Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i ${src}\r
282 "$(ASLPP)" $(ASLPP_FLAGS) $(INC) /I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
38d4998a 283 "$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
07a756b9 284\r
c6094890 285 <Command.GCC>\r
286 Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i ${src}\r
287 "$(ASLPP)" $(ASLPP_FLAGS) $(INC) -I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
38d4998a 288 "$(ASL)" $(ASL_FLAGS) $(ASL_OUTFLAGS)${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
c6094890 289\r
f0373115
LG
290[C-Code-File.AcpiTable]\r
291 <InputFile>\r
292 ?.c\r
293\r
294 <OutputFile>\r
ffe084ee 295 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi\r
f0373115
LG
296\r
297 <ExtraDependency>\r
298 $(MAKE_FILE)\r
299\r
300 <Command.MSFT, Command.INTEL>\r
301 "$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}\r
302 "$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
303 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
304\r
c6094890 305 <Command.GCC>\r
623471a3 306 "$(ASLCC)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}\r
307 "$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
c6094890 308 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
309\r
f285eb16 310[Acpi-Table-Code-File]\r
07a756b9 311 <InputFile>\r
f0373115 312 ?.aslc, ?.act\r
07a756b9 313\r
314 <OutputFile>\r
ffe084ee 315 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi\r
07a756b9 316\r
f285eb16 317 <ExtraDependency>\r
318 $(MAKE_FILE)\r
319\r
07a756b9 320 <Command.MSFT, Command.INTEL>\r
a1c949f3
LG
321 "$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}\r
322 "$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
07a756b9 323 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
324\r
c6094890 325 <Command.GCC>\r
326 "$(ASLCC)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}\r
327 "$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
328 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
329\r
f285eb16 330[Masm16-Code-File]\r
07a756b9 331 <InputFile>\r
332 ?.asm16, ?.Asm16, ?.ASM16\r
333\r
f285eb16 334 <ExtraDependency>\r
335 $(MAKE_FILE)\r
336\r
07a756b9 337 <OutputFile>\r
338 $(OUTPUT_DIR)(+)${s_base}.com\r
339\r
340 <Command.MSFT, Command.INTEL>\r
341 cd $(OUTPUT_DIR)(+)${s_dir}\r
342 "$(ASM)" /nologo /c /omf /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${src}\r
343 "$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,\r
344\r
f285eb16 345[Microcode-File]\r
07a756b9 346 <InputFile>\r
576b299a 347 ?.txt, ?.TXT, ?.Txt, ?.mut\r
07a756b9 348\r
349 <OutputFile>\r
350 $(OUTPUT_DIR)(+)${s_base}.mcb\r
351\r
352 <Command>\r
353 GenFw -o ${dst} -m ${src}\r
354\r
f285eb16 355[Microcode-Binary-File]\r
07a756b9 356 <InputFile>\r
357 *.mcb\r
358\r
359 <OutputFile>\r
360 $(OUTPUT_DIR)(+)$(MODULE_NAME).bin\r
361\r
362 <Command>\r
a7d37687 363 GenFw -o ${dst} -j $(MICROCODE_BINARY_FILES)\r
25ab7ab1 364 -$(CP) ${dst} $(BIN_DIR)\r
07a756b9 365\r
f285eb16 366[EFI-Image-File]\r
367 <InputFile>\r
368 ?.efi, ?.Efi, ?.EFI\r
369\r
370 <OutputFile>\r
371\r
372 <Command>\r
373\r
e1b4bd14
LG
374[Unicode-Text-File]\r
375 <InputFile>\r
376 *.uni, *.Uni, *.UNI\r
377\r
378 <OutputFile>\r
379 $(DEBUG_DIR)(+)AutoGen.c\r
380 $(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h\r
381\r
382 <Command>\r
15543340 383\r
384[Efi-Image.UEFI_OPTIONROM]\r
385 <InputFile>\r
386 ?.efi, ?.EFI, ?.Efi\r
387\r
388 <OutputFile>\r
389 $(BIN_DIR)(+)$(MODULE_NAME).rom\r
390\r
391 <Command>\r
de29c94a 392 $(OPTROM) -i $(PCI_DEVICE_ID) -f $(PCI_VENDOR_ID) -l $(PCI_CLASS_CODE) -r $(PCI_REVISION) -o $dst $(OPTROM_FLAGS) $src\r
15543340 393\r