blob: d5321f695985eb4ac242d80288ff1ab9982b1a48 [file] [log] [blame]
Patrick Georgiae570d52015-09-16 16:34:15 +02001top ?= $(abspath ../..)
2objutil ?= $(top)/util
Patrick Georgiae570d52015-09-16 16:34:15 +02003
Alexander Couzens2c68b1c2016-06-16 20:16:54 -07004CONFIG_FMD_GENPARSER ?= n
Peter Stuge1d862de2009-04-14 00:08:34 +00005
Alexandru Gagniuc4a7b1152014-01-27 17:17:29 -06006HOSTCC ?= $(CC)
Denis 'GNUtoo' Carikli3ef241f2015-11-11 05:27:25 +01007PREFIX ?= /usr/local
8BINDIR ?= $(PREFIX)/bin
Yegor Timoshenkoc2e49412018-10-07 01:58:27 +00009INSTALL ?= /usr/bin/env install
Stefan Reinauer0316e1a2015-11-20 17:58:59 +010010OBJCOPY ?= objcopy
Sol Boucher0e539312015-03-05 15:38:03 -080011
Paul Kocialkowski61486b52016-07-24 12:14:38 +020012VBOOT_SOURCE ?= $(top)/3rdparty/vboot
13
Sol Boucher0e539312015-03-05 15:38:03 -080014.PHONY: all
Philipp Deppenwiese5ada0022018-11-20 13:54:49 +010015all: cbfstool ifittool fmaptool rmodtool ifwitool cbfs-compression-tool
Peter Stuge1d862de2009-04-14 00:08:34 +000016
Antonello Dettori75c37052016-06-05 17:26:01 +020017cbfstool: $(objutil)/cbfstool/cbfstool
18
19fmaptool: $(objutil)/cbfstool/fmaptool
20
21rmodtool: $(objutil)/cbfstool/rmodtool
22
23ifwitool: $(objutil)/cbfstool/ifwitool
24
Philipp Deppenwiese5ada0022018-11-20 13:54:49 +010025ifittool: $(objutil)/cbfstool/ifittool
26
Patrick Georgic88d16b2017-01-11 15:26:58 +010027cbfs-compression-tool: $(objutil)/cbfstool/cbfs-compression-tool
28
Philipp Deppenwiese5ada0022018-11-20 13:54:49 +010029.PHONY: clean cbfstool ifittool fmaptool rmodtool ifwitool cbfs-compression-tool
Patrick Georgib7b56dd82009-09-14 13:29:27 +000030clean:
Nico Huber37743a92015-10-22 13:34:06 +020031 $(RM) fmd_parser.c fmd_parser.h fmd_scanner.c fmd_scanner.h
Patrick Georgiae570d52015-09-16 16:34:15 +020032 $(RM) $(objutil)/cbfstool/cbfstool $(cbfsobj)
33 $(RM) $(objutil)/cbfstool/fmaptool $(fmapobj)
34 $(RM) $(objutil)/cbfstool/rmodtool $(rmodobj)
Furquan Shaikh233f1b62016-05-19 16:12:16 -070035 $(RM) $(objutil)/cbfstool/ifwitool $(ifwiobj)
Philipp Deppenwiese5ada0022018-11-20 13:54:49 +010036 $(RM) $(objutil)/cbfstool/ifittool $(ifitobj)
Patrick Georgic88d16b2017-01-11 15:26:58 +010037 $(RM) $(objutil)/cbfstool/cbfs-compression-tool $(cbfscompobj)
Peter Stuge1d862de2009-04-14 00:08:34 +000038
Stefan Reinauer0316e1a2015-11-20 17:58:59 +010039linux_trampoline.c: linux_trampoline.S
40 rm -f linux_trampoline.c
41 $(CC) -m32 -o linux_trampoline linux_trampoline.S -ffreestanding -nostdlib -nostdinc -Wl,--defsym=_start=0
42 $(OBJCOPY) -Obinary -j .data linux_trampoline trampoline
43 echo "/* This file is automatically generated. Do not manually change */" > trampoline.c
44 xxd -c 16 -i trampoline >> trampoline.c
Stefan Reinauer0316e1a2015-11-20 17:58:59 +010045 mv trampoline.c linux_trampoline.c
46 rm linux_trampoline trampoline
47
Denis 'GNUtoo' Carikli3ef241f2015-11-11 05:27:25 +010048.PHONY: install
49install: all
50 mkdir -p $(DESTDIR)$(BINDIR)
51 $(INSTALL) cbfstool $(DESTDIR)$(BINDIR)
52 $(INSTALL) fmaptool $(DESTDIR)$(BINDIR)
53 $(INSTALL) rmodtool $(DESTDIR)$(BINDIR)
54 $(INSTALL) ifwitool $(DESTDIR)$(BINDIR)
Philipp Deppenwiese5ada0022018-11-20 13:54:49 +010055 $(INSTALL) ifittool $(DESTDIR)$(BINDIR)
Denis 'GNUtoo' Carikli3ef241f2015-11-11 05:27:25 +010056 $(INSTALL) cbfs-compression-tool $(DESTDIR)$(BINDIR)
57
Vadim Bendebury98485de2018-11-01 20:48:21 -070058ifneq ($(V),1)
Stefan Reinauer30ff3622015-11-21 17:53:32 +010059.SILENT:
Vadim Bendebury98485de2018-11-01 20:48:21 -070060endif
Stefan Reinauer30ff3622015-11-21 17:53:32 +010061
Patrick Georgiae570d52015-09-16 16:34:15 +020062include Makefile.inc