2015-09-16 16:34:15 +02:00
|
|
|
top ?= $(abspath ../..)
|
|
|
|
objutil ?= $(top)/util
|
2009-04-04 20:24:21 +02:00
|
|
|
|
2016-06-17 05:16:54 +02:00
|
|
|
CONFIG_FMD_GENPARSER ?= n
|
2015-02-26 20:47:19 +01:00
|
|
|
|
2015-09-16 16:34:15 +02:00
|
|
|
HOSTCC ?= $(CC)
|
2015-11-11 05:27:25 +01:00
|
|
|
PREFIX ?= /usr/local
|
|
|
|
BINDIR ?= $(PREFIX)/bin
|
2018-10-07 03:58:27 +02:00
|
|
|
INSTALL ?= /usr/bin/env install
|
2015-11-20 17:58:59 +01:00
|
|
|
OBJCOPY ?= objcopy
|
2015-02-26 20:47:19 +01:00
|
|
|
|
2016-07-24 12:14:38 +02:00
|
|
|
VBOOT_SOURCE ?= $(top)/3rdparty/vboot
|
2020-03-09 03:58:37 +01:00
|
|
|
VBOOT_HOST_BUILD ?= $(abspath $(objutil)/vboot_lib)
|
2016-07-24 12:14:38 +02:00
|
|
|
|
2015-03-06 00:38:03 +01:00
|
|
|
.PHONY: all
|
2021-09-17 07:02:01 +02:00
|
|
|
all: cbfstool ifittool fmaptool rmodtool ifwitool cbfs-compression-tool elogtool cse_fpt
|
2009-03-31 13:57:36 +02:00
|
|
|
|
2016-06-05 17:26:01 +02:00
|
|
|
cbfstool: $(objutil)/cbfstool/cbfstool
|
|
|
|
|
|
|
|
fmaptool: $(objutil)/cbfstool/fmaptool
|
|
|
|
|
|
|
|
rmodtool: $(objutil)/cbfstool/rmodtool
|
|
|
|
|
|
|
|
ifwitool: $(objutil)/cbfstool/ifwitool
|
|
|
|
|
2018-11-20 13:54:49 +01:00
|
|
|
ifittool: $(objutil)/cbfstool/ifittool
|
|
|
|
|
2017-01-11 15:26:58 +01:00
|
|
|
cbfs-compression-tool: $(objutil)/cbfstool/cbfs-compression-tool
|
|
|
|
|
2021-07-17 01:49:04 +02:00
|
|
|
elogtool: $(objutil)/cbfstool/elogtool
|
|
|
|
|
2021-09-17 07:02:01 +02:00
|
|
|
cse_fpt: $(objutil)/cbfstool/cse_fpt
|
|
|
|
|
|
|
|
.PHONY: clean cbfstool ifittool fmaptool rmodtool ifwitool cbfs-compression-tool elogtool cse_fpt
|
2009-09-14 15:29:27 +02:00
|
|
|
clean:
|
2015-10-22 13:34:06 +02:00
|
|
|
$(RM) fmd_parser.c fmd_parser.h fmd_scanner.c fmd_scanner.h
|
2015-09-16 16:34:15 +02:00
|
|
|
$(RM) $(objutil)/cbfstool/cbfstool $(cbfsobj)
|
|
|
|
$(RM) $(objutil)/cbfstool/fmaptool $(fmapobj)
|
|
|
|
$(RM) $(objutil)/cbfstool/rmodtool $(rmodobj)
|
2016-05-20 01:12:16 +02:00
|
|
|
$(RM) $(objutil)/cbfstool/ifwitool $(ifwiobj)
|
2018-11-20 13:54:49 +01:00
|
|
|
$(RM) $(objutil)/cbfstool/ifittool $(ifitobj)
|
2017-01-11 15:26:58 +01:00
|
|
|
$(RM) $(objutil)/cbfstool/cbfs-compression-tool $(cbfscompobj)
|
2021-07-17 01:49:04 +02:00
|
|
|
$(RM) $(objutil)/cbfstool/elogtool $(elogobj)
|
2021-09-17 07:02:01 +02:00
|
|
|
$(RM) $(objutil)/cbfstool/cse_fpt $(cse_fpt_obj)
|
2020-03-09 03:58:37 +01:00
|
|
|
$(RM) -r $(VBOOT_HOST_BUILD)
|
2012-08-16 01:02:52 +02:00
|
|
|
|
2015-11-20 17:58:59 +01:00
|
|
|
linux_trampoline.c: linux_trampoline.S
|
|
|
|
rm -f linux_trampoline.c
|
|
|
|
$(CC) -m32 -o linux_trampoline linux_trampoline.S -ffreestanding -nostdlib -nostdinc -Wl,--defsym=_start=0
|
|
|
|
$(OBJCOPY) -Obinary -j .data linux_trampoline trampoline
|
|
|
|
echo "/* This file is automatically generated. Do not manually change */" > trampoline.c
|
2020-05-10 20:45:08 +02:00
|
|
|
echo "/* SPDX-License-Identifier: GPL-2.0-only */" >> trampoline.c
|
2015-11-20 17:58:59 +01:00
|
|
|
xxd -c 16 -i trampoline >> trampoline.c
|
|
|
|
mv trampoline.c linux_trampoline.c
|
|
|
|
rm linux_trampoline trampoline
|
|
|
|
|
2021-02-14 22:57:06 +01:00
|
|
|
.PHONY: install distclean help
|
2015-11-11 05:27:25 +01:00
|
|
|
install: all
|
|
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
|
|
$(INSTALL) cbfstool $(DESTDIR)$(BINDIR)
|
|
|
|
$(INSTALL) fmaptool $(DESTDIR)$(BINDIR)
|
|
|
|
$(INSTALL) rmodtool $(DESTDIR)$(BINDIR)
|
|
|
|
$(INSTALL) ifwitool $(DESTDIR)$(BINDIR)
|
2018-11-20 13:54:49 +01:00
|
|
|
$(INSTALL) ifittool $(DESTDIR)$(BINDIR)
|
2015-11-11 05:27:25 +01:00
|
|
|
$(INSTALL) cbfs-compression-tool $(DESTDIR)$(BINDIR)
|
2021-07-17 01:49:04 +02:00
|
|
|
$(INSTALL) elogtool $(DESTDIR)$(BINDIR)
|
2021-09-17 07:02:01 +02:00
|
|
|
$(INSTALL) cse_fpt $(DESTDIR)$(BINDIR)
|
2015-11-11 05:27:25 +01:00
|
|
|
|
2021-02-14 22:57:06 +01:00
|
|
|
distclean: clean
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "cbfstool & associated tools"
|
|
|
|
@echo "Targets: all, clean, distclean, help"
|
|
|
|
@echo " cbfstool - Manipulate CBFS images"
|
|
|
|
@echo " fmaptool - Compile Flashmap descriptor (fmd) files"
|
|
|
|
@echo " rmodtool - Create relocatable modules"
|
|
|
|
@echo " ifwitool - Manipulate Intel FW Image (IFWI)"
|
|
|
|
@echo " ifittool - Manipulate Intel FW Interface Table (FIT)"
|
|
|
|
@echo " cbfs-compression-tool - benchmark compression algorithms"
|
2021-07-17 01:49:04 +02:00
|
|
|
@echo " elogtool - Display ELOG events"
|
2021-09-17 07:02:01 +02:00
|
|
|
@echo " cse_fpt - Manage Intel CSE Flash Partition Table (FPT)"
|
2021-02-14 22:57:06 +01:00
|
|
|
|
2018-11-02 04:48:21 +01:00
|
|
|
ifneq ($(V),1)
|
2015-11-21 17:53:32 +01:00
|
|
|
.SILENT:
|
2018-11-02 04:48:21 +01:00
|
|
|
endif
|
2015-11-21 17:53:32 +01:00
|
|
|
|
2015-09-16 16:34:15 +02:00
|
|
|
include Makefile.inc
|
2021-05-29 16:12:29 +02:00
|
|
|
|
|
|
|
$(objutil)/cbfstool/cbfstool.o: $(VBOOT_SOURCE)/firmware/include/vb2_sha.h
|
2021-07-17 01:49:04 +02:00
|
|
|
$(objutil)/cbfstool/elogtool.o: $(VBOOT_SOURCE)/firmware/include/vb2_sha.h
|
2021-05-29 16:12:29 +02:00
|
|
|
|
|
|
|
$(VBOOT_SOURCE)/firmware/include/vb2_sha.h:
|
|
|
|
cd $(VBOOT_SOURCE) && git submodule update --init .
|