From edb0e01dfd9c38b826ec038ff7b8387e8ce0bd21 Mon Sep 17 00:00:00 2001 From: px4dev Date: Sun, 12 May 2013 14:04:57 -0700 Subject: HOTFIX: simplify symbol names going into the ROMFS object, hopefully this avoids inconsistent symbol naming on Windows. --- Makefile | 9 +++++++-- makefiles/firmware.mk | 2 +- makefiles/toolchain_gnu-arm-eabi.mk | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 224910e0f..1d1287b7f 100644 --- a/Makefile +++ b/Makefile @@ -159,11 +159,11 @@ $(NUTTX_ARCHIVES): $(ARCHIVE_DIR)%.export: $(NUTTX_SRC) $(NUTTX_APPS) .PHONY: clean clean: $(Q) $(RMDIR) $(BUILD_DIR)*.build - $(Q) $(REMOVE) -f $(IMAGE_DIR)*.px4 + $(Q) $(REMOVE) $(IMAGE_DIR)*.px4 .PHONY: distclean distclean: clean - $(Q) $(REMOVE) -f $(ARCHIVE_DIR)*.export + $(Q) $(REMOVE) $(ARCHIVE_DIR)*.export $(Q) make -C $(NUTTX_SRC) -r $(MQUIET) distclean # @@ -196,6 +196,11 @@ help: @echo " distclean" @echo " Remove all compilation products, including NuttX RTOS archives." @echo "" + @echo " upload" + @echo " When exactly one config is being built, add this target to upload the" + @echo " firmware to the board when the build is complete. Not supported for" + @echo " all configurations." + @echo "" @echo " Common options:" @echo " ---------------" @echo "" diff --git a/makefiles/firmware.mk b/makefiles/firmware.mk index 6fa0ae3eb..7afa3e787 100644 --- a/makefiles/firmware.mk +++ b/makefiles/firmware.mk @@ -280,7 +280,7 @@ ifeq ($(ROMFS_FILES),) $(error ROMFS_ROOT $(ROMFS_ROOT) specifies a directory containing no files) endif ROMFS_DEPS += $(ROMFS_FILES) -ROMFS_IMG = $(WORK_DIR)romfs.img +ROMFS_IMG = romfs.img ROMFS_CSRC = $(ROMFS_IMG:.img=.c) ROMFS_OBJ = $(ROMFS_CSRC:.c=.o) LIBS += $(ROMFS_OBJ) diff --git a/makefiles/toolchain_gnu-arm-eabi.mk b/makefiles/toolchain_gnu-arm-eabi.mk index 0e651e53c..874e7154c 100644 --- a/makefiles/toolchain_gnu-arm-eabi.mk +++ b/makefiles/toolchain_gnu-arm-eabi.mk @@ -254,6 +254,20 @@ endef # - relink the object and insert the binary file # - edit symbol names to suit # +# NOTE: exercise caution using this with absolute pathnames; it looks +# like the MinGW tools insert an extra _ in the binary symbol name; e.g. +# the path: +# +# /d/px4/firmware/Build/px4fmu_default.build/romfs.img +# +# is assigned symbols like: +# +# _binary_d__px4_firmware_Build_px4fmu_default_build_romfs_img_size +# +# when we would expect +# +# _binary__d_px4_firmware_Build_px4fmu_default_build_romfs_img_size +# define BIN_SYM_PREFIX _binary_$(subst /,_,$(subst .,_,$1)) endef @@ -267,4 +281,5 @@ define BIN_TO_OBJ --redefine-sym $(call BIN_SYM_PREFIX,$1)_start=$3 \ --redefine-sym $(call BIN_SYM_PREFIX,$1)_size=$3_len \ --strip-symbol $(call BIN_SYM_PREFIX,$1)_end + $(Q) $(REMOVE) $2.c $2.c.o endef -- cgit v1.2.3