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