From 2e075ad4138324f0df28e51a52e5553a91ebd189 Mon Sep 17 00:00:00 2001 From: Anup Patel Date: Wed, 13 Jul 2011 16:30:04 +0530 Subject: [PATCH] Added .bin file generation for .elf files for convinence in Makefile. Signed-off-by: Anup Patel --- ports/armv7a/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/armv7a/Makefile b/ports/armv7a/Makefile index a066851..edf7242 100644 --- a/ports/armv7a/Makefile +++ b/ports/armv7a/Makefile @@ -74,8 +74,10 @@ build_objs = $(foreach obj,$(objs),$(build_dir)/$(obj)) # Target application filenames .elf for each test object tobjs = $(notdir $(patsubst %.c,%.o,$(wildcard $(tests_dir)/*.c))) telfs = $(patsubst %.o,%.elf,$(tobjs)) +tbins = $(patsubst %.o,%.bin,$(tobjs)) build_tobjs = $(foreach tobj,$(tobjs),$(build_dir)/$(tobj)) build_telfs = $(foreach telf,$(telfs),$(build_dir)/$(telf)) +build_tbins = $(foreach tbin,$(tbins),$(build_dir)/$(tbin)) # GCC flags CFLAGS= -g \ @@ -98,7 +100,12 @@ endif # All .PHONY: all -all: $(build_telfs) $(build_tobjs) $(build_objs) Makefile +all: $(build_tbins) $(build_telfs) $(build_tobjs) $(build_objs) Makefile + +$(build_dir)/%.bin: $(build_dir)/%.elf + $(V)mkdir -p `dirname $@` + $(if $(V), @echo " (OBJCOPY) $(subst $(build_dir)/,,$@)") + $(V)$(OBJCOPY) -O binary $< $@ $(build_dir)/%.elf: $(build_dir)/%.o $(build_objs) $(V)mkdir -p `dirname $@`