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