| top ?= $(abspath ../..) |
| objutil ?= $(top)/util |
| |
| CONFIG_FMD_GENPARSER := y |
| |
| HOSTCC ?= $(CC) |
| OBJCOPY ?= objcopy |
| |
| .PHONY: all |
| all: $(objutil)/cbfstool/cbfstool \ |
| $(objutil)/cbfstool/fmaptool \ |
| $(objutil)/cbfstool/rmodtool \ |
| |
| .PHONY: clean |
| 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) |
| |
| 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 |
| perl -pi -e 's,unsigned int.*$$,,g;s,unsigned char,const unsigned char,g' trampoline.c |
| echo "const void * const trampoline_start = &trampoline;" >> trampoline.c |
| echo "const unsigned long trampoline_size = sizeof trampoline;" >> trampoline.c |
| mv trampoline.c linux_trampoline.c |
| rm linux_trampoline trampoline |
| |
| .SILENT: |
| |
| include Makefile.inc |