summaryrefslogtreecommitdiff
path: root/nuttx/configs/olimex-lpc2378/ostest/Make.defs
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-08-10 03:22:43 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-08-10 03:22:43 +0000
commite4b376b426cbf0da2183bb728896a1a7f0e9d1ce (patch)
tree4439df37c4dce606e00dd0de60c8141fdf9e2cf1 /nuttx/configs/olimex-lpc2378/ostest/Make.defs
parente9955a812ad5fdcfde626f5984c6faa1c5f1a398 (diff)
downloadpx4-nuttx-e4b376b426cbf0da2183bb728896a1a7f0e9d1ce.tar.gz
px4-nuttx-e4b376b426cbf0da2183bb728896a1a7f0e9d1ce.tar.bz2
px4-nuttx-e4b376b426cbf0da2183bb728896a1a7f0e9d1ce.zip
Add support for CodeSourcery Linux toolchain
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2834 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs/olimex-lpc2378/ostest/Make.defs')
-rwxr-xr-xnuttx/configs/olimex-lpc2378/ostest/Make.defs88
1 files changed, 51 insertions, 37 deletions
diff --git a/nuttx/configs/olimex-lpc2378/ostest/Make.defs b/nuttx/configs/olimex-lpc2378/ostest/Make.defs
index b025fd1bb..bb44dce7d 100755
--- a/nuttx/configs/olimex-lpc2378/ostest/Make.defs
+++ b/nuttx/configs/olimex-lpc2378/ostest/Make.defs
@@ -40,48 +40,62 @@
include ${TOPDIR}/.config
-# The default value for CROSSDEV can be overridden from the make command line:
-# make -- Will build for the NuttX buildroot 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-elf-
-CC = $(CROSSDEV)gcc
-CXX = $(CROSSDEV)g++
-CPP = $(CROSSDEV)gcc -E
-LD = $(CROSSDEV)ld
-AR = $(CROSSDEV)ar rcs
-NM = $(CROSSDEV)nm
-OBJCOPY = $(CROSSDEV)objcopy
-OBJDUMP = $(CROSSDEV)objdump
-
-HOSTOS = ${shell uname -o}
-
-ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
-ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
+# Setup for the selected toolchain
-ifeq ($(ARCHCCMAJOR),4)
-ifneq ($(HOSTOS),Cygwin)
-OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment
+ifeq ($(CONFIG_OLIMEX_LPC2378_CODESOURCERYW),y)
+ # CodeSourcery under Windows
+ CROSSDEV = arm-none-eabi-
+ WINTOOL = y
+ MAXOPTIMIZATION = -O2
+endif
+ifeq ($(CONFIG_OLIMEX_LPC2378_CODESOURCERYL),y)
+ # CodeSourcery under Linux
+ CROSSDEV = arm-none-eabi-
+ MAXOPTIMIZATION = -O2
endif
+ifeq ($(CONFIG_OLIMEX_LPC2378_DEVKITARM),y)
+ # devkitARM under Windows
+ CROSSDEV = arm-eabi-
+ WINTOOL = y
+endif
+ifeq ($(CONFIG_OLIMEX_LPC2378_BUILDROOT),y)
+ # NuttX buildroot under Linux or Cygwin
+ CROSSDEV = arm-elf-
+ MAXOPTIMIZATION = -Os
endif
-ifeq ($(CROSSDEV),arm-elf-)
- MKDEP = $(TOPDIR)/tools/mkdeps.sh
- ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
- ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
- MAXOPTIMIZATION = -Os
+ifeq ($(WINTOOL),y)
+ # Windows-native toolchains
+ DIRLINK = $(TOPDIR)/tools/winlink.sh
+ DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+ MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+ ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
else
- WINTOOL = y
- DIRLINK = $(TOPDIR)/tools/winlink.sh
- DIRUNLINK = $(TOPDIR)/tools/unlink.sh
- MKDEP = $(TOPDIR)/tools/mknulldeps.sh
- ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
- ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
- MAXOPTIMIZATION = -O2
+ # Linux/Cygwin-native toolchain
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh
+ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
+endif
+
+CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
+CPP = $(CROSSDEV)gcc -E
+LD = $(CROSSDEV)ld
+AR = $(CROSSDEV)ar rcs
+NM = $(CROSSDEV)nm
+OBJCOPY = $(CROSSDEV)objcopy
+OBJDUMP = $(CROSSDEV)objdump
+
+ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
+ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
+
+ifeq ($(ARCHCCMAJOR),4)
+ifneq ($(HOSTOS),Cygwin)
+OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment
+endif
endif
ifeq ("${CONFIG_DEBUG}","y")