]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Conf/build_rule.template
Fixed typos (PVCS tracker 749)
[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
101\r
102 <OutputFile>\r
103 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
104\r
105 <Command.MSFT, Command.INTEL>\r
106 "$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}\r
107\r
108 <Command.GCC>\r
109 "$(CC)" -o ${dst} $(CC_FLAGS) $(INC) ${src}\r
110\r
111[Build.C-Header-File]\r
112 <InputFile>\r
113 *.h, *.H\r
114\r
115 <OutputFile>\r
116 $(OUTPUT_DIR)(+)$(MODULE_NAME).gch\r
117 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
118\r
119 <Command>\r
120\r
121\r
122[Build.Assembly-Code-File]\r
123 <InputFile.MSFT, InputFile.INTEL>\r
124 Assembly-Code-File = ?.asm, ?.Asm, ?.ASM\r
125\r
126 <InputFile.GCC>\r
127 ?.S\r
128\r
129 <OutputFile>\r
130 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
131\r
132 <Command.MSFT, Command.INTEL>\r
133 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
134 Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
135 "$(ASM)" /Fo${dst} $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii\r
136\r
137 <Command.GCC>\r
138 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
139 Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
140 "$(ASM)" -o ${dst} $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii\r
141\r
142[Build.Iasm-Code-File]\r
143 <InputFile>\r
144 ?.s\r
145\r
146 <OutputFile>\r
147 $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
148\r
149 <Command.MSFT, Command.INTEL>\r
150 "$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
151 Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i\r
152 "$(ASM)" -o ${dst} $(ASM_FLAGS) ${d_path}(+)${s_base}.iii\r
153\r
154[Build.Visual-Form-Representation-File]\r
155 <InputFile>\r
156 ?.vfr\r
157 ?.Vfr\r
158 ?.VFR\r
159\r
160 <OutputFile>\r
161 $(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c\r
162\r
163 <Command>\r
164 "$(PP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
165 Trim --vfr-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
166 -mkdir ${d_path} > NUL 2>&1\r
167 VfrCompile -od ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
168\r
169[Build.Object-File]\r
170 <InputFile>\r
171 *.obj\r
172 *.o\r
173\r
174 <OutputFile>\r
175 $(OUTPUT_DIR)(+)$(MODULE_NAME).lib\r
176\r
177 <Command.MSFT, Command.INTEL>\r
178 "$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} ${src}\r
179\r
180 <Command.GCC>\r
181 "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) ${src}\r
182\r
183#[Build.Object-File, Build.Static-Library-File]\r
184#BUILD_VERSION = 0x00010000\r
185#\r
186# <InputFile>\r
187# Object-File = *.obj\r
188# Static-Library-File = *.lib, *.a\r
189#\r
190# <OutputFile>\r
191# $(OUTPUT_DIR)(+)$(MODULE_NAME).lib\r
192#\r
193# <Command.MSFT>\r
194# "$(SLINK)" /OUT:${dst} $(SLINK_FLAGS) ${src}\r
195#\r
196# <Command.GCC>\r
197# "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) ${src1} -( ${src2} -)\r
198#\r
199[Build.Static-Library-File]\r
9ba67b5c 200 <InputFile.MSFT, InputFile.Intel>\r
07a756b9 201 ?.lib\r
202 $(LIBS)\r
4bf47781 203 $(MAKE_FILE)\r
07a756b9 204\r
9ba67b5c 205 <InputFile.GCC>\r
206 ?.lib\r
207 $(LIBS)\r
4bf47781 208 $(MAKE_FILE)\r
9ba67b5c 209\r
07a756b9 210 <OutputFile>\r
211 $(DEBUG_DIR)(+)$(MODULE_NAME).dll\r
212\r
213 <Command.MSFT, Command.INTEL>\r
214 "$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) $(LIBS) ${src}\r
215\r
216 <Command.GCC>\r
9ba67b5c 217 "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) ${src} -\)\r
07a756b9 218\r
219[Build.Dynamic-Library-File]\r
220 <InputFile>\r
221 ?.dll\r
222\r
223 <OutputFile>\r
224 $(DEBUG_DIR)(+)$(MODULE_NAME).efi\r
225\r
226 <Command>\r
227 GenFw -e $(MODULE_TYPE) -o ${dst} ${src}\r
228 $(CP) ${dst} $(OUTPUT_DIR)\r
229 $(CP) ${dst} $(BIN_DIR)\r
230 -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)\r
231\r
232[Build.Dependency-Expression-File]\r
233 <InputFile>\r
234 ?.dxs, ?.Dxs, ?.DXS\r
235\r
236 <OutputFile>\r
237 $(OUTPUT_DIR)(+)$(MODULE_NAME).depex\r
238\r
239 <Command>\r
58ce61eb 240 "$(PP)" $(CC_FLAGS) $(APP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
241 Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i\r
242 GenDepex -t $(MODULE_TYPE) -o ${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii\r
07a756b9 243\r
244[Build.Acpi-Source-Language-File]\r
245 <InputFile>\r
246 ?.asl, ?.Asl, ?.ASL\r
247\r
248 <OutputFile>\r
249 $(OUTPUT_DIR)(+)${s_base}.aml\r
250\r
251 <Command.MSFT, Command.INTEL>\r
252 "$(PP)" $(APP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
253 "$(ASL)" -p ${dst} ${d_path}(+)${s_base}.i\r
254\r
255[Build.Acpi-Table-Code-File]\r
256 <InputFile>\r
257 ?.aslc\r
258\r
259 <OutputFile>\r
260 $(OUTPUT_DIR)(+)${s_base}.acpi\r
261\r
262 <Command.MSFT, Command.INTEL>\r
263 "$(CC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(INC) ${src}\r
264 "$(DLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(SLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
265 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
266\r
267[Build.Masm16-Code-File]\r
268 <InputFile>\r
269 ?.asm16, ?.Asm16, ?.ASM16\r
270\r
271 <OutputFile>\r
272 $(OUTPUT_DIR)(+)${s_base}.com\r
273\r
274 <Command.MSFT, Command.INTEL>\r
275 cd $(OUTPUT_DIR)(+)${s_dir}\r
276 "$(ASM)" /nologo /c /omf /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${src}\r
277 "$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,\r
278\r
279[Build.Microcode-File]\r
280 <InputFile>\r
281 ?.txt, ?.TXT, ?.Txt\r
282\r
283 <OutputFile>\r
284 $(OUTPUT_DIR)(+)${s_base}.mcb\r
285\r
286 <Command>\r
287 GenFw -o ${dst} -m ${src}\r
288\r
289[Build.Microcode-Binary-File]\r
290 <InputFile>\r
291 *.mcb\r
292\r
293 <OutputFile>\r
294 $(OUTPUT_DIR)(+)$(MODULE_NAME).bin\r
295\r
296 <Command>\r
297 GenFw -o ${dst} -j ${src}\r
298\r
299[Build.Unicode-Text-File]\r
300 <InputFile>\r
301 *.uni, *.Uni, *.UNI\r
302\r
303 <OutputFile>\r
304 $(DEBUG_DIR)(+)AutoGen.c\r
305 $(DEBUG_DIR)(+)AutoGen.h\r
306\r
307 <Command>\r
308\r