Fix Makefile to create nuttx.bin instead nuttx.elf.bin when EXEEXT is defined

This commit is contained in:
Alan Carvalho de Assis 2017-02-10 06:59:41 -06:00 committed by Gregory Nutt
parent 47a5389c43
commit 24052710c1
2 changed files with 22 additions and 20 deletions

View File

@ -178,7 +178,8 @@ endif
# This is the name of the final target (relative to the top level directorty) # This is the name of the final target (relative to the top level directorty)
BIN = nuttx$(EXEEXT) NUTTXNAME = nuttx
BIN = $(NUTTXNAME)$(EXEEXT)
all: $(BIN) all: $(BIN)
.PHONY: dirlinks context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean .PHONY: dirlinks context clean_context check_context export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
@ -405,28 +406,28 @@ pass2: pass2deps
cp -f $(BIN) /tftpboot/$(BIN).${CONFIG_ARCH}; \ cp -f $(BIN) /tftpboot/$(BIN).${CONFIG_ARCH}; \
fi fi
ifeq ($(CONFIG_RRLOAD_BINARY),y) ifeq ($(CONFIG_RRLOAD_BINARY),y)
@echo "MK: $(BIN).rr" @echo "MK: $(NUTTXNAME).rr"
$(Q) $(TOPDIR)/tools/mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(BIN).rr $(Q) $(TOPDIR)/tools/mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(NUTTXNAME).rr
$(Q) if [ -w /tftpboot ] ; then \ $(Q) if [ -w /tftpboot ] ; then \
cp -f $(BIN).rr /tftpboot/$(BIN).rr.$(CONFIG_ARCH); \ cp -f $(NUTTXNAME).rr /tftpboot/$(NUTTXNAME).rr.$(CONFIG_ARCH); \
fi fi
endif endif
ifeq ($(CONFIG_INTELHEX_BINARY),y) ifeq ($(CONFIG_INTELHEX_BINARY),y)
@echo "CP: $(BIN).hex" @echo "CP: $(NUTTXNAME).hex"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(BIN).hex $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(NUTTXNAME).hex
endif endif
ifeq ($(CONFIG_MOTOROLA_SREC),y) ifeq ($(CONFIG_MOTOROLA_SREC),y)
@echo "CP: $(BIN).srec" @echo "CP: $(NUTTXNAME).srec"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(BIN).srec $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(NUTTXNAME).srec
endif endif
ifeq ($(CONFIG_RAW_BINARY),y) ifeq ($(CONFIG_RAW_BINARY),y)
@echo "CP: $(BIN).bin" @echo "CP: $(NUTTXNAME).bin"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(BIN).bin $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(NUTTXNAME).bin
endif endif
ifeq ($(CONFIG_UBOOT_UIMAGE),y) ifeq ($(CONFIG_UBOOT_UIMAGE),y)
@echo "MKIMAGE: uImage" @echo "MKIMAGE: uImage"
$(Q) mkimage -A arm -O linux -C none -T kernel -a $(CONFIG_UIMAGE_LOAD_ADDRESS) \ $(Q) mkimage -A arm -O linux -C none -T kernel -a $(CONFIG_UIMAGE_LOAD_ADDRESS) \
-e $(CONFIG_UIMAGE_ENTRY_POINT) -n $(BIN) -d $(BIN).bin uImage -e $(CONFIG_UIMAGE_ENTRY_POINT) -n $(BIN) -d $(NUTTXNAME).bin uImage
$(Q) if [ -w /tftpboot ] ; then \ $(Q) if [ -w /tftpboot ] ; then \
cp -f uImage /tftpboot/uImage; \ cp -f uImage /tftpboot/uImage; \
fi fi

View File

@ -171,7 +171,8 @@ endif
# This is the name of the final target (relative to the top level directorty) # This is the name of the final target (relative to the top level directorty)
BIN = nuttx$(EXEEXT) NUTTXNAME = nuttx
BIN = $(NUTTXNAME)$(EXEEXT)
all: $(BIN) all: $(BIN)
.PHONY: dirlinks context clean_context check_context configenv config oldconfig menuconfig export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean .PHONY: dirlinks context clean_context check_context configenv config oldconfig menuconfig export subdir_clean clean subdir_distclean distclean apps_clean apps_distclean
@ -416,20 +417,20 @@ pass2deps: pass2dep $(NUTTXLIBS)
pass2: pass2deps pass2: pass2deps
$(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(LINKLIBS)" EXTRADEFINES=$(KDEFINE) $(BIN) $(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(LINKLIBS)" EXTRADEFINES=$(KDEFINE) $(BIN)
ifeq ($(CONFIG_RRLOAD_BINARY),y) ifeq ($(CONFIG_RRLOAD_BINARY),y)
@echo "MK: $(BIN).rr" @echo "MK: $(NUTTXNAME).rr"
$(Q) $(TOPDIR)\tools\mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(BIN).rr $(Q) $(TOPDIR)\tools\mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(NUTTXNAME).rr
endif endif
ifeq ($(CONFIG_INTELHEX_BINARY),y) ifeq ($(CONFIG_INTELHEX_BINARY),y)
@echo "CP: $(BIN).hex" @echo "CP: $(NUTTXNAME).hex"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(BIN).hex $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(NUTTXNAME).hex
endif endif
ifeq ($(CONFIG_MOTOROLA_SREC),y) ifeq ($(CONFIG_MOTOROLA_SREC),y)
@echo "CP: $(BIN).srec" @echo "CP: $(NUTTXNAME).srec"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(BIN).srec $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(NUTTXNAME).srec
endif endif
ifeq ($(CONFIG_RAW_BINARY),y) ifeq ($(CONFIG_RAW_BINARY),y)
@echo "CP: $(BIN).bin" @echo "CP: $(NUTTXNAME).bin"
$(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(BIN).bin $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(NUTTXNAME).bin
endif endif
# $(BIN) # $(BIN)