Harmonise filename pattern for the .map file

All map files are now called example-platform.map (e.g. hello-world-native.map).
This commit is contained in:
George Oikonomou 2018-03-30 20:12:31 +01:00
parent 941d8457b4
commit ce540a8bca
6 changed files with 12 additions and 8 deletions

View File

@ -288,6 +288,10 @@ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
rm -f $(@:.o=.$$$$)
endef
### Harmonize filename of a .map file, if the platform's build system wants
### to create one
CONTIKI_NG_PROJECT_MAP = $(addsuffix -$(TARGET).map, $(basename $@))
clean:
-rm -f *~ *core core *.srec \
*.lst *.map *.o \

View File

@ -5,7 +5,7 @@ CFLAGS += -mcpu=cortex-m3
LDFLAGS += -mcpu=cortex-m3 -nostartfiles
LDFLAGS += -T $(LDSCRIPT)
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
LDFLAGS += -Wl,-Map=$(@:.elf=-$(TARGET).map),--cref,--no-warn-mismatch
LDFLAGS += -Wl,-Map=$(CONTIKI_NG_PROJECT_MAP),--cref,--no-warn-mismatch
OBJCOPY_FLAGS += --gap-fill 0xff

View File

@ -75,7 +75,7 @@ CFLAGSNO = --dlib_config "$(IAR_PATH)/LIB/DLIB/dl430xlfn.h" $(CFLAGSWERROR)
# CFLAGSNO = --dlib_config $(IAR_PATH)/LIB/DLIB/dl430xlfn.h -Ohz --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 --core=430X $(CFLAGSWERROR) --data_model large --double=32
endif
LDFLAGSNO += -B -l contiki-$(TARGET).map -s __program_start
LDFLAGSNO += -B -l $(CONTIKI_NG_PROJECT_MAP) -s __program_start
# Stack and heap size in hex
ifndef IAR_STACK_SIZE
IAR_STACK_SIZE=300
@ -165,7 +165,7 @@ ifndef CFLAGSNO
CFLAGSNO = -Wall -mmcu=$(CC_MCU) $(CFLAGSWERROR)
endif
CFLAGS += -Os -fno-strict-aliasing
LDFLAGS += -mmcu=$(CC_MCU) -Wl,-Map=contiki-$(TARGET).map
LDFLAGS += -mmcu=$(CC_MCU) -Wl,-Map=$(CONTIKI_NG_PROJECT_MAP)
### These flags can reduce the code size and RAM usage with up to 10%
SMALL ?= 1
@ -221,7 +221,7 @@ $(COOJA_PATH)/mspsim/mspsim.jar: $(COOJA_PATH)/mspsim/build.xml
java -jar ${COOJA_PATH}/mspsim/mspsim.jar -platform=${TARGET} $<
mspsim-maptable: contiki-${TARGET}.map
java -classpath ${COOJA_PATH}/mspsim/mspsim.jar se.sics.mspsim.util.MapTable $<
java -classpath ${COOJA_PATH}/mspsim/mspsim.jar se.sics.mspsim.util.MapTable $(CONTIKI_NG_PROJECT_MAP)
core-labels.o: core.${TARGET}
${CONTIKI}/tools/msp430-make-labels core.${TARGET} > core-labels.S

View File

@ -21,11 +21,11 @@ CFLAGS += $(CFLAGSNO)
ifeq ($(HOST_OS),Darwin)
AROPTS = -r
LDFLAGS += -Wl,-flat_namespace
LDFLAGS += -Wl,-flat_namespace,-map,$(CONTIKI_NG_PROJECT_MAP)
CFLAGS += -DHAVE_SNPRINTF=1 -U__ASSERT_USE_STDERR
else
ifeq ($(HOST_OS),Linux)
LDFLAGS += -Wl,-Map=contiki-$(TARGET).map,-export-dynamic
LDFLAGS += -Wl,-Map=$(CONTIKI_NG_PROJECT_MAP),-export-dynamic
endif
endif

View File

@ -139,7 +139,7 @@ CFLAGS += -ggdb
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
# keep every function in separate section. This will allow linker to dump unused functions
LDFLAGS += -Xlinker -Map=$(@:.elf=-$(TARGET).map)
LDFLAGS += -Xlinker -Map=$(CONTIKI_NG_PROJECT_MAP)
LDFLAGS += -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT)
LDFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
# let linker to dump unused sections

View File

@ -239,7 +239,7 @@ ifneq ($(wildcard $(SDK_BASE_DIR)/Components/Library/*),)
$(Q)$(CC) -Wl,--gc-sections $(LDFLAGS) -T$(LINKCMD) -o $@ -Wl,--start-group \
$(patsubst /cygdrive/c/%,c:/%,${filter-out %.a,$^}) \
$(patsubst /cygdrive/c/%,c:/%,${filter %.a,$^}) \
$(ALLLIBS) -Wl,--end-group -Wl,-Map,contiki-$(TARGET).map
$(ALLLIBS) -Wl,--end-group -Wl,-Map,$(CONTIKI_NG_PROJECT_MAP)
$(OBJCOPY) -S -O binary $@ $@.bin
else
# The SDK does not include libraries, only build objects and libraries, skip linking