]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Conf/build_rule.template
Remove unused PCH compiler option and unused build rule for uni file.
[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 # $(LIBS) Static library files of current module
68 # $(<tool>_FLAGS) Tools flags of current module
69 # $(MODULE_NAME) Current module name
70 # $(MODULE_TYPE) Current module type
71 # $(ARCH) Architecture of current module
72 # $(TOOLCHAIN) Toolchain used to build current module
73 # $(TARGET) Target of current module (DEBUG/RELEASE)
74 # $(<tool>) Path of tool
75 # $(EDK_TOOLS_PATH) Path of build tools
76 # $(<FILE_TYPE_LIST>) File list of each file type
77 # (Note: The macro name is derived from file type name. For example,
78 # C-Code-File will have C_CODE_FILE_LIST macro.)
79 #
80 # $(CP) copy command
81 # $(MV) move command
82 # $(RM) delete command
83 # $(MD) create dir command
84 # $(RD) remove dir command
85 #
86
87 ## Reserved File-Type
88 #
89 # Don't change following names of file types and their associated files,
90 # which are also used in tools' code
91 #
92 # C-Code-File
93 # C-Header-File
94 # Dynamic-Library-File
95 # Static-Library-File
96 # Visual-Form-Representation-File
97 # Unicode-Text-File
98 #
99
100 [C-Code-File]
101 <InputFile>
102 ?.c
103 ?.C
104 ?.cc
105 ?.CC
106 ?.cpp
107 ?.Cpp
108 ?.CPP
109
110 <ExtraDependency>
111 $(MAKE_FILE)
112
113 <OutputFile>
114 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
115
116 <Command.MSFT, Command.INTEL>
117 "$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}
118
119 <Command.GCC>
120 "$(CC)" -o ${dst} $(CC_FLAGS) $(INC) ${src}
121
122 [C-Header-File]
123 <InputFile>
124 *.h, *.H
125
126 <OutputFile>
127
128 <Command>
129
130
131 [Assembly-Code-File.COMMON.COMMON]
132 <InputFile.MSFT, InputFile.INTEL>
133 ?.asm, ?.Asm, ?.ASM
134
135 <InputFile.GCC>
136 ?.S
137
138 <ExtraDependency>
139 $(MAKE_FILE)
140
141 <OutputFile>
142 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
143
144 <Command.MSFT, Command.INTEL>
145 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
146 Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
147 "$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii
148
149 <Command.GCC>
150 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
151 Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
152 "$(ASM)" -o ${dst} $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
153
154 [Assembly-Code-File.COMMON.IPF]
155 <InputFile>
156 ?.s
157
158 <ExtraDependency>
159 $(MAKE_FILE)
160
161 <OutputFile>
162 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
163
164 <Command.MSFT, Command.INTEL>
165 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
166 Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
167 "$(ASM)" -o ${dst} $(ASM_FLAGS) ${d_path}(+)${s_base}.iii
168
169 [Visual-Form-Representation-File]
170 <InputFile>
171 ?.vfr
172 ?.Vfr
173 ?.VFR
174
175 <ExtraDependency>
176 $(MAKE_FILE)
177
178 <OutputFile>
179 $(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c
180
181 <Command>
182 "$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
183 Trim --vfr-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
184 -mkdir ${d_path} > NUL 2>&1
185 "$(VFR)" $(VFR_FLAGS) --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
186
187 [Object-File]
188 <InputFile>
189 *.obj
190 *.o
191
192 <OutputFile>
193 $(OUTPUT_DIR)(+)$(MODULE_NAME).lib
194
195 <Command.MSFT, Command.INTEL>
196 "$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} ${src}
197
198 <Command.GCC>
199 "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) ${src}
200
201 [Static-Library-File]
202 <InputFile>
203 ?.lib
204
205 <ExtraDependency>
206 $(LIBS)
207 $(MAKE_FILE)
208
209 <OutputFile>
210 $(DEBUG_DIR)(+)$(MODULE_NAME).dll
211
212 <Command.MSFT, Command.INTEL>
213 "$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) $(LIBS) ${src}
214
215 <Command.GCC>
216 "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) ${src} -\) $(DLINK2_FLAGS)
217
218 [Dynamic-Library-File]
219 <InputFile>
220 ?.dll
221
222 <OutputFile>
223 $(DEBUG_DIR)(+)$(MODULE_NAME).efi
224
225 <Command>
226 GenFw -e $(MODULE_TYPE) -o ${dst} ${src}
227 $(CP) ${dst} $(OUTPUT_DIR)
228 $(CP) ${dst} $(BIN_DIR)
229 -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
230
231 [Dependency-Expression-File]
232 <InputFile>
233 ?.dxs, ?.Dxs, ?.DXS
234
235 <OutputFile>
236 $(OUTPUT_DIR)(+)$(MODULE_NAME).depex
237
238 <Command>
239 "$(PP)" $(CC_FLAGS) $(APP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
240 Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
241 GenDepex -t $(MODULE_TYPE) -o ${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
242
243 [Acpi-Source-Language-File]
244 <InputFile>
245 ?.asl, ?.Asl, ?.ASL
246
247 <OutputFile>
248 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.aml
249
250 <ExtraDependency>
251 $(MAKE_FILE)
252
253 <Command.MSFT, Command.INTEL>
254 Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i ${src}
255 "$(ASLPP)" $(ASLPP_FLAGS) $(INC) /I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
256 "$(ASL)" -p ${dst} $(ASL_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
257
258 [C-Code-File.AcpiTable]
259 <InputFile>
260 ?.c
261
262 <OutputFile>
263 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi
264
265 <ExtraDependency>
266 $(MAKE_FILE)
267
268 <Command.MSFT, Command.INTEL>
269 "$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
270 "$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
271 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll
272
273 [Acpi-Table-Code-File]
274 <InputFile>
275 ?.aslc, ?.act
276
277 <OutputFile>
278 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi
279
280 <ExtraDependency>
281 $(MAKE_FILE)
282
283 <Command.MSFT, Command.INTEL>
284 "$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
285 "$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
286 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll
287
288 [Masm16-Code-File]
289 <InputFile>
290 ?.asm16, ?.Asm16, ?.ASM16
291
292 <ExtraDependency>
293 $(MAKE_FILE)
294
295 <OutputFile>
296 $(OUTPUT_DIR)(+)${s_base}.com
297
298 <Command.MSFT, Command.INTEL>
299 cd $(OUTPUT_DIR)(+)${s_dir}
300 "$(ASM)" /nologo /c /omf /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${src}
301 "$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,
302
303 [Microcode-File]
304 <InputFile>
305 ?.txt, ?.TXT, ?.Txt, ?.mut
306
307 <OutputFile>
308 $(OUTPUT_DIR)(+)${s_base}.mcb
309
310 <Command>
311 GenFw -o ${dst} -m ${src}
312
313 [Microcode-Binary-File]
314 <InputFile>
315 *.mcb
316
317 <OutputFile>
318 $(OUTPUT_DIR)(+)$(MODULE_NAME).bin
319
320 <Command>
321 GenFw -o ${dst} -j ${src}
322 -$(CP) ${dst} $(BIN_DIR)
323
324 [EFI-Image-File]
325 <InputFile>
326 ?.efi, ?.Efi, ?.EFI
327
328 <OutputFile>
329
330 <Command>
331