summaryrefslogtreecommitdiff
path: root/util/cbfstool/Makefile
blob: caa8c7daa44e5f519da0a522b0e68b93c0ff19b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
top ?= $(abspath ../..)
objutil ?= $(top)/util

CONFIG_FMD_GENPARSER ?= n

HOSTCC ?= $(CC)
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

.SILENT:

include Makefile.inc