diff options
author | Martin Roth <martinroth@google.com> | 2015-12-11 11:40:06 -0700 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2015-12-17 18:59:56 +0100 |
commit | fdaf9cca3663423453e3f1988832a6e267a024b6 (patch) | |
tree | 2202c05ce9a6ed9bff7398916747b7a6feb2104f | |
parent | ffcd9393a41e20883c219a2f47a1510aef82dcd4 (diff) | |
download | coreboot-fdaf9cca3663423453e3f1988832a6e267a024b6.tar.xz |
Makefile.inc: Document extract_nth and the fields it extracts
Change-Id: I0b5cffff95aca0ea0d6302b436797dada1850ba0
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/12713
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r-- | Makefile.inc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile.inc b/Makefile.inc index 603be00893..976280cb13 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -600,6 +600,33 @@ $(objcbfs)/%.elf: $(objcbfs)/%.debug # Build the final rom image ########################################################################### +# extract_nth - Return a subsection of the $file string +# +# the input string looks like this: +# ./build/cbfs/fallback/romstage.elf|fallback/romstage|stage|none||64|--xip*-S*.car.data*-P*0x10000 +# +# Sections: +# 1 - Path and name of file [FILENAME: Added to cbfs-files-y list variable] +# 2 - Name of file in cbfs [$(FILENAME)-file] +# 3 - File type: [$(FILENAME)-type] +# bootblock, cbfs header, stage, payload, optionrom, bootsplash, raw, vsa, +# mbi, microcode, fsp, mrc, cmos_default, cmos_layout, spd, mrc_cache, +# mma, efi, deleted, null +# 4 - Compression type [$(FILENAME)-compression] +# none, LZMA +# 5 - Base address [$(FILANAME)-position] +# 6 - Alignment [$(FILENAME)-align] +# 7 - cbfstool flags [$(FILENAME)-options] +# +# Input: +# $(1) = Section to extract +# $(2) = Input string +# +# Steps: +# 1) replace all '|' characters with the sequence '- -' within the full string, prepended and appended with the character '-' +# 2) extract the specified section from the string - this gets us the section surrounded by '-' characters +# 3) remove the leading and trailing '-' characters +# 4) replace all '*' characters with spaces extract_nth=$(subst *,$(spc),$(patsubst -%-,%,$(word $(1), $(subst |,- -,-$(2)-)))) cbfs-add-cmd = \ |