blob: d7137e907b7fbd91ed814aa600e3ecdd822730e3 [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
Patrick Georgic88d16b2017-01-11 15:26:58 +010015all: cbfstool 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
Patrick Georgic88d16b2017-01-11 15:26:58 +010025cbfs-compression-tool: $(objutil)/cbfstool/cbfs-compression-tool
26
27.PHONY: clean cbfstool fmaptool rmodtool ifwitool cbfs-compression-tool
Patrick Georgib7b56dd82009-09-14 13:29:27 +000028clean:
Nico Huber37743a92015-10-22 13:34:06 +020029 $(RM) fmd_parser.c fmd_parser.h fmd_scanner.c fmd_scanner.h
Patrick Georgiae570d52015-09-16 16:34:15 +020030 $(RM) $(objutil)/cbfstool/cbfstool $(cbfsobj)
31 $(RM) $(objutil)/cbfstool/fmaptool $(fmapobj)
32 $(RM) $(objutil)/cbfstool/rmodtool $(rmodobj)
Furquan Shaikh233f1b62016-05-19 16:12:16 -070033 $(RM) $(objutil)/cbfstool/ifwitool $(ifwiobj)
Patrick Georgic88d16b2017-01-11 15:26:58 +010034 $(RM) $(objutil)/cbfstool/cbfs-compression-tool $(cbfscompobj)
Peter Stuge1d862de2009-04-14 00:08:34 +000035
Stefan Reinauer0316e1a2015-11-20 17:58:59 +010036linux_trampoline.c: linux_trampoline.S
37 rm -f linux_trampoline.c
38 $(CC) -m32 -o linux_trampoline linux_trampoline.S -ffreestanding -nostdlib -nostdinc -Wl,--defsym=_start=0
39 $(OBJCOPY) -Obinary -j .data linux_trampoline trampoline
40 echo "/* This file is automatically generated. Do not manually change */" > trampoline.c
41 xxd -c 16 -i trampoline >> trampoline.c
Stefan Reinauer0316e1a2015-11-20 17:58:59 +010042 mv trampoline.c linux_trampoline.c
43 rm linux_trampoline trampoline
44
Denis 'GNUtoo' Carikli3ef241f2015-11-11 05:27:25 +010045.PHONY: install
46install: all
47 mkdir -p $(DESTDIR)$(BINDIR)
48 $(INSTALL) cbfstool $(DESTDIR)$(BINDIR)
49 $(INSTALL) fmaptool $(DESTDIR)$(BINDIR)
50 $(INSTALL) rmodtool $(DESTDIR)$(BINDIR)
51 $(INSTALL) ifwitool $(DESTDIR)$(BINDIR)
52 $(INSTALL) cbfs-compression-tool $(DESTDIR)$(BINDIR)
53
Vadim Bendebury98485de2018-11-01 20:48:21 -070054ifneq ($(V),1)
Stefan Reinauer30ff3622015-11-21 17:53:32 +010055.SILENT:
Vadim Bendebury98485de2018-11-01 20:48:21 -070056endif
Stefan Reinauer30ff3622015-11-21 17:53:32 +010057
Patrick Georgiae570d52015-09-16 16:34:15 +020058include Makefile.inc