The optimization level can now be selected as part of the configuration

This commit is contained in:
Gregory Nutt 2014-01-24 07:45:35 -06:00
parent 74630ea610
commit 231889c888
7 changed files with 57 additions and 33 deletions

View File

@ -109,6 +109,10 @@ endif
# reliable code generation.
#
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
endif
# NuttX buildroot under Linux or Cygwin
ifeq ($(CONFIG_ARM_TOOLCHAIN),BUILDROOT)
@ -119,7 +123,7 @@ else
CROSSDEV ?= arm-nuttx-eabi-
ARCROSSDEV ?= arm-nuttx-eabi-
endif
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
endif
# CodeSourcery under Linux
@ -127,7 +131,7 @@ endif
ifeq ($(CONFIG_ARM_TOOLCHAIN),CODESOURCERYL)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
endif
# CodeSourcery under Windows
@ -135,7 +139,7 @@ endif
ifeq ($(CONFIG_ARM_TOOLCHAIN),CODESOURCERYW)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
WINTOOL = y
endif
@ -156,7 +160,7 @@ endif
ifeq ($(CONFIG_ARM_TOOLCHAIN),GNU_EABIL)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
endif
# Generic GNU EABI toolchain under Windows
@ -164,7 +168,7 @@ endif
ifeq ($(CONFIG_ARM_TOOLCHAIN),GNU_EABIW)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
WINTOOL = y
endif

View File

@ -96,6 +96,10 @@ endif
# reliable code generation.
#
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
endif
# Atollic toolchain under Windows
ifeq ($(CONFIG_ARMV6M_TOOLCHAIN),ATOLLIC)

View File

@ -90,6 +90,10 @@ endif
# reliable code generation.
#
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
endif
# NuttX buildroot under Linux or Cygwin
ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),BUILDROOT)
@ -100,7 +104,7 @@ else
CROSSDEV ?= arm-nuttx-eabi-
ARCROSSDEV ?= arm-nuttx-eabi-
endif
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
endif
# CodeSourcery under Linux
@ -108,7 +112,7 @@ endif
ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),CODESOURCERYL)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
endif
# CodeSourcery under Windows
@ -116,7 +120,7 @@ endif
ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),CODESOURCERYW)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
WINTOOL = y
endif
@ -137,7 +141,7 @@ endif
ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),GNU_EABIL)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
endif
# Generic GNU EABI toolchain under Windows
@ -145,7 +149,7 @@ endif
ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),GNU_EABIW)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
WINTOOL = y
endif

View File

@ -152,12 +152,16 @@ endif
# reliable code generation.
#
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
endif
# Atollic toolchain under Windows
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),ATOLLIC)
CROSSDEV ?= arm-atollic-eabi-
ARCROSSDEV ?= arm-atollic-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
ifeq ($(CONFIG_ARCH_CORTEXM4),y)
ifeq ($(CONFIG_ARCH_FPU),y)
ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
@ -184,7 +188,7 @@ else
ARCROSSDEV ?= arm-nuttx-eabi-
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
endif
# Code Red RedSuite under Linux
@ -192,7 +196,7 @@ endif
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODEREDL)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
ifeq ($(CONFIG_ARCH_CORTEXM4),y)
ifeq ($(CONFIG_ARCH_FPU),y)
ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
@ -209,7 +213,7 @@ endif
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODEREDW)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
ifeq ($(CONFIG_ARCH_CORTEXM4),y)
ifeq ($(CONFIG_ARCH_FPU),y)
ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
@ -230,7 +234,7 @@ ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODESOURCERYL)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
endif
# CodeSourcery under Windows
@ -238,7 +242,7 @@ endif
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),CODESOURCERYW)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
ifeq ($(CONFIG_ARCH_CORTEXM4),y)
ifeq ($(CONFIG_ARCH_FPU),y)
ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
@ -269,7 +273,7 @@ endif
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),GNU_EABIL)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
ifeq ($(CONFIG_ARCH_CORTEXM4),y)
ifeq ($(CONFIG_ARCH_FPU),y)
ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
@ -286,7 +290,7 @@ endif
ifeq ($(CONFIG_ARMV7M_TOOLCHAIN),GNU_EABIW)
CROSSDEV ?= arm-none-eabi-
ARCROSSDEV ?= arm-none-eabi-
MAXOPTIMIZATION = -Os
MAXOPTIMIZATION ?= -Os
ifeq ($(CONFIG_ARCH_CORTEXM4),y)
ifeq ($(CONFIG_ARCH_FPU),y)
ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard

View File

@ -82,11 +82,15 @@ else
$(error "No valid CONFIG_ARCH_CHIP_ set in the configuration")
endif
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
endif
# NuttX buildroot GCC toolchain under Linux or Cygwin
ifeq ($(CONFIG_AVR_TOOLCHAIN),BUILDROOT)
CROSSDEV ?= avr-nuttx-elf-
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
LDFLAGS += -nostartfiles -nodefaultlibs
endif
@ -94,7 +98,7 @@ endif
ifeq ($(CONFIG_AVR_TOOLCHAIN),CROSSPACK)
CROSSDEV ?= avr-
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
LDFLAGS += -nostartfiles -nodefaultlibs
endif
@ -102,7 +106,7 @@ endif
ifeq ($(CONFIG_AVR_TOOLCHAIN),LINUXGCC)
CROSSDEV ?= avr-
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
LDFLAGS += -nostartfiles -nodefaultlibs
endif
@ -113,7 +117,7 @@ ifeq ($(CONFIG_AVR_TOOLCHAIN),WINAVR)
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
WINTOOL = y
endif
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
LDFLAGS += -nostartfiles -nodefaultlibs
endif

View File

@ -99,12 +99,16 @@ endif
# reliable code generation.
#
ifeq ($(CONFIG_DEBUG_CUSTOMOPT),y)
MAXOPTIMIZATION := $(CONFIG_DEBUG_OPTLEVEL)
endif
# Generic GNU mip32 toolchain on OS X or Linux
# including Pinguino mips-elf toolchain
ifeq ($(CONFIG_MIPS32_TOOLCHAIN),GNU_ELF)
CROSSDEV ?= mips-elf-
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
ARCHCPUFLAGS = -mlong32 -membedded-data -msoft-float -march=24kc -EL
ARCHPICFLAGS = -fpic -membedded-pic
LDFLAGS += -nostartfiles -nodefaultlibs
@ -116,7 +120,7 @@ endif
ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPL)
CROSSDEV ?= pic32-
# CROSSDEV ?= xc32-
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data
ARCHPICFLAGS = -fpic -membedded-pic
LDFLAGS += -nostartfiles -nodefaultlibs
@ -131,7 +135,7 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPW)
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
WINTOOL = y
endif
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data
ARCHPICFLAGS = -fpic -membedded-pic
LDFLAGS += -nostartfiles -nodefaultlibs
@ -143,7 +147,7 @@ endif
ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPL_LITE)
CROSSDEV ?= pic32-
# CROSSDEV ?= xc32-
# MAXOPTIMIZATION = -O2
# MAXOPTIMIZATION ?= -O2
ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data
ARCHPICFLAGS = -fpic -membedded-pic
LDFLAGS += -nostartfiles -nodefaultlibs
@ -158,7 +162,7 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPW_LITE)
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
WINTOOL = y
endif
# MAXOPTIMIZATION = -O2
# MAXOPTIMIZATION ?= -O2
ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data
ARCHPICFLAGS = -fpic -membedded-pic
LDFLAGS += -nostartfiles -nodefaultlibs
@ -169,7 +173,7 @@ endif
ifeq ($(CONFIG_MIPS32_TOOLCHAIN),MICROCHIPOPENL)
CROSSDEV ?= mypic32-
# MAXOPTIMIZATION = -O2
# MAXOPTIMIZATION ?= -O2
ARCHCPUFLAGS = -mprocessor=elf32pic32mx -mno-float -mlong32 -membedded-data
ARCHPICFLAGS = -fpic -membedded-pic
LDFLAGS += -nostartfiles -nodefaultlibs
@ -183,7 +187,7 @@ ifeq ($(CONFIG_MIPS32_TOOLCHAIN),PINGUINOW)
ifneq ($(CONFIG_WINDOWS_NATIVE),y)
WINTOOL = y
endif
MAXOPTIMIZATION = -O2
MAXOPTIMIZATION ?= -O2
ARCHCPUFLAGS = -mlong32 -membedded-data -msoft-float -march=24kc -EL
ARCHPICFLAGS = -fpic -membedded-pic
LDFLAGS += -nostartfiles -nodefaultlibs

View File

@ -128,7 +128,7 @@
/* Most chip variants support external memory */
#ifdef Z16F_HAVE_EXTMEM
# define Z16F_EXTMEMCS0_BASE _HX32(00020000) /* External memory at CS0 */
# define Z16F_EXTMEMCS0_BASE _HX32(00000000) /* External memory at CS0 */
# define Z16F_EXTMEMCS0_SIZE _HX32(007e0000) /* (actual depends on board) */
# define Z16F_EXTMEMCS1_BASE _HX32(ff800000) /* External memory at CS1 */
# define Z16F_EXTMEMCS1_SIZE _HX32(00700000) /* (actual depends on board) */
@ -260,10 +260,10 @@
#define Z16F_OSCCTL_XTLEN _HX8(40) /* Bit 6: Crystal oscillator enabled */
#define Z16F_OSCCTL_WDTEN _HX8(20) /* Bit 5: Watchdog timer enabled */
#define Z16F_OSCCTL_POFEN _HX8(10) /* Bit 4: Failure detection enabled */
#define Z16F_OSCCTL_WDFEN _HX8(08) /* Bit 3: WD Failuare detection enabled*/
#define Z16F_OSCCTL_WDFEN _HX8(08) /* Bit 3: WD Failure detection enabled*/
#define Z16F_OSCCTL_FLPEN _HX8(04) /* Bit 2: Flash low power enabled */
#define Z16F_OSCCTL_INT56 _HX8(00) /* Bits 0-1=0: Intenal 5.6 MHz */
#define Z16F_OSCCTL_EXTCLK _HX8(02) /* Bits 0-1=2: Extenal clock */
#define Z16F_OSCCTL_INT56 _HX8(00) /* Bits 0-1=0: Internal 5.6 MHz */
#define Z16F_OSCCTL_EXTCLK _HX8(02) /* Bits 0-1=2: External clock */
#define Z16F_OSCCTL_WDT10KHZ _HX8(03) /* Bits 0-1=3: WD Timer 10 KHz*/
/* GPIO Port A-K ********************************************************************/