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