diff --git a/configs/eagle100/README.txt b/configs/eagle100/README.txt index 4182582bd2..36be863590 100644 --- a/configs/eagle100/README.txt +++ b/configs/eagle100/README.txt @@ -16,12 +16,34 @@ Development Environment environment because the Luminary FLASH programming application was used for 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 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 SourceForge download site (https://sourceforge.net/project/showfiles.php?group_id=189573). diff --git a/configs/eagle100/httpd/Make.defs b/configs/eagle100/httpd/Make.defs index 393f936877..cf8e2e98df 100644 --- a/configs/eagle100/httpd/Make.defs +++ b/configs/eagle100/httpd/Make.defs @@ -35,7 +35,13 @@ 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 CXX = $(CROSSDEV)g++ CPP = $(CROSSDEV)gcc -E @@ -59,7 +65,12 @@ else ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer 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 = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -78,7 +89,10 @@ OBJEXT = .o LIBEXT = .a EXEEXT = -ifeq ("${CONFIG_DEBUG}","y") +ifneq ($(CROSSDEV),arm-elf-) + LDFLAGS += -nostartfiles -nodefaultlibs +endif +ifeq ($(CONFIG_DEBUG),y) LDFLAGS += -g endif diff --git a/configs/eagle100/nettest/Make.defs b/configs/eagle100/nettest/Make.defs index c858d506a3..420e639a1e 100644 --- a/configs/eagle100/nettest/Make.defs +++ b/configs/eagle100/nettest/Make.defs @@ -35,7 +35,13 @@ 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 CXX = $(CROSSDEV)g++ CPP = $(CROSSDEV)gcc -E @@ -59,7 +65,12 @@ else ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer 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 = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -78,7 +89,10 @@ OBJEXT = .o LIBEXT = .a EXEEXT = -ifeq ("${CONFIG_DEBUG}","y") +ifneq ($(CROSSDEV),arm-elf-) + LDFLAGS += -nostartfiles -nodefaultlibs +endif +ifeq ($(CONFIG_DEBUG),y) LDFLAGS += -g endif diff --git a/configs/eagle100/nsh/Make.defs b/configs/eagle100/nsh/Make.defs index df915ca594..385694db85 100644 --- a/configs/eagle100/nsh/Make.defs +++ b/configs/eagle100/nsh/Make.defs @@ -35,7 +35,13 @@ 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 CXX = $(CROSSDEV)g++ CPP = $(CROSSDEV)gcc -E @@ -59,7 +65,12 @@ else ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer 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 = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -78,7 +89,10 @@ OBJEXT = .o LIBEXT = .a EXEEXT = -ifeq ("${CONFIG_DEBUG}","y") +ifneq ($(CROSSDEV),arm-elf-) + LDFLAGS += -nostartfiles -nodefaultlibs +endif +ifeq ($(CONFIG_DEBUG),y) LDFLAGS += -g endif diff --git a/configs/eagle100/ostest/Make.defs b/configs/eagle100/ostest/Make.defs index dd785a7260..ee7ba87358 100644 --- a/configs/eagle100/ostest/Make.defs +++ b/configs/eagle100/ostest/Make.defs @@ -35,7 +35,13 @@ 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 CXX = $(CROSSDEV)g++ CPP = $(CROSSDEV)gcc -E @@ -59,7 +65,12 @@ else ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer 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 = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -78,7 +89,10 @@ OBJEXT = .o LIBEXT = .a EXEEXT = -ifeq ("${CONFIG_DEBUG}","y") +ifneq ($(CROSSDEV),arm-elf-) + LDFLAGS += -nostartfiles -nodefaultlibs +endif +ifeq ($(CONFIG_DEBUG),y) LDFLAGS += -g endif