]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - BaseTools/Conf/build_rule.template
Restoring $WORKSPACE/BaseTools location, as the plan is to deprecate
[mirror_edk2.git] / BaseTools / Conf / build_rule.template
... / ...
CommitLineData
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
81# Dont't change following names of file types and their associated files,\r
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
200 <InputFile>\r
201 ?.lib\r
202 $(LIBS)\r
203 $(MODULE_BUILD_DIR)\Makefile\r
204\r
205 <OutputFile>\r
206 $(DEBUG_DIR)(+)$(MODULE_NAME).dll\r
207\r
208 <Command.MSFT, Command.INTEL>\r
209 "$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) $(LIBS) ${src}\r
210\r
211 <Command.GCC>\r
212 "$(DLINK)" -o ${dst} $(DLINK_FLAGS) -( $(DLINK_SPATH) $(LIBS) ${src} -)\r
213\r
214[Build.Dynamic-Library-File]\r
215 <InputFile>\r
216 ?.dll\r
217\r
218 <OutputFile>\r
219 $(DEBUG_DIR)(+)$(MODULE_NAME).efi\r
220\r
221 <Command>\r
222 GenFw -e $(MODULE_TYPE) -o ${dst} ${src}\r
223 $(CP) ${dst} $(OUTPUT_DIR)\r
224 $(CP) ${dst} $(BIN_DIR)\r
225 -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)\r
226\r
227[Build.Dependency-Expression-File]\r
228 <InputFile>\r
229 ?.dxs, ?.Dxs, ?.DXS\r
230\r
231 <OutputFile>\r
232 $(OUTPUT_DIR)(+)$(MODULE_NAME).depex\r
233\r
234 <Command>\r
235# GenDepex -o ${dst} ${src}\r
236\r
237[Build.Acpi-Source-Language-File]\r
238 <InputFile>\r
239 ?.asl, ?.Asl, ?.ASL\r
240\r
241 <OutputFile>\r
242 $(OUTPUT_DIR)(+)${s_base}.aml\r
243\r
244 <Command.MSFT, Command.INTEL>\r
245 "$(PP)" $(APP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i\r
246 "$(ASL)" -p ${dst} ${d_path}(+)${s_base}.i\r
247\r
248[Build.Acpi-Table-Code-File]\r
249 <InputFile>\r
250 ?.aslc\r
251\r
252 <OutputFile>\r
253 $(OUTPUT_DIR)(+)${s_base}.acpi\r
254\r
255 <Command.MSFT, Command.INTEL>\r
256 "$(CC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(INC) ${src}\r
257 "$(DLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(SLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj\r
258 GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll\r
259\r
260[Build.Masm16-Code-File]\r
261 <InputFile>\r
262 ?.asm16, ?.Asm16, ?.ASM16\r
263\r
264 <OutputFile>\r
265 $(OUTPUT_DIR)(+)${s_base}.com\r
266\r
267 <Command.MSFT, Command.INTEL>\r
268 cd $(OUTPUT_DIR)(+)${s_dir}\r
269 "$(ASM)" /nologo /c /omf /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${src}\r
270 "$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,\r
271\r
272[Build.Microcode-File]\r
273 <InputFile>\r
274 ?.txt, ?.TXT, ?.Txt\r
275\r
276 <OutputFile>\r
277 $(OUTPUT_DIR)(+)${s_base}.mcb\r
278\r
279 <Command>\r
280 GenFw -o ${dst} -m ${src}\r
281\r
282[Build.Microcode-Binary-File]\r
283 <InputFile>\r
284 *.mcb\r
285\r
286 <OutputFile>\r
287 $(OUTPUT_DIR)(+)$(MODULE_NAME).bin\r
288\r
289 <Command>\r
290 GenFw -o ${dst} -j ${src}\r
291\r
292[Build.Unicode-Text-File]\r
293 <InputFile>\r
294 *.uni, *.Uni, *.UNI\r
295\r
296 <OutputFile>\r
297 $(DEBUG_DIR)(+)AutoGen.c\r
298 $(DEBUG_DIR)(+)AutoGen.h\r
299\r
300 <Command>\r
301\r