Add support for CodeSourcery and devkitARM toolchains

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1832 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2009-05-28 20:36:04 +00:00
parent 85af36e017
commit 6db38ef16f
5 changed files with 93 additions and 15 deletions

View File

@ -16,12 +16,34 @@ Development Environment
environment because the Luminary FLASH programming application was used for environment because the Luminary FLASH programming application was used for
writing to FLASH and this application works only under Windows. writing to FLASH and this application works only under Windows.
Toolchain GNU Toolchain Options
^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
The NuttX make system has been modified to support the following different
toolchain options.
1. The CodeSourcery GNU toolchain,
2. The devkitARM GNU toolchain, or
3. The NuttX buildroot Toolchain (see below).
All testing has been conducted using the NuttX buildroot toolchain. However,
the make system is setup to default to use the devkitARM toolchain. To use
the CodeSource GNU toolchain, you simply need to build the system as follows:
make # Will build for the devkitARM toolchain
make CROSSDEV=arm-eabi- # Will build for the devkitARM toolchain
make CROSSDEV=arm-none-eabi- # Will build for the CodeSourcery toolchain
make CROSSDEV=arm-elf- # Will build for the NuttX buildroot toolchain
Of course, hard coding this CROSS_COMPILE value in Make.defs file will save
some repetitive typing.
NuttX buildroot Toolchain
^^^^^^^^^^^^^^^^^^^^^^^^^
A GNU GCC-based toolchain is assumed. The files */setenv.sh should A GNU GCC-based toolchain is assumed. The files */setenv.sh should
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
different from the default). different from the default in your PATH variable).
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
SourceForge download site (https://sourceforge.net/project/showfiles.php?group_id=189573). SourceForge download site (https://sourceforge.net/project/showfiles.php?group_id=189573).

View File

@ -35,7 +35,13 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
CROSSDEV = arm-elf- # The default value for CROSSDEV can be overridden from the make command line:
# make -- Will build for the devkitARM toolchain
# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
CROSSDEV = arm-eabi-
CC = $(CROSSDEV)gcc CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++ CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E CPP = $(CROSSDEV)gcc -E
@ -59,7 +65,12 @@ else
ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif endif
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft ifeq ($(CROSSDEV),arm-elf-)
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
else
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
@ -78,7 +89,10 @@ OBJEXT = .o
LIBEXT = .a LIBEXT = .a
EXEEXT = EXEEXT =
ifeq ("${CONFIG_DEBUG}","y") ifneq ($(CROSSDEV),arm-elf-)
LDFLAGS += -nostartfiles -nodefaultlibs
endif
ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g LDFLAGS += -g
endif endif

View File

@ -35,7 +35,13 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
CROSSDEV = arm-elf- # The default value for CROSSDEV can be overridden from the make command line:
# make -- Will build for the devkitARM toolchain
# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
CROSSDEV = arm-eabi-
CC = $(CROSSDEV)gcc CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++ CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E CPP = $(CROSSDEV)gcc -E
@ -59,7 +65,12 @@ else
ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif endif
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft ifeq ($(CROSSDEV),arm-elf-)
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
else
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
@ -78,7 +89,10 @@ OBJEXT = .o
LIBEXT = .a LIBEXT = .a
EXEEXT = EXEEXT =
ifeq ("${CONFIG_DEBUG}","y") ifneq ($(CROSSDEV),arm-elf-)
LDFLAGS += -nostartfiles -nodefaultlibs
endif
ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g LDFLAGS += -g
endif endif

View File

@ -35,7 +35,13 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
CROSSDEV = arm-elf- # The default value for CROSSDEV can be overridden from the make command line:
# make -- Will build for the devkitARM toolchain
# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
CROSSDEV = arm-eabi-
CC = $(CROSSDEV)gcc CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++ CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E CPP = $(CROSSDEV)gcc -E
@ -59,7 +65,12 @@ else
ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif endif
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft ifeq ($(CROSSDEV),arm-elf-)
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
else
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
@ -78,7 +89,10 @@ OBJEXT = .o
LIBEXT = .a LIBEXT = .a
EXEEXT = EXEEXT =
ifeq ("${CONFIG_DEBUG}","y") ifneq ($(CROSSDEV),arm-elf-)
LDFLAGS += -nostartfiles -nodefaultlibs
endif
ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g LDFLAGS += -g
endif endif

View File

@ -35,7 +35,13 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
CROSSDEV = arm-elf- # The default value for CROSSDEV can be overridden from the make command line:
# make -- Will build for the devkitARM toolchain
# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
CROSSDEV = arm-eabi-
CC = $(CROSSDEV)gcc CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++ CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E CPP = $(CROSSDEV)gcc -E
@ -59,7 +65,12 @@ else
ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif endif
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft ifeq ($(CROSSDEV),arm-elf-)
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
else
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
endif
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
@ -78,7 +89,10 @@ OBJEXT = .o
LIBEXT = .a LIBEXT = .a
EXEEXT = EXEEXT =
ifeq ("${CONFIG_DEBUG}","y") ifneq ($(CROSSDEV),arm-elf-)
LDFLAGS += -nostartfiles -nodefaultlibs
endif
ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g LDFLAGS += -g
endif endif