Added support for mspgcc 4.6+ that no longer supports generic MCU identifiers such as msp430x1611

This commit is contained in:
Niclas Finne 2012-04-10 16:05:10 +02:00
parent 57a166c3db
commit 1b13b69814
7 changed files with 50 additions and 23 deletions

View file

@ -11,19 +11,24 @@ CONTIKI_CPU=$(CONTIKI)/cpu/msp430
### Define the source files we have in the MSP430 port
ifneq (,$(findstring msp430x1,$(MCU)))
CONTIKI_CPU_FAM_DIR = f1xxx
else
ifneq (,$(findstring msp430x5,$(MCU)))
CONTIKI_CPU_FAM_DIR = f5xxx
else
ifneq (,$(findstring msp430x2,$(MCU)))
CONTIKI_CPU_FAM_DIR = f2xxx f1xxx
else
${error Unhandled MSP430 family: "$(MCU)"}
endif
ifndef CONTIKI_CPU_FAM_DIR
ifneq (,$(findstring msp430f1,$(MCU)))
CONTIKI_CPU_FAM_DIR = f1xxx
endif
endif
ifndef CONTIKI_CPU_FAM_DIR
ifneq (,$(findstring msp430f5,$(MCU)))
CONTIKI_CPU_FAM_DIR = f5xxx
endif
endif
ifndef CONTIKI_CPU_FAM_DIR
ifneq (,$(findstring msp430f2,$(MCU)))
CONTIKI_CPU_FAM_DIR = f2xxx f1xxx
endif
endif
ifndef CONTIKI_CPU_FAM_DIR
${error Unhandled MSP430 family: "$(MCU)"}
endif
CONTIKI_CPU_DIRS = $(CONTIKI_CPU_FAM_DIR) . dev
@ -54,9 +59,9 @@ STRIP = strip
ifndef IAR_PATH
# This works with cygwin...
IAR_BIN_PATH = $(shell dirname "`which $(CC)`")
IAR_PATH_C = $(shell dirname "$(IAR_BIN_PATH)")
IAR_PATH = $(shell cygpath -m "$(IAR_PATH_C)")
IAR_BIN_PATH := $(shell dirname "`which $(CC)`")
IAR_PATH_C := $(shell dirname "$(IAR_BIN_PATH)")
IAR_PATH := $(shell cygpath -m "$(IAR_PATH_C)")
endif
CFLAGS += --diag_suppress=Pa050 --silent
@ -101,11 +106,33 @@ NM = msp430-nm
OBJCOPY = msp430-objcopy
STRIP = msp430-strip
BSL = msp430-bsl
# From version 4.6.x, mspgcc does not support generic MCU identifiers such as
# msp430x1611 in contrast to msp430f1611
ifndef CC_MCU
ifndef MSPGCC_VERSION
MSPGCC_VERSION := ${shell $(CC) -dumpversion}
endif
endif
ifndef CC_MCU
ifneq (,$(findstring 4.4.,$(MSPGCC_VERSION)))
CC_MCU := ${subst msp430f,msp430x,$(MCU)}
endif
endif
ifndef CC_MCU
ifneq (,$(findstring 3.2.,$(MSPGCC_VERSION)))
CC_MCU := ${subst msp430f,msp430x,$(MCU)}
endif
endif
ifndef CC_MCU
CC_MCU := $(MCU)
endif
ifndef CFLAGSNO
CFLAGSNO = -Wall -mmcu=$(MCU) -g $(CFLAGSWERROR)
CFLAGSNO = -Wall -mmcu=$(CC_MCU) -g $(CFLAGSWERROR)
endif
CFLAGS += -Os -fno-strict-aliasing
LDFLAGS += -mmcu=$(MCU) -Wl,-Map=contiki-$(TARGET).map
LDFLAGS += -mmcu=$(CC_MCU) -Wl,-Map=contiki-$(TARGET).map
### These flags can reduce the code size and RAM usage with up to 10%
ifeq ($(SMALL),1)

View file

@ -50,7 +50,7 @@ endif
include $(CONTIKI)/platform/$(TARGET)/apps/Makefile.apps
MCU=msp430x149
MCU=msp430f149
include $(CONTIKI)/cpu/msp430/Makefile.msp430
ifdef IAR

View file

@ -47,9 +47,9 @@ endif
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
ifdef IAR
MCU=msp430x5438a
MCU=msp430f5438a
else
MCU=msp430x5438
MCU=msp430f5438
endif
include $(CONTIKI)/cpu/msp430/Makefile.msp430

View file

@ -12,7 +12,7 @@ endif
CONTIKI_TARGET_SOURCEFILES += $(SENSORS) $(MSB) $(CONTIKI_TARGET_MAIN)
MCU=msp430x1612
MCU=msp430f1612
include $(CONTIKI)/cpu/msp430/Makefile.msp430
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}

View file

@ -21,7 +21,7 @@ endif
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
MCU=msp430x1611
MCU=msp430f1611
include $(CONTIKI)/cpu/msp430/Makefile.msp430
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}

View file

@ -30,7 +30,7 @@ endif
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
MCU=msp430x5437
MCU=msp430f5437
include $(CONTIKI)/cpu/msp430/Makefile.msp430
ifdef IAR

View file

@ -36,7 +36,7 @@ endif
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c
MCU=msp430x2617
MCU=msp430f2617
include $(CONTIKI)/cpu/msp430/Makefile.msp430
# Add LDFLAGS after IAR_PATH is set