]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Conf/build_rule.template
Add "-l" to make VFR Compiler to generate .lst file to assist debug.
[mirror_edk2.git] / BaseTools / Conf / build_rule.template
1 #
2 # Copyright (c) 2007, 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 # "[" Build.<File-Type>[.<version>][, Build.<File-Type>[.<version>]] "]" <EOL>
21 # <InputFile[.<ToolChainFamily>]> <EOL>
22 # [File-Type =] (?|*).<File-Extension> [(\n|,|;) (?|*).<File-Extension>]
23 #
24 # <OutputFile[.<ToolChainFamily>]> <EOL>
25 # <FileFullPath>
26 #
27 # <Command[.<ToolChainFamily>]> <EOL>
28 # <Command1>
29 # [<Command2>]
30 #
31
32 ## Placeholders for string substitution
33 #
34 # ${src} Source file(s) to be built (full path)
35 # ${s_path} Source file directory (absolute path)
36 # ${s_dir} Source file relative directory within a module
37 # (Note: ${s_dir} is always equals to "." if source file is given in absolute path.)
38 # ${s_name} Source file name without path
39 # ${s_base} Source file name without extension and path
40 # ${s_ext} Source file extension
41 #
42 # ${dst} Destination file(s) built from ${src} (full path)
43 # ${d_path} Destination file directory (absolute path)
44 # ${d_name} Destination file name without path
45 # ${d_base} Destination file name without extension and path
46 # ${d_ext} Destination file extension
47 #
48 # (+) Directory separator
49 #
50
51 ## Macro
52 # $(WORKSPACE) Workspace directory
53 # $(OUTPUT_DIR) Directory for intermediate files for building a module
54 # $(DEBUG_DIR) Directory for files used to debug a module
55 # $(BUILD_DIR) All files for building a platform will be put in this directory
56 # $(BIN_DIR) Common directory for executable files
57 # $(FV_DIR) Directory to store flash image files
58 # $(INC) Search path of current module
59 # $(LIBS) Static library files of current module
60 # $(<tool>_FLAGS) Tools flags of current module
61 # $(MODULE_NAME) Current module name
62 # $(MODULE_TYPE) Current module type
63 # $(ARCH) Architecture of current module
64 # $(TOOLCHAIN) Toolchain used to build current module
65 # $(TARGET) Target of current module (DEBUG/RELEASE)
66 # $(<tool>) Path of tool
67 # $(EDK_TOOLS_PATH) Path of build tools
68 # $(<FILE_TYPE_LIST>) File list of each file type
69 # (Note: The macro name is derived from file type name. For example,
70 # C-Code-File will have C_CODE_FILE_LIST macro.)
71 #
72 # $(CP) copy command
73 # $(MV) move command
74 # $(RM) delete command
75 # $(MD) create dir command
76 # $(RD) remove dir command
77 #
78
79 ## Reserved File-Type
80 #
81 # Don't change following names of file types and their associated files,
82 # which are also used in tools' code
83 #
84 # C-Code-File
85 # C-Header-File
86 # Dynamic-Library-File
87 # Static-Library-File
88 # Visual-Form-Representation-File
89 # Unicode-Text-File
90 #
91
92 [Build.C-Code-File]
93 <InputFile>
94 ?.c
95 ?.C
96 ?.cc
97 ?.CC
98 ?.cpp
99 ?.Cpp
100 ?.CPP
101 $(MAKE_FILE)
102
103 <OutputFile>
104 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
105
106 <Command.MSFT, Command.INTEL>
107 "$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}
108
109 <Command.GCC>
110 "$(CC)" -o ${dst} $(CC_FLAGS) $(INC) ${src}
111
112 [Build.C-Header-File]
113 <InputFile>
114 *.h, *.H
115
116 <OutputFile>
117 $(OUTPUT_DIR)(+)$(MODULE_NAME).gch
118 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
119
120 <Command>
121
122
123 [Build.Assembly-Code-File]
124 <InputFile.MSFT, InputFile.INTEL>
125 Assembly-Code-File = ?.asm, ?.Asm, ?.ASM
126 $(MAKE_FILE)
127
128 <InputFile.GCC>
129 ?.S
130 $(MAKE_FILE)
131
132 <OutputFile>
133 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
134
135 <Command.MSFT, Command.INTEL>
136 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
137 Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
138 "$(ASM)" /Fo${dst} $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
139
140 <Command.GCC>
141 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
142 Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
143 "$(ASM)" -o ${dst} $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
144
145 [Build.Iasm-Code-File]
146 <InputFile>
147 ?.s
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 -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
156 "$(ASM)" -o ${dst} $(ASM_FLAGS) ${d_path}(+)${s_base}.iii
157
158 [Build.Visual-Form-Representation-File]
159 <InputFile>
160 ?.vfr
161 ?.Vfr
162 ?.VFR
163 $(MAKE_FILE)
164
165 <OutputFile>
166 $(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c
167
168 <Command>
169 "$(PP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
170 Trim --vfr-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
171 -mkdir ${d_path} > NUL 2>&1
172 VfrCompile -l --no-pre-processing --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
173
174 [Build.Object-File]
175 <InputFile>
176 *.obj
177 *.o
178
179 <OutputFile>
180 $(OUTPUT_DIR)(+)$(MODULE_NAME).lib
181
182 <Command.MSFT, Command.INTEL>
183 "$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} ${src}
184
185 <Command.GCC>
186 "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) ${src}
187
188 #[Build.Object-File, Build.Static-Library-File]
189 #BUILD_VERSION = 0x00010000
190 #
191 # <InputFile>
192 # Object-File = *.obj
193 # Static-Library-File = *.lib, *.a
194 #
195 # <OutputFile>
196 # $(OUTPUT_DIR)(+)$(MODULE_NAME).lib
197 #
198 # <Command.MSFT>
199 # "$(SLINK)" /OUT:${dst} $(SLINK_FLAGS) ${src}
200 #
201 # <Command.GCC>
202 # "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) ${src1} -( ${src2} -)
203 #
204 [Build.Static-Library-File]
205 <InputFile.MSFT, InputFile.Intel>
206 ?.lib
207 $(LIBS)
208 $(MAKE_FILE)
209
210 <InputFile.GCC>
211 ?.lib
212 $(LIBS)
213 $(MAKE_FILE)
214
215 <OutputFile>
216 $(DEBUG_DIR)(+)$(MODULE_NAME).dll
217
218 <Command.MSFT, Command.INTEL>
219 "$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) $(LIBS) ${src}
220
221 <Command.GCC>
222 "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) ${src} -\)
223
224 [Build.Dynamic-Library-File]
225 <InputFile>
226 ?.dll
227
228 <OutputFile>
229 $(DEBUG_DIR)(+)$(MODULE_NAME).efi
230
231 <Command>
232 GenFw -e $(MODULE_TYPE) -o ${dst} ${src}
233 $(CP) ${dst} $(OUTPUT_DIR)
234 $(CP) ${dst} $(BIN_DIR)
235 -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
236
237 [Build.Dependency-Expression-File]
238 <InputFile>
239 ?.dxs, ?.Dxs, ?.DXS
240
241 <OutputFile>
242 $(OUTPUT_DIR)(+)$(MODULE_NAME).depex
243
244 <Command>
245 "$(PP)" $(CC_FLAGS) $(APP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
246 Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
247 GenDepex -t $(MODULE_TYPE) -o ${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
248
249 [Build.Acpi-Source-Language-File]
250 <InputFile>
251 ?.asl, ?.Asl, ?.ASL
252
253 <OutputFile>
254 $(OUTPUT_DIR)(+)${s_base}.aml
255
256 <Command.MSFT, Command.INTEL>
257 "$(PP)" $(APP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
258 "$(ASL)" -p ${dst} $(ASL_FLAGS) ${d_path}(+)${s_base}.i
259
260 [Build.Acpi-Table-Code-File]
261 <InputFile>
262 ?.aslc
263
264 <OutputFile>
265 $(OUTPUT_DIR)(+)${s_base}.acpi
266
267 <Command.MSFT, Command.INTEL>
268 "$(CC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(INC) ${src}
269 "$(DLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(SLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
270 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll
271
272 [Build.Masm16-Code-File]
273 <InputFile>
274 ?.asm16, ?.Asm16, ?.ASM16
275
276 <OutputFile>
277 $(OUTPUT_DIR)(+)${s_base}.com
278
279 <Command.MSFT, Command.INTEL>
280 cd $(OUTPUT_DIR)(+)${s_dir}
281 "$(ASM)" /nologo /c /omf /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${src}
282 "$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,
283
284 [Build.Microcode-File]
285 <InputFile>
286 ?.txt, ?.TXT, ?.Txt
287
288 <OutputFile>
289 $(OUTPUT_DIR)(+)${s_base}.mcb
290
291 <Command>
292 GenFw -o ${dst} -m ${src}
293
294 [Build.Microcode-Binary-File]
295 <InputFile>
296 *.mcb
297
298 <OutputFile>
299 $(OUTPUT_DIR)(+)$(MODULE_NAME).bin
300
301 <Command>
302 GenFw -o ${dst} -j ${src}
303 -$(CP) ${dst} $(BIN_DIR)
304
305 [Build.Unicode-Text-File]
306 <InputFile>
307 *.uni, *.Uni, *.UNI
308
309 <OutputFile>
310 $(DEBUG_DIR)(+)AutoGen.c
311 $(DEBUG_DIR)(+)AutoGen.h
312
313 <Command>
314