2007-10-17 03:54:36 +02:00
|
|
|
#
|
2008-08-12 09:54:36 +02:00
|
|
|
# Copyright (c) 2007-2008, Intel Corporation
|
2007-10-17 03:54:36 +02:00
|
|
|
#
|
|
|
|
# All rights reserved. This program and the accompanying materials
|
|
|
|
# are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
# which accompanies this distribution. The full text of the license may be found at
|
|
|
|
# http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
#
|
|
|
|
# Filename: build_rule.template
|
|
|
|
#
|
|
|
|
|
|
|
|
## Syntax
|
|
|
|
#
|
|
|
|
# "*" is used to indicate that the source files will be processed at the same time.
|
|
|
|
# "?" is used to indicate that the source files will be processed one by one.
|
|
|
|
#
|
2008-08-12 09:54:36 +02:00
|
|
|
# "[" <File-Type>[.<Build-Type>][.<Arch>][, <File-Type>[.<Build-Type>][.<Arch>]] "]" <EOL>
|
2007-10-17 03:54:36 +02:00
|
|
|
# <InputFile[.<ToolChainFamily>]> <EOL>
|
2008-08-12 09:54:36 +02:00
|
|
|
# (?|*).<File-Extension> [(\n|,) (?|*).<File-Extension>]
|
2007-10-17 03:54:36 +02:00
|
|
|
#
|
|
|
|
# <OutputFile[.<ToolChainFamily>]> <EOL>
|
|
|
|
# <FileFullPath>
|
|
|
|
#
|
2008-08-12 09:54:36 +02:00
|
|
|
# <ExtraDependency>
|
|
|
|
# <FileFullPath>
|
|
|
|
#
|
2007-10-17 03:54:36 +02:00
|
|
|
# <Command[.<ToolChainFamily>]> <EOL>
|
|
|
|
# <Command1>
|
|
|
|
# [<Command2>]
|
|
|
|
#
|
2008-08-12 09:54:36 +02:00
|
|
|
# <Build-Type> is the MODULE_TYPE in EDK2 or COMPONENT_TYPE in EDK.
|
|
|
|
# Missing <InputFile> will cause an exception and break build.
|
|
|
|
# Missing <Command> will cause that related build target won't be generated but
|
|
|
|
# won't break build.
|
|
|
|
#
|
2007-10-17 03:54:36 +02:00
|
|
|
|
|
|
|
## Placeholders for string substitution
|
|
|
|
#
|
|
|
|
# ${src} Source file(s) to be built (full path)
|
|
|
|
# ${s_path} Source file directory (absolute path)
|
|
|
|
# ${s_dir} Source file relative directory within a module
|
|
|
|
# (Note: ${s_dir} is always equals to "." if source file is given in absolute path.)
|
|
|
|
# ${s_name} Source file name without path
|
|
|
|
# ${s_base} Source file name without extension and path
|
|
|
|
# ${s_ext} Source file extension
|
|
|
|
#
|
|
|
|
# ${dst} Destination file(s) built from ${src} (full path)
|
|
|
|
# ${d_path} Destination file directory (absolute path)
|
|
|
|
# ${d_name} Destination file name without path
|
|
|
|
# ${d_base} Destination file name without extension and path
|
|
|
|
# ${d_ext} Destination file extension
|
|
|
|
#
|
|
|
|
# (+) Directory separator
|
|
|
|
#
|
|
|
|
|
|
|
|
## Macro
|
|
|
|
# $(WORKSPACE) Workspace directory
|
|
|
|
# $(OUTPUT_DIR) Directory for intermediate files for building a module
|
|
|
|
# $(DEBUG_DIR) Directory for files used to debug a module
|
|
|
|
# $(BUILD_DIR) All files for building a platform will be put in this directory
|
|
|
|
# $(BIN_DIR) Common directory for executable files
|
|
|
|
# $(FV_DIR) Directory to store flash image files
|
|
|
|
# $(INC) Search path of current module
|
|
|
|
# $(LIBS) Static library files of current module
|
|
|
|
# $(<tool>_FLAGS) Tools flags of current module
|
|
|
|
# $(MODULE_NAME) Current module name
|
|
|
|
# $(MODULE_TYPE) Current module type
|
|
|
|
# $(ARCH) Architecture of current module
|
|
|
|
# $(TOOLCHAIN) Toolchain used to build current module
|
|
|
|
# $(TARGET) Target of current module (DEBUG/RELEASE)
|
|
|
|
# $(<tool>) Path of tool
|
|
|
|
# $(EDK_TOOLS_PATH) Path of build tools
|
|
|
|
# $(<FILE_TYPE_LIST>) File list of each file type
|
|
|
|
# (Note: The macro name is derived from file type name. For example,
|
|
|
|
# C-Code-File will have C_CODE_FILE_LIST macro.)
|
|
|
|
#
|
|
|
|
# $(CP) copy command
|
|
|
|
# $(MV) move command
|
|
|
|
# $(RM) delete command
|
|
|
|
# $(MD) create dir command
|
|
|
|
# $(RD) remove dir command
|
|
|
|
#
|
|
|
|
|
|
|
|
## Reserved File-Type
|
|
|
|
#
|
2007-12-25 10:17:00 +01:00
|
|
|
# Don't change following names of file types and their associated files,
|
2007-10-17 03:54:36 +02:00
|
|
|
# which are also used in tools' code
|
|
|
|
#
|
|
|
|
# C-Code-File
|
|
|
|
# C-Header-File
|
|
|
|
# Dynamic-Library-File
|
|
|
|
# Static-Library-File
|
|
|
|
# Visual-Form-Representation-File
|
|
|
|
# Unicode-Text-File
|
|
|
|
#
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[C-Code-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
?.c
|
|
|
|
?.C
|
|
|
|
?.cc
|
|
|
|
?.CC
|
|
|
|
?.cpp
|
|
|
|
?.Cpp
|
|
|
|
?.CPP
|
2008-08-12 09:54:36 +02:00
|
|
|
|
|
|
|
<ExtraDependency>
|
2008-06-05 09:36:19 +02:00
|
|
|
$(MAKE_FILE)
|
2007-10-17 03:54:36 +02:00
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
|
|
|
|
|
|
|
<Command.MSFT, Command.INTEL>
|
|
|
|
"$(CC)" /Fo${dst} $(CC_FLAGS) $(INC) ${src}
|
|
|
|
|
|
|
|
<Command.GCC>
|
|
|
|
"$(CC)" -o ${dst} $(CC_FLAGS) $(INC) ${src}
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[C-Header-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
*.h, *.H
|
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
|
|
|
|
<Command>
|
|
|
|
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Assembly-Code-File.COMMON.COMMON]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile.MSFT, InputFile.INTEL>
|
2008-08-12 09:54:36 +02:00
|
|
|
?.asm, ?.Asm, ?.ASM
|
2007-10-17 03:54:36 +02:00
|
|
|
|
|
|
|
<InputFile.GCC>
|
|
|
|
?.S
|
2008-08-12 09:54:36 +02:00
|
|
|
|
|
|
|
<ExtraDependency>
|
2008-06-05 09:36:19 +02:00
|
|
|
$(MAKE_FILE)
|
2007-10-17 03:54:36 +02:00
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
|
|
|
|
|
|
|
<Command.MSFT, Command.INTEL>
|
|
|
|
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
|
|
|
Trim --source-code --convert-hex -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
2008-09-10 08:51:00 +02:00
|
|
|
"$(ASM)" /Fo${dst} $(ASM_FLAGS) /I${s_path} $(INC) ${d_path}(+)${s_base}.iii
|
2007-10-17 03:54:36 +02:00
|
|
|
|
|
|
|
<Command.GCC>
|
|
|
|
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
|
|
|
Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
|
|
|
"$(ASM)" -o ${dst} $(ASM_FLAGS) $(INC) ${d_path}(+)${s_base}.iii
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Assembly-Code-File.COMMON.IPF]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
?.s
|
2008-08-12 09:54:36 +02:00
|
|
|
|
|
|
|
<ExtraDependency>
|
2008-06-05 09:36:19 +02:00
|
|
|
$(MAKE_FILE)
|
2007-10-17 03:54:36 +02:00
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
|
|
|
|
|
|
|
<Command.MSFT, Command.INTEL>
|
|
|
|
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
|
|
|
|
Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
|
|
|
|
"$(ASM)" -o ${dst} $(ASM_FLAGS) ${d_path}(+)${s_base}.iii
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Visual-Form-Representation-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
?.vfr
|
|
|
|
?.Vfr
|
|
|
|
?.VFR
|
2008-08-12 09:54:36 +02:00
|
|
|
|
|
|
|
<ExtraDependency>
|
2008-06-05 09:36:19 +02:00
|
|
|
$(MAKE_FILE)
|
2007-10-17 03:54:36 +02:00
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(DEBUG_DIR)(+)${s_dir}(+)${s_base}.c
|
|
|
|
|
|
|
|
<Command>
|
2008-11-21 20:09:26 +01:00
|
|
|
"$(VFRPP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
2007-10-17 03:54:36 +02:00
|
|
|
Trim --vfr-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
|
|
|
-mkdir ${d_path} > NUL 2>&1
|
2008-08-07 05:29:10 +02:00
|
|
|
"$(VFR)" $(VFR_FLAGS) --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
2007-10-17 03:54:36 +02:00
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Object-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
*.obj
|
|
|
|
*.o
|
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(OUTPUT_DIR)(+)$(MODULE_NAME).lib
|
|
|
|
|
|
|
|
<Command.MSFT, Command.INTEL>
|
|
|
|
"$(SLINK)" $(SLINK_FLAGS) /OUT:${dst} ${src}
|
|
|
|
|
|
|
|
<Command.GCC>
|
|
|
|
"$(SLINK)" -cr ${dst} $(SLINK_FLAGS) ${src}
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Static-Library-File]
|
|
|
|
<InputFile>
|
2007-10-17 03:54:36 +02:00
|
|
|
?.lib
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
<ExtraDependency>
|
2007-10-29 19:34:07 +01:00
|
|
|
$(LIBS)
|
2007-11-08 04:57:35 +01:00
|
|
|
$(MAKE_FILE)
|
2007-10-29 19:34:07 +01:00
|
|
|
|
2007-10-17 03:54:36 +02:00
|
|
|
<OutputFile>
|
|
|
|
$(DEBUG_DIR)(+)$(MODULE_NAME).dll
|
|
|
|
|
|
|
|
<Command.MSFT, Command.INTEL>
|
|
|
|
"$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) $(LIBS) ${src}
|
|
|
|
|
|
|
|
<Command.GCC>
|
2008-07-16 07:28:50 +02:00
|
|
|
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) ${src} -\) $(DLINK2_FLAGS)
|
2007-10-17 03:54:36 +02:00
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Dynamic-Library-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
?.dll
|
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(DEBUG_DIR)(+)$(MODULE_NAME).efi
|
|
|
|
|
|
|
|
<Command>
|
|
|
|
GenFw -e $(MODULE_TYPE) -o ${dst} ${src}
|
|
|
|
$(CP) ${dst} $(OUTPUT_DIR)
|
|
|
|
$(CP) ${dst} $(BIN_DIR)
|
|
|
|
-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Dependency-Expression-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
?.dxs, ?.Dxs, ?.DXS
|
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(OUTPUT_DIR)(+)$(MODULE_NAME).depex
|
|
|
|
|
|
|
|
<Command>
|
2007-12-22 17:58:04 +01:00
|
|
|
"$(PP)" $(CC_FLAGS) $(APP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
|
|
|
Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
|
|
|
|
GenDepex -t $(MODULE_TYPE) -o ${dst} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
2007-10-17 03:54:36 +02:00
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Acpi-Source-Language-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
?.asl, ?.Asl, ?.ASL
|
|
|
|
|
|
|
|
<OutputFile>
|
2008-09-10 08:51:00 +02:00
|
|
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.aml
|
2007-10-17 03:54:36 +02:00
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
<ExtraDependency>
|
|
|
|
$(MAKE_FILE)
|
|
|
|
|
2007-10-17 03:54:36 +02:00
|
|
|
<Command.MSFT, Command.INTEL>
|
2008-11-17 03:12:36 +01:00
|
|
|
Trim --asl-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i ${src}
|
|
|
|
"$(ASLPP)" $(ASLPP_FLAGS) $(INC) /I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
|
|
|
"$(ASL)" -p ${dst} $(ASL_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
|
2007-10-17 03:54:36 +02:00
|
|
|
|
2008-09-01 03:18:00 +02:00
|
|
|
[C-Code-File.AcpiTable]
|
|
|
|
<InputFile>
|
|
|
|
?.c
|
|
|
|
|
|
|
|
<OutputFile>
|
2008-09-10 08:51:00 +02:00
|
|
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi
|
2008-09-01 03:18:00 +02:00
|
|
|
|
|
|
|
<ExtraDependency>
|
|
|
|
$(MAKE_FILE)
|
|
|
|
|
|
|
|
<Command.MSFT, Command.INTEL>
|
|
|
|
"$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
|
|
|
|
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
|
|
|
GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Acpi-Table-Code-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
2008-09-01 03:18:00 +02:00
|
|
|
?.aslc, ?.act
|
2007-10-17 03:54:36 +02:00
|
|
|
|
|
|
|
<OutputFile>
|
2008-09-10 08:51:00 +02:00
|
|
|
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.acpi
|
2007-10-17 03:54:36 +02:00
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
<ExtraDependency>
|
|
|
|
$(MAKE_FILE)
|
|
|
|
|
2007-10-17 03:54:36 +02:00
|
|
|
<Command.MSFT, Command.INTEL>
|
2008-08-21 15:11:01 +02:00
|
|
|
"$(ASLCC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(ASLCC_FLAGS) $(INC) ${src}
|
|
|
|
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
|
2007-10-17 03:54:36 +02:00
|
|
|
GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Masm16-Code-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
?.asm16, ?.Asm16, ?.ASM16
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
<ExtraDependency>
|
|
|
|
$(MAKE_FILE)
|
|
|
|
|
2007-10-17 03:54:36 +02:00
|
|
|
<OutputFile>
|
|
|
|
$(OUTPUT_DIR)(+)${s_base}.com
|
|
|
|
|
|
|
|
<Command.MSFT, Command.INTEL>
|
|
|
|
cd $(OUTPUT_DIR)(+)${s_dir}
|
|
|
|
"$(ASM)" /nologo /c /omf /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${src}
|
|
|
|
"$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Microcode-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
2008-08-26 08:18:30 +02:00
|
|
|
?.txt, ?.TXT, ?.Txt, ?.mut
|
2007-10-17 03:54:36 +02:00
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(OUTPUT_DIR)(+)${s_base}.mcb
|
|
|
|
|
|
|
|
<Command>
|
|
|
|
GenFw -o ${dst} -m ${src}
|
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[Microcode-Binary-File]
|
2007-10-17 03:54:36 +02:00
|
|
|
<InputFile>
|
|
|
|
*.mcb
|
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(OUTPUT_DIR)(+)$(MODULE_NAME).bin
|
|
|
|
|
|
|
|
<Command>
|
|
|
|
GenFw -o ${dst} -j ${src}
|
2008-04-18 05:08:20 +02:00
|
|
|
-$(CP) ${dst} $(BIN_DIR)
|
2007-10-17 03:54:36 +02:00
|
|
|
|
2008-08-12 09:54:36 +02:00
|
|
|
[EFI-Image-File]
|
|
|
|
<InputFile>
|
|
|
|
?.efi, ?.Efi, ?.EFI
|
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
|
|
|
|
<Command>
|
|
|
|
|
2008-12-25 04:22:58 +01:00
|
|
|
[Unicode-Text-File]
|
|
|
|
<InputFile>
|
|
|
|
*.uni, *.Uni, *.UNI
|
|
|
|
|
|
|
|
<OutputFile>
|
|
|
|
$(DEBUG_DIR)(+)AutoGen.c
|
|
|
|
$(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h
|
|
|
|
|
|
|
|
<Command>
|