coreboot-kgpe-d16/util/cbfstool/Makefile
Denis 'GNUtoo' Carikli 3ef241f0c8 cbfstool: Add install target to Makefile
Change-Id: I5df7033e1e52c78e97cdbd26aef2d7824ea67f8b
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/12403
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2018-03-06 22:19:47 +00:00

56 lines
1.6 KiB
Makefile

top ?= $(abspath ../..)
objutil ?= $(top)/util
CONFIG_FMD_GENPARSER ?= n
HOSTCC ?= $(CC)
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
INSTALL ?= /usr/bin/install
OBJCOPY ?= objcopy
VBOOT_SOURCE ?= $(top)/3rdparty/vboot
.PHONY: all
all: cbfstool fmaptool rmodtool ifwitool cbfs-compression-tool
cbfstool: $(objutil)/cbfstool/cbfstool
fmaptool: $(objutil)/cbfstool/fmaptool
rmodtool: $(objutil)/cbfstool/rmodtool
ifwitool: $(objutil)/cbfstool/ifwitool
cbfs-compression-tool: $(objutil)/cbfstool/cbfs-compression-tool
.PHONY: clean cbfstool fmaptool rmodtool ifwitool cbfs-compression-tool
clean:
$(RM) fmd_parser.c fmd_parser.h fmd_scanner.c fmd_scanner.h
$(RM) $(objutil)/cbfstool/cbfstool $(cbfsobj)
$(RM) $(objutil)/cbfstool/fmaptool $(fmapobj)
$(RM) $(objutil)/cbfstool/rmodtool $(rmodobj)
$(RM) $(objutil)/cbfstool/ifwitool $(ifwiobj)
$(RM) $(objutil)/cbfstool/cbfs-compression-tool $(cbfscompobj)
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
xxd -c 16 -i trampoline >> trampoline.c
mv trampoline.c linux_trampoline.c
rm linux_trampoline trampoline
.PHONY: install
install: all
mkdir -p $(DESTDIR)$(BINDIR)
$(INSTALL) cbfstool $(DESTDIR)$(BINDIR)
$(INSTALL) fmaptool $(DESTDIR)$(BINDIR)
$(INSTALL) rmodtool $(DESTDIR)$(BINDIR)
$(INSTALL) ifwitool $(DESTDIR)$(BINDIR)
$(INSTALL) cbfs-compression-tool $(DESTDIR)$(BINDIR)
.SILENT:
include Makefile.inc