build_rule.template revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# Portions copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# This program and the accompanying materials
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# are licensed and made available under the terms and conditions of the BSD License
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# which accompanies this distribution. The full text of the license may be found at
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# "*" is used to indicate that the source files will be processed at the same time.
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# "?" is used to indicate that the source files will be processed one by one.
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# "[" <File-Type>[.<Build-Type>][.<Arch>][, <File-Type>[.<Build-Type>][.<Arch>]] "]" <EOL>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# <InputFile[.<ToolChainFamily>]> <EOL>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# (?|*).<File-Extension> [(\n|,) (?|*).<File-Extension>]
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# <OutputFile[.<ToolChainFamily>]> <EOL>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# <FileFullPath>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# <ExtraDependency>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# <FileFullPath>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# <Command[.<ToolChainFamily>]> <EOL>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# <Command1>
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# [<Command2>]
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# <Build-Type> is the MODULE_TYPE in EDK2 or COMPONENT_TYPE in EDK.
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# Missing <InputFile> will cause an exception and break build.
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# Missing <Command> will cause that related build target won't be generated but
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# won't break build.
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe## Placeholders for string substitution
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# ${src} Source file(s) to be built (full path)
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# ${s_path} Source file directory (absolute path)
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# ${s_dir} Source file relative directory within a module
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# (Note: ${s_dir} is always equals to "." if source file is given in absolute path.)
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# ${s_name} Source file name without path
56e85d89d42a6980f31b800266649efbed338da3wrowe# ${s_base} Source file name without extension and path
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# ${s_ext} Source file extension
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# ${dst} Destination file(s) built from ${src} (full path)
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# ${d_path} Destination file directory (absolute path)
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# ${d_name} Destination file name without path
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# ${d_base} Destination file name without extension and path
79464ef4c61ae6b1bb4de13decb4e4f9e43e2800wrowe# ${d_ext} Destination file extension
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# (+) Directory separator
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(WORKSPACE) Workspace directory
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(OUTPUT_DIR) Directory for intermediate files for building a module
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(DEBUG_DIR) Directory for files used to debug a module
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(BUILD_DIR) All files for building a platform will be put in this directory
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(BIN_DIR) Common directory for executable files
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(FV_DIR) Directory to store flash image files
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(INC) Search path of current module
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(INC_LIST) A file containing search pathes of current module
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(LIBS) Static library files of current module
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(<tool>_FLAGS) Tools flags of current module
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(MODULE_NAME) Current module name
e1ad80c048e29e968221817698529d73098f07a4wrowe# $(MODULE_TYPE) Current module type
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(MODULE_GUID) Current module guid
8c8173f49dd7122e10636b3d20ae841551bd0b43wrowe# $(ARCH) Architecture of current module
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(TOOLCHAIN) Toolchain used to build current module
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(TARGET) Target of current module (DEBUG/RELEASE)
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(<tool>) Path of tool
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(EDK_TOOLS_PATH) Path of build tools
79464ef4c61ae6b1bb4de13decb4e4f9e43e2800wrowe# $(<FILE_TYPES>) File list of each file type
79464ef4c61ae6b1bb4de13decb4e4f9e43e2800wrowe# (Note: The macro name is derived from file type name. For example,
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# C-Code-File will have C_CODE_FILES macro.)
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(<FILE_TYPES_LIST>) Macro point to a file containing list of files of a file type
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# Note: The macro and file name are derived from file type name.
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# For example, C-Code-File will have C_CODE_FILES_LIST macro pointing
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# to $(OUTPUT_DIR)/c_code_files.lst. The list file and macro name
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# will be generated only when this macro is used in command line.
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# This is intended to get over the long command line limitation.
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(CP) copy command
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(MV) move command
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(RM) delete command
8c8173f49dd7122e10636b3d20ae841551bd0b43wrowe# $(MD) create dir command
f4e4643c309e5b5da60e13f9a25984d54b307caawrowe# $(RD) remove dir command
"$(VFR)" $(VFR_FLAGS) --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_base}.i
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST) -\) $(DLINK2_FLAGS)
"$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) --via $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)
"$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) -filelist $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)
"$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) --via $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) $(DLINK_SPATH) -filelist $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)
# tool to convert Mach-O to PE/COFF
Trim --source-code -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
"$(ASLPP)" $(ASLPP_FLAGS) $(INC) /I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
Trim --source-code -l -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iiii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
"$(ASLPP)" $(ASLPP_FLAGS) $(INC) -I${s_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
"$(ASLDLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
"$(ASLDLINK)" -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(ASLDLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
"$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.efi
"$(ASM16)" /nologo /c /omf $(INC) /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${d_path}(+)${s_base}.iii
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj -\)
"$(SLINK)" $(SLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
otool -t $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.slib | hex2bin.py ${dst}
$(DEBUG_DIR)(+)AutoGen.c
$(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h
$(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk
$(OPTROM) -i $(PCI_DEVICE_ID) -f $(PCI_VENDOR_ID) -l $(PCI_CLASS_CODE) -r $(PCI_REVISION) -o $dst $(OPTROM_FLAGS) $src
$(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk
$(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h
"$(VFR)" $(VFR_FLAGS) --create-ifr-package --string-db $(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk --output-directory $(OUTPUT_DIR)(+)${s_dir} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
$(OUTPUT_DIR)(+)$(MODULE_NAME)hii.lib
$(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc
"$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiipackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
"$(RC)" /Fo${dst} $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc
"$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS)
"$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc ${dst}
GenFw -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --hiibinpackage $(HII_BINARY_PACKAGES)