From 24052710c12329d529ce64f73dde8f61e857c11f Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Fri, 10 Feb 2017 06:59:41 -0600 Subject: [PATCH] Fix Makefile to create nuttx.bin instead nuttx.elf.bin when EXEEXT is defined --- Makefile.unix | 23 ++++++++++++----------- Makefile.win | 19 ++++++++++--------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Makefile.unix b/Makefile.unix index d1ee224a67..220740c5bd 100644 --- a/Makefile.unix +++ b/Makefile.unix @@ -178,7 +178,8 @@ endif # This is the name of the final target (relative to the top level directorty) -BIN = nuttx$(EXEEXT) +NUTTXNAME = nuttx +BIN = $(NUTTXNAME)$(EXEEXT) all: $(BIN) .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}; \ fi ifeq ($(CONFIG_RRLOAD_BINARY),y) - @echo "MK: $(BIN).rr" - $(Q) $(TOPDIR)/tools/mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(BIN).rr + @echo "MK: $(NUTTXNAME).rr" + $(Q) $(TOPDIR)/tools/mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(NUTTXNAME).rr $(Q) if [ -w /tftpboot ] ; then \ - cp -f $(BIN).rr /tftpboot/$(BIN).rr.$(CONFIG_ARCH); \ + cp -f $(NUTTXNAME).rr /tftpboot/$(NUTTXNAME).rr.$(CONFIG_ARCH); \ fi endif ifeq ($(CONFIG_INTELHEX_BINARY),y) - @echo "CP: $(BIN).hex" - $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(BIN).hex + @echo "CP: $(NUTTXNAME).hex" + $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(NUTTXNAME).hex endif ifeq ($(CONFIG_MOTOROLA_SREC),y) - @echo "CP: $(BIN).srec" - $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(BIN).srec + @echo "CP: $(NUTTXNAME).srec" + $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(NUTTXNAME).srec endif ifeq ($(CONFIG_RAW_BINARY),y) - @echo "CP: $(BIN).bin" - $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(BIN).bin + @echo "CP: $(NUTTXNAME).bin" + $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(NUTTXNAME).bin endif ifeq ($(CONFIG_UBOOT_UIMAGE),y) @echo "MKIMAGE: uImage" $(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 \ cp -f uImage /tftpboot/uImage; \ fi diff --git a/Makefile.win b/Makefile.win index b15052f16c..feb94d5eb3 100644 --- a/Makefile.win +++ b/Makefile.win @@ -171,7 +171,8 @@ endif # This is the name of the final target (relative to the top level directorty) -BIN = nuttx$(EXEEXT) +NUTTXNAME = nuttx +BIN = $(NUTTXNAME)$(EXEEXT) all: $(BIN) .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 $(Q) $(MAKE) -C $(ARCH_SRC) TOPDIR="$(TOPDIR)" EXTRA_OBJS="$(EXTRA_OBJS)" LINKLIBS="$(LINKLIBS)" EXTRADEFINES=$(KDEFINE) $(BIN) ifeq ($(CONFIG_RRLOAD_BINARY),y) - @echo "MK: $(BIN).rr" - $(Q) $(TOPDIR)\tools\mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(BIN).rr + @echo "MK: $(NUTTXNAME).rr" + $(Q) $(TOPDIR)\tools\mkimage.sh --Prefix $(CROSSDEV) $(BIN) $(NUTTXNAME).rr endif ifeq ($(CONFIG_INTELHEX_BINARY),y) - @echo "CP: $(BIN).hex" - $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(BIN).hex + @echo "CP: $(NUTTXNAME).hex" + $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O ihex $(BIN) $(NUTTXNAME).hex endif ifeq ($(CONFIG_MOTOROLA_SREC),y) - @echo "CP: $(BIN).srec" - $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(BIN).srec + @echo "CP: $(NUTTXNAME).srec" + $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O srec $(BIN) $(NUTTXNAME).srec endif ifeq ($(CONFIG_RAW_BINARY),y) - @echo "CP: $(BIN).bin" - $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(BIN).bin + @echo "CP: $(NUTTXNAME).bin" + $(Q) $(OBJCOPY) $(OBJCOPYARGS) -O binary $(BIN) $(NUTTXNAME).bin endif # $(BIN)