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 |
| 13 | |
Sol Boucher | 0e53931 | 2015-03-05 15:38:03 -0800 | [diff] [blame] | 14 | .PHONY: all |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 15 | all: cbfstool fmaptool rmodtool ifwitool cbfs-compression-tool |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 16 | |
Antonello Dettori | 75c3705 | 2016-06-05 17:26:01 +0200 | [diff] [blame] | 17 | cbfstool: $(objutil)/cbfstool/cbfstool |
| 18 | |
| 19 | fmaptool: $(objutil)/cbfstool/fmaptool |
| 20 | |
| 21 | rmodtool: $(objutil)/cbfstool/rmodtool |
| 22 | |
| 23 | ifwitool: $(objutil)/cbfstool/ifwitool |
| 24 | |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 25 | cbfs-compression-tool: $(objutil)/cbfstool/cbfs-compression-tool |
| 26 | |
| 27 | .PHONY: clean cbfstool fmaptool rmodtool ifwitool cbfs-compression-tool |
Patrick Georgi | b7b56dd8 | 2009-09-14 13:29:27 +0000 | [diff] [blame] | 28 | clean: |
Nico Huber | 37743a9 | 2015-10-22 13:34:06 +0200 | [diff] [blame] | 29 | $(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] | 30 | $(RM) $(objutil)/cbfstool/cbfstool $(cbfsobj) |
| 31 | $(RM) $(objutil)/cbfstool/fmaptool $(fmapobj) |
| 32 | $(RM) $(objutil)/cbfstool/rmodtool $(rmodobj) |
Furquan Shaikh | 233f1b6 | 2016-05-19 16:12:16 -0700 | [diff] [blame] | 33 | $(RM) $(objutil)/cbfstool/ifwitool $(ifwiobj) |
Patrick Georgi | c88d16b | 2017-01-11 15:26:58 +0100 | [diff] [blame] | 34 | $(RM) $(objutil)/cbfstool/cbfs-compression-tool $(cbfscompobj) |
Peter Stuge | 1d862de | 2009-04-14 00:08:34 +0000 | [diff] [blame] | 35 | |
Stefan Reinauer | 0316e1a | 2015-11-20 17:58:59 +0100 | [diff] [blame] | 36 | linux_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 Reinauer | 0316e1a | 2015-11-20 17:58:59 +0100 | [diff] [blame] | 42 | mv trampoline.c linux_trampoline.c |
| 43 | rm linux_trampoline trampoline |
| 44 | |
Denis 'GNUtoo' Carikli | 3ef241f | 2015-11-11 05:27:25 +0100 | [diff] [blame] | 45 | .PHONY: install |
| 46 | install: 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 Bendebury | 98485de | 2018-11-01 20:48:21 -0700 | [diff] [blame] | 54 | ifneq ($(V),1) |
Stefan Reinauer | 30ff362 | 2015-11-21 17:53:32 +0100 | [diff] [blame] | 55 | .SILENT: |
Vadim Bendebury | 98485de | 2018-11-01 20:48:21 -0700 | [diff] [blame] | 56 | endif |
Stefan Reinauer | 30ff362 | 2015-11-21 17:53:32 +0100 | [diff] [blame] | 57 | |
Patrick Georgi | ae570d5 | 2015-09-16 16:34:15 +0200 | [diff] [blame] | 58 | include Makefile.inc |