Patrick Georgi | ae570d5 | 2015-09-16 16:34:15 +0200 | [diff] [blame] | 1 | top ?= $(abspath ../..) |
| 2 | objutil ?= $(top)/util |
Patrick Georgi | ae570d5 | 2015-09-16 16:34:15 +0200 | [diff] [blame] | 3 | |
Alexander Couzens | 2c68b1c | 2016-06-16 20:16:54 -0700 | [diff] [blame] | 4 | CONFIG_FMD_GENPARSER ?= n |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 5 | |
Alexandru Gagniuc | 4a7b115 | 2014-01-27 17:17:29 -0600 | [diff] [blame] | 6 | HOSTCC ?= $(CC) |
Denis 'GNUtoo' Carikli | 3ef241f | 2015-11-11 05:27:25 +0100 | [diff] [blame] | 7 | PREFIX ?= /usr/local |
| 8 | BINDIR ?= $(PREFIX)/bin |
Yegor Timoshenko | c2e4941 | 2018-10-07 01:58:27 +0000 | [diff] [blame] | 9 | INSTALL ?= /usr/bin/env install |
Stefan Reinauer | 0316e1a | 2015-11-20 17:58:59 +0100 | [diff] [blame] | 10 | OBJCOPY ?= objcopy |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 11 | |
Paul Kocialkowski | 61486b5 | 2016-07-24 12:14:38 +0200 | [diff] [blame] | 12 | VBOOT_SOURCE ?= $(top)/3rdparty/vboot |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 13 | VBOOT_HOST_BUILD ?= $(abspath $(objutil)/vboot_lib) |
Paul Kocialkowski | 61486b5 | 2016-07-24 12:14:38 +0200 | [diff] [blame] | 14 | |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 15 | .PHONY: all |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 16 | all: cbfstool ifittool fmaptool rmodtool ifwitool cbfs-compression-tool |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 17 | |
Antonello Dettori | 75c3705 | 2016-06-05 17:26:01 +0200 | [diff] [blame] | 18 | cbfstool: $(objutil)/cbfstool/cbfstool |
| 19 | |
| 20 | fmaptool: $(objutil)/cbfstool/fmaptool |
| 21 | |
| 22 | rmodtool: $(objutil)/cbfstool/rmodtool |
| 23 | |
| 24 | ifwitool: $(objutil)/cbfstool/ifwitool |
| 25 | |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 26 | ifittool: $(objutil)/cbfstool/ifittool |
| 27 | |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 28 | cbfs-compression-tool: $(objutil)/cbfstool/cbfs-compression-tool |
| 29 | |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 30 | .PHONY: clean cbfstool ifittool fmaptool rmodtool ifwitool cbfs-compression-tool |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 31 | clean: |
Nico Huber | 37743a9 | 2015-10-22 13:34:06 +0200 | [diff] [blame] | 32 | $(RM) fmd_parser.c fmd_parser.h fmd_scanner.c fmd_scanner.h |
Patrick Georgi | ae570d5 | 2015-09-16 16:34:15 +0200 | [diff] [blame] | 33 | $(RM) $(objutil)/cbfstool/cbfstool $(cbfsobj) |
| 34 | $(RM) $(objutil)/cbfstool/fmaptool $(fmapobj) |
| 35 | $(RM) $(objutil)/cbfstool/rmodtool $(rmodobj) |
Furquan Shaikh | 233f1b6 | 2016-05-19 16:12:16 -0700 | [diff] [blame] | 36 | $(RM) $(objutil)/cbfstool/ifwitool $(ifwiobj) |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 37 | $(RM) $(objutil)/cbfstool/ifittool $(ifitobj) |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 38 | $(RM) $(objutil)/cbfstool/cbfs-compression-tool $(cbfscompobj) |
Yu-Ping Wu | 0beddb5 | 2020-03-09 10:58:37 +0800 | [diff] [blame] | 39 | $(RM) -r $(VBOOT_HOST_BUILD) |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 40 | |
Stefan Reinauer | 0316e1a | 2015-11-20 17:58:59 +0100 | [diff] [blame] | 41 | linux_trampoline.c: linux_trampoline.S |
| 42 | rm -f linux_trampoline.c |
| 43 | $(CC) -m32 -o linux_trampoline linux_trampoline.S -ffreestanding -nostdlib -nostdinc -Wl,--defsym=_start=0 |
| 44 | $(OBJCOPY) -Obinary -j .data linux_trampoline trampoline |
| 45 | echo "/* This file is automatically generated. Do not manually change */" > trampoline.c |
Patrick Georgi | 1dd517c | 2020-05-10 20:45:08 +0200 | [diff] [blame] | 46 | echo "/* SPDX-License-Identifier: GPL-2.0-only */" >> trampoline.c |
Stefan Reinauer | 0316e1a | 2015-11-20 17:58:59 +0100 | [diff] [blame] | 47 | xxd -c 16 -i trampoline >> trampoline.c |
Stefan Reinauer | 0316e1a | 2015-11-20 17:58:59 +0100 | [diff] [blame] | 48 | mv trampoline.c linux_trampoline.c |
| 49 | rm linux_trampoline trampoline |
| 50 | |
Martin Roth | 92f447a | 2021-02-14 14:57:06 -0700 | [diff] [blame] | 51 | .PHONY: install distclean help |
Denis 'GNUtoo' Carikli | 3ef241f | 2015-11-11 05:27:25 +0100 | [diff] [blame] | 52 | install: all |
| 53 | mkdir -p $(DESTDIR)$(BINDIR) |
| 54 | $(INSTALL) cbfstool $(DESTDIR)$(BINDIR) |
| 55 | $(INSTALL) fmaptool $(DESTDIR)$(BINDIR) |
| 56 | $(INSTALL) rmodtool $(DESTDIR)$(BINDIR) |
| 57 | $(INSTALL) ifwitool $(DESTDIR)$(BINDIR) |
Philipp Deppenwiese | 5ada002 | 2018-11-20 13:54:49 +0100 | [diff] [blame] | 58 | $(INSTALL) ifittool $(DESTDIR)$(BINDIR) |
Denis 'GNUtoo' Carikli | 3ef241f | 2015-11-11 05:27:25 +0100 | [diff] [blame] | 59 | $(INSTALL) cbfs-compression-tool $(DESTDIR)$(BINDIR) |
| 60 | |
Martin Roth | 92f447a | 2021-02-14 14:57:06 -0700 | [diff] [blame] | 61 | distclean: clean |
| 62 | |
| 63 | help: |
| 64 | @echo "cbfstool & associated tools" |
| 65 | @echo "Targets: all, clean, distclean, help" |
| 66 | @echo " cbfstool - Manipulate CBFS images" |
| 67 | @echo " fmaptool - Compile Flashmap descriptor (fmd) files" |
| 68 | @echo " rmodtool - Create relocatable modules" |
| 69 | @echo " ifwitool - Manipulate Intel FW Image (IFWI)" |
| 70 | @echo " ifittool - Manipulate Intel FW Interface Table (FIT)" |
| 71 | @echo " cbfs-compression-tool - benchmark compression algorithms" |
| 72 | |
Vadim Bendebury | 98485de | 2018-11-01 20:48:21 -0700 | [diff] [blame] | 73 | ifneq ($(V),1) |
Stefan Reinauer | 30ff362 | 2015-11-21 17:53:32 +0100 | [diff] [blame] | 74 | .SILENT: |
Vadim Bendebury | 98485de | 2018-11-01 20:48:21 -0700 | [diff] [blame] | 75 | endif |
Stefan Reinauer | 30ff362 | 2015-11-21 17:53:32 +0100 | [diff] [blame] | 76 | |
Patrick Georgi | ae570d5 | 2015-09-16 16:34:15 +0200 | [diff] [blame] | 77 | include Makefile.inc |
Patrick Georgi | 67d958b | 2021-05-29 16:12:29 +0200 | [diff] [blame] | 78 | |
| 79 | $(objutil)/cbfstool/cbfstool.o: $(VBOOT_SOURCE)/firmware/include/vb2_sha.h |
| 80 | |
| 81 | $(VBOOT_SOURCE)/firmware/include/vb2_sha.h: |
| 82 | cd $(VBOOT_SOURCE) && git submodule update --init . |