Skip to content

Commit

Permalink
Enhanced the build_rule format and merged updates from edk2 trunk
Browse files Browse the repository at this point in the history
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1301 7335b38e-4728-0410-8992-fb3ffe349368
  • Loading branch information
jwang36 committed Aug 12, 2008
1 parent 8a5eb10 commit 63a826e
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 58 deletions.
101 changes: 56 additions & 45 deletions Conf/build_rule.template
@@ -1,5 +1,5 @@
#
# Copyright (c) 2007, Intel Corporation
# Copyright (c) 2007-2008, Intel Corporation
#
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
Expand All @@ -17,17 +17,25 @@
# "*" 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.
#
# "[" Build.<File-Type>[.<version>][, Build.<File-Type>[.<version>]] "]" <EOL>
# "[" <File-Type>[.<Build-Type>][.<Arch>][, <File-Type>[.<Build-Type>][.<Arch>]] "]" <EOL>
# <InputFile[.<ToolChainFamily>]> <EOL>
# [File-Type =] (?|*).<File-Extension> [(\n|,|;) (?|*).<File-Extension>]
# (?|*).<File-Extension> [(\n|,) (?|*).<File-Extension>]
#
# <OutputFile[.<ToolChainFamily>]> <EOL>
# <FileFullPath>
#
# <ExtraDependency>
# <FileFullPath>
#
# <Command[.<ToolChainFamily>]> <EOL>
# <Command1>
# [<Command2>]
#
# <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.
#

## Placeholders for string substitution
#
Expand Down Expand Up @@ -89,7 +97,7 @@
# Unicode-Text-File
#

[Build.C-Code-File]
[C-Code-File]
<InputFile>
?.c
?.C
Expand All @@ -98,6 +106,8 @@
?.cpp
?.Cpp
?.CPP

<ExtraDependency>
$(MAKE_FILE)

<OutputFile>
Expand All @@ -109,24 +119,23 @@
<Command.GCC>
"$(CC)" -o ${dst} $(CC_FLAGS) $(INC) ${src}

[Build.C-Header-File]
[C-Header-File]
<InputFile>
*.h, *.H

<OutputFile>
$(OUTPUT_DIR)(+)$(MODULE_NAME).gch
$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj

<Command>


[Build.Assembly-Code-File]
[Assembly-Code-File.COMMON.COMMON]
<InputFile.MSFT, InputFile.INTEL>
Assembly-Code-File = ?.asm, ?.Asm, ?.ASM
$(MAKE_FILE)
?.asm, ?.Asm, ?.ASM

<InputFile.GCC>
?.S

<ExtraDependency>
$(MAKE_FILE)

<OutputFile>
Expand All @@ -142,9 +151,11 @@
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

[Build.Iasm-Code-File]
[Assembly-Code-File.COMMON.IPF]
<InputFile>
?.s

<ExtraDependency>
$(MAKE_FILE)

<OutputFile>
Expand All @@ -155,11 +166,13 @@
Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
"$(ASM)" -o ${dst} $(ASM_FLAGS) ${d_path}(+)${s_base}.iii

[Build.Visual-Form-Representation-File]
[Visual-Form-Representation-File]
<InputFile>
?.vfr
?.Vfr
?.VFR

<ExtraDependency>
$(MAKE_FILE)

<OutputFile>
Expand All @@ -169,9 +182,9 @@
"$(PP)" $(VFRPP_FLAGS) $(INC) ${src} > $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
Trim --vfr-file -o $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.i
-mkdir ${d_path} > NUL 2>&1
VfrCompile -l --no-pre-processing --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii
"$(VFR)" $(VFR_FLAGS) --output-directory ${d_path} $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.iii

[Build.Object-File]
[Object-File]
<InputFile>
*.obj
*.o
Expand All @@ -185,30 +198,11 @@
<Command.GCC>
"$(SLINK)" -cr ${dst} $(SLINK_FLAGS) ${src}

#[Build.Object-File, Build.Static-Library-File]
#BUILD_VERSION = 0x00010000
#
# <InputFile>
# Object-File = *.obj
# Static-Library-File = *.lib, *.a
#
# <OutputFile>
# $(OUTPUT_DIR)(+)$(MODULE_NAME).lib
#
# <Command.MSFT>
# "$(SLINK)" /OUT:${dst} $(SLINK_FLAGS) ${src}
#
# <Command.GCC>
# "$(SLINK)" -cr ${dst} $(SLINK_FLAGS) ${src1} -( ${src2} -)
#
[Build.Static-Library-File]
<InputFile.MSFT, InputFile.Intel>
[Static-Library-File]
<InputFile>
?.lib
$(LIBS)
$(MAKE_FILE)

<InputFile.GCC>
?.lib
<ExtraDependency>
$(LIBS)
$(MAKE_FILE)

Expand All @@ -219,9 +213,9 @@
"$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_SPATH) $(LIBS) ${src}

<Command.GCC>
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) ${src} -\)
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) -\( $(DLINK_SPATH) $(LIBS) ${src} -\) $(DLINK2_FLAGS)

[Build.Dynamic-Library-File]
[Dynamic-Library-File]
<InputFile>
?.dll

Expand All @@ -234,7 +228,7 @@
$(CP) ${dst} $(BIN_DIR)
-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)

[Build.Dependency-Expression-File]
[Dependency-Expression-File]
<InputFile>
?.dxs, ?.Dxs, ?.DXS

Expand All @@ -246,33 +240,42 @@
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

[Build.Acpi-Source-Language-File]
[Acpi-Source-Language-File]
<InputFile>
?.asl, ?.Asl, ?.ASL

<OutputFile>
$(OUTPUT_DIR)(+)${s_base}.aml

<ExtraDependency>
$(MAKE_FILE)

<Command.MSFT, Command.INTEL>
"$(PP)" $(APP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
"$(ASL)" -p ${dst} $(ASL_FLAGS) ${d_path}(+)${s_base}.i

[Build.Acpi-Table-Code-File]
[Acpi-Table-Code-File]
<InputFile>
?.aslc

<OutputFile>
$(OUTPUT_DIR)(+)${s_base}.acpi

<ExtraDependency>
$(MAKE_FILE)

<Command.MSFT, Command.INTEL>
"$(CC)" /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj $(CC_FLAGS) $(INC) ${src}
"$(DLINK)" /OUT:$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll $(SLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj
GenFw -o ${dst} -c $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dll

[Build.Masm16-Code-File]
[Masm16-Code-File]
<InputFile>
?.asm16, ?.Asm16, ?.ASM16

<ExtraDependency>
$(MAKE_FILE)

<OutputFile>
$(OUTPUT_DIR)(+)${s_base}.com

Expand All @@ -281,7 +284,7 @@
"$(ASM)" /nologo /c /omf /Fo$(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj ${src}
"$(ASMLINK)" $(ASMLINK_FLAGS) $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.obj,${dst},,,,

[Build.Microcode-File]
[Microcode-File]
<InputFile>
?.txt, ?.TXT, ?.Txt

Expand All @@ -291,7 +294,7 @@
<Command>
GenFw -o ${dst} -m ${src}

[Build.Microcode-Binary-File]
[Microcode-Binary-File]
<InputFile>
*.mcb

Expand All @@ -302,7 +305,7 @@
GenFw -o ${dst} -j ${src}
-$(CP) ${dst} $(BIN_DIR)

[Build.Unicode-Text-File]
[Unicode-Text-File]
<InputFile>
*.uni, *.Uni, *.UNI

Expand All @@ -312,3 +315,11 @@

<Command>

[EFI-Image-File]
<InputFile>
?.efi, ?.Efi, ?.EFI

<OutputFile>

<Command>

0 comments on commit 63a826e

Please sign in to comment.