1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Move .elf file to it's own target

This commit is contained in:
Martin Lenders 2014-05-03 15:21:29 +02:00
parent c710062f86
commit 85b7eca19e

View File

@ -65,15 +65,7 @@ BASELIBS += $(USEPKG:%=${BINDIR}%.a)
.PHONY: all clean flash doc term objsize buildsize buildsizes buildsizes-diff
## make script for your application. Build RIOT-base here!
all: $(BINDIR)$(PROJECT).a
@echo "Building application $(PROJECT) for $(BOARD) w/ MCU $(MCU)."
"$(MAKE)" -C $(RIOTBOARD)/$(BOARD)
"$(MAKE)" -C $(RIOTBASE)
ifeq ($(BUILDOSXNATIVE),1)
$(AD)$(LINK) $(UNDEF) -o $(BINDIR)$(PROJECT).elf $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
else
$(AD)$(LINK) $(UNDEF) -o $(BINDIR)$(PROJECT).elf -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(BINDIR)$(PROJECT).map $(LINKFLAGS)
endif
all: $(BINDIR)$(PROJECT).elf
$(AD)$(SIZE) $(BINDIR)$(PROJECT).elf
$(AD)$(OBJCOPY) $(OFLAGS) $(BINDIR)$(PROJECT).elf $(BINDIR)$(PROJECT).hex
@ -88,6 +80,16 @@ SRC = $(wildcard *.c)
# string array of all names replaced .c with .o
OBJ = $(SRC:%.c=${BINDIR}${PROJECT}/%.o)
$(BINDIR)$(PROJECT).elf: $(BINDIR)$(PROJECT).a
@echo "Building application $(PROJECT) for $(BOARD) w/ MCU $(MCU)."
"$(MAKE)" -C $(RIOTBOARD)/$(BOARD)
"$(MAKE)" -C $(RIOTBASE)
ifeq ($(BUILDOSXNATIVE),1)
$(AD)$(LINK) $(UNDEF) -o $@ $(BASELIBS) $(LINKFLAGS) -Wl,-no_pie
else
$(AD)$(LINK) $(UNDEF) -o $@ -Wl,--start-group $(BASELIBS) -lm -Wl,--end-group -Wl,-Map=$(BINDIR)$(PROJECT).map $(LINKFLAGS)
endif
$(BINDIR)$(PROJECT).a: $(OBJ)
$(AD)$(AR) -rc $(BINDIR)$(PROJECT).a $(OBJ)