diff --git a/configs/cloudctrl/nsh/Make.defs b/configs/cloudctrl/nsh/Make.defs index a33f8d31742..2b530294717 100644 --- a/configs/cloudctrl/nsh/Make.defs +++ b/configs/cloudctrl/nsh/Make.defs @@ -35,63 +35,7 @@ include ${TOPDIR}/.config include ${TOPDIR}/tools/Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_STM32_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- - WINTOOL = y - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif -ifeq ($(CONFIG_STM32_CODESOURCERYL),y) - # CodeSourcery under Linux - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft - MAXOPTIMIZATION = -O2 -endif -ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) - # Atollic toolchain under Windows - CROSSDEV = arm-atollic-eabi- - ARCROSSDEV = - WINTOOL = y - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif -ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) - # Atollic toolchain under Windows - CROSSDEV = arm-atollic-eabi- - ARCROSSDEV = arm-atollic-eabi- - WINTOOL = y - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif -ifeq ($(CONFIG_STM32_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - ARCROSSDEV = arm-eabi- - WINTOOL = y - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif -ifeq ($(CONFIG_STM32_RAISONANCE),y) - # Raisonance RIDE7 under Windows - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- - WINTOOL = y - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif -ifeq ($(CONFIG_STM32_BUILDROOT),y) - # NuttX buildroot under Linux or Cygwin - # OABI - # CROSSDEV = arm-nuttx-elf- - # ARCROSSDEV = arm-nuttx-elf- - # ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft - # EABI - CROSSDEV = arm-nuttx-eabi- - ARCROSSDEV = arm-nuttx-eabi- - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft - MAXOPTIMIZATION = -Os -endif +include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs # Pick the linker script diff --git a/configs/stm32f4discovery/src/Makefile b/configs/stm32f4discovery/src/Makefile index 82ea0d1ddaa..68419e5d0eb 100644 --- a/configs/stm32f4discovery/src/Makefile +++ b/configs/stm32f4discovery/src/Makefile @@ -35,83 +35,87 @@ -include $(TOPDIR)/Make.defs -CFLAGS += -I$(TOPDIR)/sched +CFLAGS += -I$(TOPDIR)/sched -ASRCS = -AOBJS = $(ASRCS:.S=$(OBJEXT)) +ASRCS = +AOBJS = $(ASRCS:.S=$(OBJEXT)) -CSRCS = up_boot.c up_spi.c +CSRCS = up_boot.c up_spi.c ifeq ($(CONFIG_HAVE_CXX),y) -CSRCS += up_cxxinitialize.c +CSRCS += up_cxxinitialize.c endif ifeq ($(CONFIG_ARCH_LEDS),y) -CSRCS += up_autoleds.c +CSRCS += up_autoleds.c else -CSRCS += up_userleds.c +CSRCS += up_userleds.c endif ifeq ($(CONFIG_ARCH_BUTTONS),y) -CSRCS += up_buttons.c +CSRCS += up_buttons.c endif ifeq ($(CONFIG_STM32_OTGFS),y) -CSRCS += up_usb.c +CSRCS += up_usb.c endif ifeq ($(CONFIG_PWM),y) -CSRCS += up_pwm.c +CSRCS += up_pwm.c endif ifeq ($(CONFIG_QENCODER),y) -CSRCS += up_qencoder.c +CSRCS += up_qencoder.c endif ifeq ($(CONFIG_WATCHDOG),y) -CSRCS += up_watchdog.c +CSRCS += up_watchdog.c endif ifeq ($(CONFIG_NSH_ARCHINIT),y) -CSRCS += up_nsh.c +CSRCS += up_nsh.c endif ifeq ($(CONFIG_PM_CUSTOMINIT),y) -CSRCS += up_pm.c +CSRCS += up_pm.c endif ifeq ($(CONFIG_PM_BUTTONS),y) -CSRCS += up_pmbuttons.c +CSRCS += up_pmbuttons.c endif ifeq ($(CONFIG_IDLE_CUSTOM),y) -CSRCS += up_idle.c +CSRCS += up_idle.c endif ifeq ($(CONFIG_STM32_FSMC),y) -CSRCS += up_extmem.c +CSRCS += up_extmem.c ifeq ($(CONFIG_LCD_SSD1289),y) -CSRCS += up_ssd1289.c +CSRCS += up_ssd1289.c endif endif ifeq ($(CONFIG_LCD_UG2864AMBAG01),y) -CSRCS += up_ug2864ambag01.c +CSRCS += up_ug2864ambag01.c endif -COBJS = $(CSRCS:.c=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) -ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src -ifeq ($(WINTOOL),y) - CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ - -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}" +ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(ARCH_SRCDIR)\armv7-m else - CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m +ifeq ($(WINTOOL),y) + CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \ + -I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}" +else + CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m +endif endif all: libboard$(LIBEXT) diff --git a/configs/stm32f4discovery/winbuild/Make.defs b/configs/stm32f4discovery/winbuild/Make.defs index 2d9e4f1e2a4..5a99ad199f0 100644 --- a/configs/stm32f4discovery/winbuild/Make.defs +++ b/configs/stm32f4discovery/winbuild/Make.defs @@ -35,52 +35,10 @@ include ${TOPDIR}\.config include ${TOPDIR}\tools\Config.mk - -# Setup for the selected toolchain - -ifeq ($(CONFIG_STM32_CODESOURCERYW),y) - # CodeSourcery under Windows - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif -ifeq ($(CONFIG_STM32_ATOLLIC_LITE),y) - # Atollic toolchain under Windows - CROSSDEV = arm-atollic-eabi- - ARCROSSDEV = -ifeq ($(CONFIG_ARCH_FPU),y) - ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard -else - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif -endif -ifeq ($(CONFIG_STM32_ATOLLIC_PRO),y) - # Atollic toolchain under Windows - CROSSDEV = arm-atollic-eabi- - ARCROSSDEV = arm-atollic-eabi- -ifeq ($(CONFIG_ARCH_FPU),y) - ARCHCPUFLAGS = -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard -else - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif -endif -ifeq ($(CONFIG_STM32_DEVKITARM),y) - # devkitARM under Windows - CROSSDEV = arm-eabi- - ARCROSSDEV = arm-eabi- - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif -ifeq ($(CONFIG_STM32_RAISONANCE),y) - # Raisonance RIDE7 under Windows - CROSSDEV = arm-none-eabi- - ARCROSSDEV = arm-none-eabi- - ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -endif +include ${TOPDIR}\arch\arm\src\armv7-m\Toolchain.defs LDSCRIPT = ld.script -# Windows-native toolchains - ARCHINCLUDES = -I. -isystem $(TOPDIR)\include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)\include -isystem $(TOPDIR)\include\cxx ARCHSCRIPT = -T$(TOPDIR)\configs\$(CONFIG_ARCH_BOARD)\scripts\$(LDSCRIPT) diff --git a/configs/stm32f4discovery/winbuild/setenv.bat b/configs/stm32f4discovery/winbuild/setenv.bat index b4580f778dd..22fa1e599bb 100755 --- a/configs/stm32f4discovery/winbuild/setenv.bat +++ b/configs/stm32f4discovery/winbuild/setenv.bat @@ -32,9 +32,6 @@ rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE rem POSSIBILITY OF SUCH DAMAGE. -rem This script is not needed for setting the path because the full path -rem to the ZDI-II tools are used in Make.defs. - rem This is the location where I installed in the MinGW compiler. With rem this configuration, it is recommended that you do NOT install the rem MSYS tools; they conflict with the GNUWin32 tools. See @@ -42,6 +39,11 @@ rem http://www.mingw.org/ for further info. set PATH=C:\MinGW\bin;%PATH% +rem This is the location where I installed the CodeSourcey toolchain. See +rem http://www.mentor.com/embedded-software/codesourcery + +set PATH=C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite\bin;%PATH% + rem This is the location where I installed the GNUWin32 tools. See rem http://gnuwin32.sourceforge.net/.