2012-07-12 02:52:59 +08:00
|
|
|
############################################################################
|
|
|
|
# configs/lpc4330-xplorer/nsh/Make.defs
|
|
|
|
#
|
|
|
|
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
include ${TOPDIR}/.config
|
2012-08-27 22:07:17 +08:00
|
|
|
include ${TOPDIR}/tools/Config.mk
|
2012-11-22 02:34:10 +08:00
|
|
|
include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
|
2012-07-12 02:52:59 +08:00
|
|
|
|
|
|
|
# Setup for the kind of memory that we are executing from
|
|
|
|
|
2013-07-24 03:54:49 +08:00
|
|
|
ifeq ($(CONFIG_LPC43_BOOT_SRAM),y)
|
2012-07-12 02:52:59 +08:00
|
|
|
LDSCRIPT = ramconfig.ld
|
|
|
|
endif
|
2013-07-24 03:54:49 +08:00
|
|
|
ifeq ($(CONFIG_LPC43_BOOT_SPIFI),y)
|
2012-08-03 22:57:30 +08:00
|
|
|
LDSCRIPT = spificonfig.ld
|
2012-07-12 02:52:59 +08:00
|
|
|
endif
|
2013-07-24 03:54:49 +08:00
|
|
|
ifeq ($(CONFIG_LPC43_BOOT_FLASHA),y)
|
2012-07-12 02:52:59 +08:00
|
|
|
LDSCRIPT = flashaconfig.ld
|
|
|
|
endif
|
2013-07-24 03:54:49 +08:00
|
|
|
ifeq ($(CONFIG_LPC43_BOOT_FLASHB),y)
|
2012-07-12 02:52:59 +08:00
|
|
|
LDSCRIPT = flashaconfig.ld
|
|
|
|
endif
|
2013-07-24 03:54:49 +08:00
|
|
|
ifeq ($(CONFIG_LPC43_BOOT_CS0FLASH),y)
|
2012-07-12 02:52:59 +08:00
|
|
|
LDSCRIPT = cs0flash.ld
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Setup for Windows vs Linux/Cygwin/OSX environments
|
|
|
|
|
|
|
|
ifeq ($(WINTOOL),y)
|
|
|
|
# Windows-native toolchains
|
2012-12-09 00:37:43 +08:00
|
|
|
DIRLINK = $(TOPDIR)/tools/copydir.sh
|
2012-07-12 02:52:59 +08:00
|
|
|
DIRUNLINK = $(TOPDIR)/tools/unlink.sh
|
2016-01-10 04:13:44 +08:00
|
|
|
MKDEP = $(TOPDIR)/tools/mkwindeps.sh
|
2012-07-12 02:52:59 +08:00
|
|
|
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)/scripts/$(LDSCRIPT)}"
|
|
|
|
else
|
2014-04-14 06:22:22 +08:00
|
|
|
# Linux/Cygwin-native toolchain
|
2016-01-10 06:06:15 +08:00
|
|
|
MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
|
2012-07-12 02:52:59 +08:00
|
|
|
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
|
|
|
|
ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
|
|
|
|
ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CC = $(CROSSDEV)gcc
|
|
|
|
CXX = $(CROSSDEV)g++
|
|
|
|
CPP = $(CROSSDEV)gcc -E
|
|
|
|
LD = $(CROSSDEV)ld
|
|
|
|
AR = $(ARCROSSDEV)ar rcs
|
|
|
|
NM = $(ARCROSSDEV)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}
|
|
|
|
|
2012-11-16 02:33:18 +08:00
|
|
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
2012-07-12 02:52:59 +08:00
|
|
|
ARCHOPTIMIZATION = -g
|
2013-12-21 03:23:42 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
|
|
|
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
|
2012-07-12 02:52:59 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ARCHCFLAGS = -fno-builtin
|
2016-08-22 14:35:01 +08:00
|
|
|
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
|
2015-09-02 00:02:36 +08:00
|
|
|
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
|
|
|
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
|
2012-07-12 02:52:59 +08:00
|
|
|
ARCHDEFINES =
|
|
|
|
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
|
|
|
|
|
|
|
|
CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
|
|
|
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
|
|
|
CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
|
|
|
|
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
|
|
|
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
|
|
|
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
|
|
|
|
|
|
|
|
NXFLATLDFLAGS1 = -r -d -warn-common
|
2012-10-11 01:01:23 +08:00
|
|
|
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
2012-07-12 02:52:59 +08:00
|
|
|
LDNXFLATFLAGS = -e main -s 2048
|
|
|
|
|
2015-09-05 06:42:34 +08:00
|
|
|
ASMEXT = .S
|
2012-07-12 02:52:59 +08:00
|
|
|
OBJEXT = .o
|
|
|
|
LIBEXT = .a
|
|
|
|
EXEEXT =
|
|
|
|
|
2012-10-06 07:01:51 +08:00
|
|
|
ifneq ($(CROSSDEV),arm-nuttx-elf-)
|
2012-07-12 02:52:59 +08:00
|
|
|
LDFLAGS += -nostartfiles -nodefaultlibs
|
|
|
|
endif
|
|
|
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
|
|
|
LDFLAGS += -g
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
HOSTCC = gcc
|
|
|
|
HOSTINCLUDES = -I.
|
2015-09-02 00:02:36 +08:00
|
|
|
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
|
2012-07-12 02:52:59 +08:00
|
|
|
HOSTLDFLAGS =
|
|
|
|
|