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