2022-10-29 06:38:44 +02:00
|
|
|
## SPDX-License-Identifier: GPL-2.0-only
|
2017-01-11 15:26:58 +01:00
|
|
|
compressionobj :=
|
|
|
|
compressionobj += compress.o
|
|
|
|
# LZ4
|
|
|
|
compressionobj += lz4.o
|
|
|
|
compressionobj += lz4hc.o
|
|
|
|
compressionobj += lz4frame.o
|
|
|
|
compressionobj += xxhash.o
|
|
|
|
compressionobj += lz4_wrapper.o
|
|
|
|
# LZMA
|
|
|
|
compressionobj += lzma.o
|
|
|
|
compressionobj += LzFind.o
|
|
|
|
compressionobj += LzmaDec.o
|
|
|
|
compressionobj += LzmaEnc.o
|
|
|
|
|
2009-08-12 17:00:51 +02:00
|
|
|
cbfsobj :=
|
2012-10-30 22:02:45 +01:00
|
|
|
cbfsobj += cbfstool.o
|
2009-09-14 15:29:27 +02:00
|
|
|
cbfsobj += common.o
|
2013-01-28 18:56:17 +01:00
|
|
|
cbfsobj += cbfs_image.o
|
2009-09-14 15:29:27 +02:00
|
|
|
cbfsobj += cbfs-mkstage.o
|
|
|
|
cbfsobj += cbfs-mkpayload.o
|
2013-12-30 22:16:18 +01:00
|
|
|
cbfsobj += elfheaders.o
|
2015-09-16 00:00:23 +02:00
|
|
|
cbfsobj += rmodule.o
|
2013-12-03 20:13:35 +01:00
|
|
|
cbfsobj += xdr.o
|
cbfstool: Restructure around support for reading/writing portions of files
The buffer API that cbfstool uses to read and write files only directly supports
one-shot operations on whole files. This adds an intermediate partitioned_file
module that sits on top of the buffer system and has an awareness of FMAP
entries. It provides an easy way to get a buffer for an individual region of a
larger image file based on FMAP section name, as well as incrementally write
those smaller buffers back to the backing file at the appropriate offset. The
module has two distinct modes of operation:
- For new images whose layout is described exclusively by an FMAP section, all
the aforementioned functionality will be available.
- For images in the current format, where the CBFS master header serves as the
root of knowledge of the image's size and layout, the module falls back to a
legacy operation mode, where it only allows manipulation of the entire image
as one unit, but exposes this support through the same interface by mapping
the region named SECTION_NAME_PRIMARY_CBFS ("COREBOOT") to the whole file.
The tool is presently only ported onto the new module running in legacy mode:
higher-level support for true "partitioned" images will be forthcoming. However,
as part of this change, the crusty cbfs_image_from_file() and
cbfs_image_write_file() abstractions are removed and replaced with a single
cbfs_image function, cbfs_image_from_buffer(), as well as centralized image
reading/writing directly in cbfstool's main() function. This reduces the
boilerplate required to implement each new action, makes the create action much
more similar to the others, and will make implementing additional actions and
adding in support for the new format much easier.
BUG=chromium:470407
TEST=Build panther and nyan_big coreboot.rom images with and without this patch
and diff their hexdumps. Ensure that no differences occur at different locations
from the diffs between subsequent builds of an identical source tree. Then flash
a full new build onto nyan_big and watch it boot normally.
BRANCH=None
Change-Id: I25578c7b223bc8434c3074cb0dd8894534f8c500
Signed-off-by: Sol Boucher <solb@chromium.org>
Original-Commit-Id: 7e1c96a48e7a27fc6b90289d35e6e169d5e7ad20
Original-Change-Id: Ia4a1a4c48df42b9ec2d6b9471b3a10eb7b24bb39
Original-Signed-off-by: Sol Boucher <solb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/265581
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/10134
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-03-25 21:40:08 +01:00
|
|
|
cbfsobj += partitioned_file.o
|
2020-03-20 05:09:35 +01:00
|
|
|
cbfsobj += platform_fixups.o
|
2015-09-29 22:51:35 +02:00
|
|
|
# COMMONLIB
|
2020-05-07 02:27:02 +02:00
|
|
|
cbfsobj += cbfs_private.o
|
2016-05-09 21:23:01 +02:00
|
|
|
cbfsobj += fsp_relocate.o
|
cbfstool: Restructure around support for reading/writing portions of files
The buffer API that cbfstool uses to read and write files only directly supports
one-shot operations on whole files. This adds an intermediate partitioned_file
module that sits on top of the buffer system and has an awareness of FMAP
entries. It provides an easy way to get a buffer for an individual region of a
larger image file based on FMAP section name, as well as incrementally write
those smaller buffers back to the backing file at the appropriate offset. The
module has two distinct modes of operation:
- For new images whose layout is described exclusively by an FMAP section, all
the aforementioned functionality will be available.
- For images in the current format, where the CBFS master header serves as the
root of knowledge of the image's size and layout, the module falls back to a
legacy operation mode, where it only allows manipulation of the entire image
as one unit, but exposes this support through the same interface by mapping
the region named SECTION_NAME_PRIMARY_CBFS ("COREBOOT") to the whole file.
The tool is presently only ported onto the new module running in legacy mode:
higher-level support for true "partitioned" images will be forthcoming. However,
as part of this change, the crusty cbfs_image_from_file() and
cbfs_image_write_file() abstractions are removed and replaced with a single
cbfs_image function, cbfs_image_from_buffer(), as well as centralized image
reading/writing directly in cbfstool's main() function. This reduces the
boilerplate required to implement each new action, makes the create action much
more similar to the others, and will make implementing additional actions and
adding in support for the new format much easier.
BUG=chromium:470407
TEST=Build panther and nyan_big coreboot.rom images with and without this patch
and diff their hexdumps. Ensure that no differences occur at different locations
from the diffs between subsequent builds of an identical source tree. Then flash
a full new build onto nyan_big and watch it boot normally.
BRANCH=None
Change-Id: I25578c7b223bc8434c3074cb0dd8894534f8c500
Signed-off-by: Sol Boucher <solb@chromium.org>
Original-Commit-Id: 7e1c96a48e7a27fc6b90289d35e6e169d5e7ad20
Original-Change-Id: Ia4a1a4c48df42b9ec2d6b9471b3a10eb7b24bb39
Original-Signed-off-by: Sol Boucher <solb@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/265581
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/10134
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2015-03-25 21:40:08 +01:00
|
|
|
# FMAP
|
|
|
|
cbfsobj += fmap.o
|
|
|
|
cbfsobj += kv_pair.o
|
|
|
|
cbfsobj += valstr.o
|
2013-08-27 20:22:21 +02:00
|
|
|
# linux as payload
|
|
|
|
cbfsobj += linux_trampoline.o
|
|
|
|
cbfsobj += cbfs-payload-linux.o
|
2017-01-11 15:26:58 +01:00
|
|
|
# compression algorithms
|
|
|
|
cbfsobj += $(compressionobj)
|
2009-08-12 17:00:51 +02:00
|
|
|
|
2015-02-26 20:47:19 +01:00
|
|
|
fmapobj :=
|
|
|
|
fmapobj += fmaptool.o
|
2015-03-18 18:13:48 +01:00
|
|
|
fmapobj += cbfs_sections.o
|
2015-02-26 20:47:19 +01:00
|
|
|
fmapobj += fmap_from_fmd.o
|
|
|
|
fmapobj += fmd.o
|
|
|
|
fmapobj += fmd_parser.o
|
|
|
|
fmapobj += fmd_scanner.o
|
|
|
|
# FMAP
|
|
|
|
fmapobj += fmap.o
|
|
|
|
fmapobj += kv_pair.o
|
|
|
|
fmapobj += valstr.o
|
|
|
|
|
2015-03-06 00:38:03 +01:00
|
|
|
rmodobj :=
|
2014-03-07 22:11:53 +01:00
|
|
|
rmodobj += rmodtool.o
|
|
|
|
rmodobj += rmodule.o
|
|
|
|
rmodobj += common.o
|
|
|
|
rmodobj += elfheaders.o
|
|
|
|
rmodobj += xdr.o
|
|
|
|
|
2016-05-20 01:12:16 +02:00
|
|
|
ifwiobj :=
|
|
|
|
ifwiobj += ifwitool.o
|
|
|
|
ifwiobj += common.o
|
|
|
|
|
2018-11-20 13:54:49 +01:00
|
|
|
ifitobj :=
|
|
|
|
ifitobj += ifittool.o
|
|
|
|
ifitobj += common.o
|
|
|
|
ifitobj += fit.o
|
|
|
|
ifitobj += cbfs_image.o
|
|
|
|
# Make it link ....
|
|
|
|
ifitobj += xdr.o
|
|
|
|
ifitobj += elfheaders.o
|
|
|
|
ifitobj += partitioned_file.o
|
|
|
|
ifitobj += cbfs-mkstage.o
|
|
|
|
ifitobj += cbfs-mkpayload.o
|
|
|
|
ifitobj += rmodule.o
|
|
|
|
# FMAP
|
|
|
|
ifitobj += fmap.o
|
|
|
|
ifitobj += kv_pair.o
|
|
|
|
ifitobj += valstr.o
|
|
|
|
# compression algorithms
|
|
|
|
ifitobj += $(compressionobj)
|
|
|
|
|
|
|
|
|
2017-01-11 15:26:58 +01:00
|
|
|
cbfscompobj :=
|
|
|
|
cbfscompobj += $(compressionobj)
|
|
|
|
cbfscompobj += cbfscomptool.o
|
|
|
|
|
2019-03-19 21:48:33 +01:00
|
|
|
amdcompobj :=
|
|
|
|
amdcompobj += amdcompress.o
|
|
|
|
amdcompobj += elfheaders.o
|
|
|
|
amdcompobj += common.o
|
|
|
|
amdcompobj += xdr.o
|
|
|
|
|
2021-07-17 01:49:04 +02:00
|
|
|
elogobj :=
|
|
|
|
elogobj := elogtool.o
|
|
|
|
elogobj += eventlog.o
|
|
|
|
elogobj += valstr.o
|
|
|
|
elogobj += elog.o
|
|
|
|
elogobj += common.o
|
2022-06-06 12:01:04 +02:00
|
|
|
elogobj += flashrom.o
|
2021-07-17 01:49:04 +02:00
|
|
|
|
2021-09-17 07:02:01 +02:00
|
|
|
include $(top)/util/cbfstool/fpt_formats/Makefile.inc
|
|
|
|
cse_fpt_obj :=
|
|
|
|
cse_fpt_obj += cse_fpt.o
|
|
|
|
cse_fpt_obj += common.o
|
2021-10-09 00:18:33 +02:00
|
|
|
cse_fpt_obj += cse_helpers.o
|
2021-09-17 07:02:01 +02:00
|
|
|
cse_fpt_obj += $(foreach var, $(fpt_formats_obj), $(var))
|
|
|
|
|
2021-09-17 07:04:11 +02:00
|
|
|
include $(top)/util/cbfstool/bpdt_formats/Makefile.inc
|
|
|
|
cse_serger_obj :=
|
|
|
|
cse_serger_obj += cse_serger.o
|
|
|
|
cse_serger_obj += common.o
|
2021-10-09 00:18:33 +02:00
|
|
|
cse_serger_obj += cse_helpers.o
|
2021-09-17 07:04:11 +02:00
|
|
|
cse_serger_obj += $(foreach var, $(bpdt_formats_obj), $(var))
|
|
|
|
|
2021-02-14 22:57:06 +01:00
|
|
|
TOOLCFLAGS ?= -Werror -Wall -Wextra -Wshadow
|
2015-03-06 00:38:03 +01:00
|
|
|
TOOLCFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow
|
|
|
|
TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings
|
2017-01-11 17:17:18 +01:00
|
|
|
TOOLCFLAGS += -O2
|
2015-02-26 20:47:19 +01:00
|
|
|
TOOLCPPFLAGS ?= -D_DEFAULT_SOURCE # memccpy() from string.h
|
2020-01-29 20:34:44 +01:00
|
|
|
TOOLCPPFLAGS += -D_BSD_SOURCE -D_SVID_SOURCE # _DEFAULT_SOURCE for older glibc
|
2020-05-07 02:27:02 +02:00
|
|
|
TOOLCPPFLAGS += -D_GNU_SOURCE # memmem() from string.h
|
2015-02-26 20:47:19 +01:00
|
|
|
TOOLCPPFLAGS += -I$(top)/util/cbfstool/flashmap
|
2015-05-19 16:43:05 +02:00
|
|
|
TOOLCPPFLAGS += -I$(top)/util/cbfstool
|
|
|
|
TOOLCPPFLAGS += -I$(objutil)/cbfstool
|
2019-12-12 00:47:42 +01:00
|
|
|
TOOLCPPFLAGS += -I$(top)/src/commonlib/include -I$(top)/src/commonlib/bsd/include
|
|
|
|
TOOLCPPFLAGS += -include $(top)/src/commonlib/bsd/include/commonlib/bsd/compiler.h
|
2016-07-24 12:14:38 +02:00
|
|
|
TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/include
|
|
|
|
TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/firmware/2lib/include
|
2020-03-14 00:43:34 +01:00
|
|
|
TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/host/include
|
2021-07-17 01:49:04 +02:00
|
|
|
TOOLCPPFLAGS += -I$(VBOOT_SOURCE)/host/lib/include
|
2015-10-02 00:02:45 +02:00
|
|
|
# UEFI header file support. It's not pretty, but that's what we currently
|
|
|
|
# have right now.
|
|
|
|
TOOLCPPFLAGS += -I$(top)/src
|
|
|
|
TOOLCPPFLAGS += -I$(top)/src/vendorcode/intel/edk2/uefi_2.4/MdePkg/Include
|
|
|
|
|
2015-05-03 09:35:32 +02:00
|
|
|
TOOLLDFLAGS ?=
|
2015-10-02 09:56:32 +02:00
|
|
|
HOSTCFLAGS += -fms-extensions
|
2015-03-06 00:38:03 +01:00
|
|
|
|
2012-10-22 10:39:24 +02:00
|
|
|
ifeq ($(shell uname -s | cut -c-7 2>/dev/null), MINGW32)
|
2015-09-16 16:19:26 +02:00
|
|
|
TOOLCFLAGS += -mno-ms-bitfields
|
2012-10-22 10:39:24 +02:00
|
|
|
endif
|
2015-09-16 02:41:07 +02:00
|
|
|
ifeq ($(shell uname -o 2>/dev/null), Cygwin)
|
2019-12-12 07:01:32 +01:00
|
|
|
TOOLCFLAGS+=-std=gnu11
|
2015-09-16 02:41:07 +02:00
|
|
|
TOOLCPPFLAGS+=-D_GNU_SOURCE
|
|
|
|
else
|
2019-12-12 07:01:32 +01:00
|
|
|
TOOLCFLAGS+=-std=c11
|
2015-09-16 02:41:07 +02:00
|
|
|
endif
|
2012-10-22 10:39:24 +02:00
|
|
|
|
2022-04-28 05:23:11 +02:00
|
|
|
LZ4CFLAGS ?= -Wno-strict-prototypes
|
|
|
|
|
2020-03-09 03:58:37 +01:00
|
|
|
VBOOT_HOSTLIB = $(VBOOT_HOST_BUILD)/libvboot_host.a
|
|
|
|
|
|
|
|
$(VBOOT_HOSTLIB):
|
|
|
|
printf " MAKE $(subst $(objutil)/,,$(@))\n"
|
|
|
|
unset CFLAGS LDFLAGS; $(MAKE) -C $(VBOOT_SOURCE) \
|
|
|
|
BUILD=$(VBOOT_HOST_BUILD) \
|
|
|
|
CC="$(HOSTCC)" \
|
2020-06-29 21:01:44 +02:00
|
|
|
PKG_CONFIG="true" \
|
2022-06-18 12:00:33 +02:00
|
|
|
USE_FLASHROM=0 \
|
2020-03-09 03:58:37 +01:00
|
|
|
V=$(V) \
|
2021-06-22 16:31:20 +02:00
|
|
|
DEBUG= \
|
2020-03-09 03:58:37 +01:00
|
|
|
hostlib
|
|
|
|
|
2015-05-19 16:43:05 +02:00
|
|
|
$(objutil)/cbfstool/%.o: $(objutil)/cbfstool/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
2010-04-17 00:48:57 +02:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
2015-03-06 00:38:03 +01:00
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
2009-08-12 17:00:51 +02:00
|
|
|
|
2015-02-26 20:47:19 +01:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/flashmap/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
2013-03-29 00:51:45 +01:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
2015-03-06 00:38:03 +01:00
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
2009-08-12 17:00:51 +02:00
|
|
|
|
2012-10-30 22:02:45 +01:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lzma/C/%.c
|
2012-12-14 08:44:59 +01:00
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
2015-03-06 00:38:03 +01:00
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
2009-09-14 15:29:27 +02:00
|
|
|
|
2015-10-02 00:02:45 +02:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/src/commonlib/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
2019-12-12 00:47:42 +01:00
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
$(objutil)/cbfstool/%.o: $(top)/src/commonlib/bsd/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
2015-10-02 00:02:45 +02:00
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
2015-09-29 22:51:35 +02:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lz4/lib/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
2022-04-28 05:23:11 +02:00
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) $(LZ4CFLAGS) -c -o $@ $<
|
2015-09-29 22:51:35 +02:00
|
|
|
|
2021-09-17 07:02:01 +02:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/fpt_formats/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
2021-09-17 07:04:11 +02:00
|
|
|
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/bpdt_formats/%.c
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
|
|
|
|
$(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
|
|
|
|
|
2020-03-09 03:58:37 +01:00
|
|
|
$(objutil)/cbfstool/cbfstool: $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) $(VBOOT_HOSTLIB)
|
2013-03-29 00:51:45 +01:00
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
2020-03-09 03:58:37 +01:00
|
|
|
$(HOSTCC) -v $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfsobj)) $(VBOOT_HOSTLIB)
|
2014-03-07 22:11:53 +01:00
|
|
|
|
2015-02-26 20:47:19 +01:00
|
|
|
$(objutil)/cbfstool/fmaptool: $(addprefix $(objutil)/cbfstool/,$(fmapobj))
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(fmapobj))
|
|
|
|
|
2014-07-15 12:28:12 +02:00
|
|
|
$(objutil)/cbfstool/rmodtool: $(addprefix $(objutil)/cbfstool/,$(rmodobj))
|
2014-03-07 22:11:53 +01:00
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
2015-05-03 09:35:32 +02:00
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(rmodobj))
|
2015-03-06 00:38:03 +01:00
|
|
|
|
2016-05-20 01:12:16 +02:00
|
|
|
$(objutil)/cbfstool/ifwitool: $(addprefix $(objutil)/cbfstool/,$(ifwiobj))
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(ifwiobj))
|
|
|
|
|
2020-03-09 03:58:37 +01:00
|
|
|
$(objutil)/cbfstool/ifittool: $(addprefix $(objutil)/cbfstool/,$(ifitobj)) $(VBOOT_HOSTLIB)
|
2018-11-20 13:54:49 +01:00
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
2020-03-09 03:58:37 +01:00
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(ifitobj)) $(VBOOT_HOSTLIB)
|
2018-11-20 13:54:49 +01:00
|
|
|
|
2017-01-11 15:26:58 +01:00
|
|
|
$(objutil)/cbfstool/cbfs-compression-tool: $(addprefix $(objutil)/cbfstool/,$(cbfscompobj))
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cbfscompobj))
|
|
|
|
|
2019-03-19 21:48:33 +01:00
|
|
|
$(objutil)/cbfstool/amdcompress: $(addprefix $(objutil)/cbfstool/,$(amdcompobj))
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(amdcompobj)) -lz
|
|
|
|
|
2022-02-26 01:28:04 +01:00
|
|
|
$(objutil)/cbfstool/elogtool: $(addprefix $(objutil)/cbfstool/,$(elogobj)) $(VBOOT_HOSTLIB)
|
2021-07-17 01:49:04 +02:00
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
2022-02-26 01:28:04 +01:00
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(elogobj)) $(VBOOT_HOSTLIB)
|
2021-07-17 01:49:04 +02:00
|
|
|
|
2021-09-17 07:02:01 +02:00
|
|
|
$(objutil)/cbfstool/cse_fpt: $(addprefix $(objutil)/cbfstool/,$(cse_fpt_obj))
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cse_fpt_obj))
|
|
|
|
|
2021-09-17 07:04:11 +02:00
|
|
|
$(objutil)/cbfstool/cse_serger: $(addprefix $(objutil)/cbfstool/,$(cse_serger_obj))
|
|
|
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
|
|
|
$(HOSTCC) $(TOOLLDFLAGS) -o $@ $(addprefix $(objutil)/cbfstool/,$(cse_serger_obj))
|
|
|
|
|
2015-02-26 20:47:19 +01:00
|
|
|
# Yacc source is superset of header
|
2015-05-09 07:06:02 +02:00
|
|
|
$(objutil)/cbfstool/fmd.o: TOOLCFLAGS += -Wno-redundant-decls
|
2015-02-26 20:47:19 +01:00
|
|
|
$(objutil)/cbfstool/fmd_parser.o: TOOLCFLAGS += -Wno-redundant-decls
|
2015-05-09 07:06:02 +02:00
|
|
|
# Lex generates unneeded functions and declarations
|
|
|
|
$(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-redundant-decls
|
2015-02-26 20:47:19 +01:00
|
|
|
$(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-unused-function
|
2015-03-06 00:38:03 +01:00
|
|
|
# Tolerate lzma sdk warnings
|
|
|
|
$(objutil)/cbfstool/LzmaEnc.o: TOOLCFLAGS += -Wno-sign-compare -Wno-cast-qual
|
2020-05-07 02:27:02 +02:00
|
|
|
# Tolerate commonlib warnings
|
|
|
|
$(objutil)/cbfstool/cbfs_private.o: TOOLCFLAGS += -Wno-sign-compare
|
2015-09-29 22:51:35 +02:00
|
|
|
# Tolerate lz4 warnings
|
|
|
|
$(objutil)/cbfstool/lz4.o: TOOLCFLAGS += -Wno-missing-prototypes
|
2019-12-14 20:44:47 +01:00
|
|
|
$(objutil)/cbfstool/lz4_wrapper.o: TOOLCFLAGS += -Wno-attributes
|
2015-02-26 20:47:19 +01:00
|
|
|
|
2015-05-19 16:43:05 +02:00
|
|
|
$(objutil)/cbfstool/fmd.o: $(objutil)/cbfstool/fmd_parser.h
|
|
|
|
$(objutil)/cbfstool/fmd.o: $(objutil)/cbfstool/fmd_scanner.h
|
2015-05-15 08:27:34 +02:00
|
|
|
$(objutil)/cbfstool/fmd_parser.o: $(objutil)/cbfstool/fmd.o
|
|
|
|
$(objutil)/cbfstool/fmd_scanner.o: $(objutil)/cbfstool/fmd.o
|
2016-06-28 20:45:34 +02:00
|
|
|
$(objutil)/cbfstool/fmd_scanner.o: TOOLCFLAGS += -Wno-sign-compare
|
2015-05-15 08:27:34 +02:00
|
|
|
|
2015-05-19 16:43:05 +02:00
|
|
|
$(objutil)/cbfstool/%: $(top)/util/cbfstool/%_shipped
|
2015-05-15 08:27:34 +02:00
|
|
|
mkdir -p $(dir $@)
|
|
|
|
cp $< $@
|
|
|
|
|
2015-02-26 20:47:19 +01:00
|
|
|
ifeq ($(CONFIG_FMD_GENPARSER),y)
|
|
|
|
TOOLLEX := lex
|
2023-06-15 09:26:40 +02:00
|
|
|
TOOLYACC := bison
|
2015-02-26 20:47:19 +01:00
|
|
|
|
2015-05-15 08:27:34 +02:00
|
|
|
# the .c rule also creates .h
|
|
|
|
$(top)/util/cbfstool/fmd_scanner.h_shipped: $(top)/util/cbfstool/fmd_scanner.c_shipped
|
|
|
|
$(top)/util/cbfstool/fmd_scanner.c_shipped: $(top)/util/cbfstool/fmd_scanner.l
|
2015-02-26 20:47:19 +01:00
|
|
|
echo " LEX util/cbfstool/fmd_scanner.[ch]"
|
2023-06-15 09:26:40 +02:00
|
|
|
$(TOOLLEX) -L -o $@ --header-file=$(patsubst %.c_shipped,%.h_shipped,$@) $<
|
2015-05-15 08:27:34 +02:00
|
|
|
|
|
|
|
# the .c rule also creates .h
|
|
|
|
$(top)/util/cbfstool/fmd_parser.h_shipped: $(top)/util/cbfstool/fmd_parser.c_shipped
|
|
|
|
$(top)/util/cbfstool/fmd_parser.c_shipped: $(top)/util/cbfstool/fmd_parser.y
|
2015-02-26 20:47:19 +01:00
|
|
|
echo " YACC util/cbfstool/fmd_parser.[ch]"
|
2023-06-15 09:26:40 +02:00
|
|
|
$(TOOLYACC) -l -o $@ --defines=$(patsubst %.c_shipped,%.h_shipped,$@) $<
|
2015-05-15 08:27:34 +02:00
|
|
|
|
|
|
|
endif # CONFIG_FMD_GENPARSER
|