mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Some initial changes for 8051 build update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5423 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+114
-28
@@ -36,49 +36,135 @@
|
|||||||
include ${TOPDIR}/.config
|
include ${TOPDIR}/.config
|
||||||
include ${TOPDIR}/tools/Config.mk
|
include ${TOPDIR}/tools/Config.mk
|
||||||
|
|
||||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
# These are the directories where the SDCC toolchain is installed. NOTE
|
||||||
ARCHOPTIMIZATION = --debug
|
# that short 8.3 path names are used in order to avoid spaces. On my machine
|
||||||
|
# I have:
|
||||||
|
#
|
||||||
|
# C:\PROGRA~1\ = C:\Profram Files\
|
||||||
|
# C:\PROGRA~2\ = C:\Program Files (x86)\
|
||||||
|
#
|
||||||
|
# Your PC may be configured differently.
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||||
|
SDCC_INSTALLDIR = C:\PROGRA~2\SDCC
|
||||||
|
SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin
|
||||||
|
SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\large-stack-auto
|
||||||
else
|
else
|
||||||
ARCHOPTIMIZATION =
|
SDCC_INSTALLDIR = /usr/local
|
||||||
|
SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
|
||||||
|
SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/large-stack-auto
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ARCHCPUFLAGS = -mmcs51 --stack-auto --model-large --int-long-reent --float-reent
|
CROSSDEV =
|
||||||
ARCHPICFLAGS =
|
CC = sdcc
|
||||||
ARCHWARNINGS =
|
CPP = sdcpp
|
||||||
ARCHDEFINES =
|
LD = sdld
|
||||||
ARCHINCLUDES = -I. -I$(TOPDIR)/include
|
AS = sdas8051
|
||||||
|
AR = sdar -r
|
||||||
|
|
||||||
CROSSDEV =
|
IRAM_SIZE = 0x100
|
||||||
CC = sdcc
|
DEF_STACK_BASE = 0x24
|
||||||
CPP = sdcpp
|
|
||||||
LD = aslink
|
|
||||||
AS = asx8051
|
|
||||||
#AR = sdar -r
|
|
||||||
AR = sdcclib -a
|
|
||||||
|
|
||||||
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||||
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
ARCHOPTIMIZATION = --debug
|
||||||
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
else
|
||||||
|
ARCHOPTIMIZATION =
|
||||||
|
endif
|
||||||
|
|
||||||
ASMEXT = .asm
|
ARCHCPUFLAGS = -mmcs51 --stack-auto --model-large --int-long-reent --float-reent
|
||||||
OBJEXT = .rel
|
ARCHPICFLAGS =
|
||||||
LIBEXT = .lib
|
ARCHWARNINGS =
|
||||||
EXEEXT = .hex
|
ARCHDEFINES =
|
||||||
|
ARCHINCLUDES = -I. -I$(TOPDIR)/include
|
||||||
|
|
||||||
|
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||||
|
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
||||||
|
AFLAGS = -x -j -g -l -s -p
|
||||||
|
|
||||||
|
SDCCLIB = libsdcc.lib
|
||||||
|
|
||||||
|
ASMEXT = .asm
|
||||||
|
OBJEXT = .rel
|
||||||
|
LIBEXT = .lib
|
||||||
|
EXEEXT = .hex
|
||||||
|
|
||||||
|
# Custom ASSEMBLE definition. The most common toolchain, GCC, uses the
|
||||||
|
# compiler to assemble files because this has the advantage of running the C
|
||||||
|
# Pre-Processor against. This is not possible with other SDCC; we need to
|
||||||
|
# define AS and over-ride the common definition in order to use the assembler
|
||||||
|
# directly.
|
||||||
|
|
||||||
define ASSEMBLE
|
define ASSEMBLE
|
||||||
@echo "AS: $1"
|
@echo "AS: $1"
|
||||||
@$(AS) $(AFLAGS) $1
|
@$(AS) $(AFLAGS) $1
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Custom CLEAN definition
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||||
define CLEAN
|
define CLEAN
|
||||||
@rm -f *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex
|
$(Q) if exist *.o (del /f /q *.o)
|
||||||
|
$(Q) if exist *.asm (del /f /q *.asm)
|
||||||
|
$(Q) if exist *.rel (del /f /q *.rel)
|
||||||
|
$(Q) if exist *.lst (del /f /q *.lst)
|
||||||
|
$(Q) if exist *.rst (del /f /q *.rst)
|
||||||
|
$(Q) if exist *.sym (del /f /q *.sym)
|
||||||
|
$(Q) if exist *.adb (del /f /q *.adb)
|
||||||
|
$(Q) if exist *.lnk (del /f /q *.lnk)
|
||||||
|
$(Q) if exist *.map (del /f /q *.map)
|
||||||
|
$(Q) if exist *.mem (del /f /q *.mem)
|
||||||
|
$(Q) if exist *.hex (del /f /q *.hex)
|
||||||
|
$(Q) if exist *.cmd (del /f /q *.cmd)
|
||||||
endef
|
endef
|
||||||
|
else
|
||||||
|
define CLEAN
|
||||||
|
$(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
# Windows native host tool definitions
|
||||||
|
|
||||||
HOSTCC = gcc
|
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||||
HOSTINCLUDES = -I.
|
HOSTCC = mingw32-gcc.exe
|
||||||
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
HOSTINCLUDES = -I.
|
||||||
HOSTLDFLAGS =
|
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||||
|
HOSTLDFLAGS =
|
||||||
|
HOSTEXEEXT = .exe
|
||||||
|
|
||||||
|
# Windows-native host tools
|
||||||
|
|
||||||
|
MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
|
||||||
|
|
||||||
|
# Use NTFS links or directory copies
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_WINDOWS_MKLINK),y)
|
||||||
|
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.bat
|
||||||
|
else
|
||||||
|
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.bat
|
||||||
|
endif
|
||||||
|
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.bat
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
# Linux/Cygwin host tool definitions
|
||||||
|
|
||||||
|
HOSTCC = gcc
|
||||||
|
HOSTINCLUDES = -I.
|
||||||
|
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
|
||||||
|
HOSTLDFLAGS =
|
||||||
|
|
||||||
|
# This is the tool to use for dependencies (i.e., none)
|
||||||
|
|
||||||
|
MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh
|
||||||
|
|
||||||
|
# SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC
|
||||||
|
# running under Cygwin does not
|
||||||
|
|
||||||
|
ifeq ($(WINTOOL),y)
|
||||||
|
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh
|
||||||
|
else
|
||||||
|
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
|
||||||
|
endif
|
||||||
|
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# pjrc-8051/setenv.sh
|
# configs/pjrc-8051/setenv.sh
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2007-2008, 2012 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@@ -32,14 +32,34 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
if [ "$(basename $0)" = "setenv.sh" ] ; then
|
if [ "$_" = "$0" ] ; then
|
||||||
echo "You must source this script, not run it!" 1>&2
|
echo "You must source this script, not run it!" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
|
WD=`pwd`
|
||||||
|
if [ ! -x "setenv.sh" ]; then
|
||||||
|
echo "This script must be executed from the top-level NuttX build directory"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
export SDCC_BIN=/usr/local/bin
|
if [ -z "${PATH_ORIG}" ]; then
|
||||||
export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
|
export PATH_ORIG="${PATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# This is the normal installation directory for SDCC under Linux, OSX
|
||||||
|
# or Linux:
|
||||||
|
#
|
||||||
|
export TOOLCHAIN_BIN=/usr/local/bin
|
||||||
|
|
||||||
|
#
|
||||||
|
# This is the normal installation directory for SDCC under Windows
|
||||||
|
#
|
||||||
|
#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/SDCC/bin"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Add the path to the toolchain to the PATH varialble
|
||||||
|
#
|
||||||
|
export PATH="${TOOLCHAIN_BIN}":/sbin:/usr/sbin:${PATH_ORIG}
|
||||||
echo "PATH : ${PATH}"
|
echo "PATH : ${PATH}"
|
||||||
|
|||||||
Reference in New Issue
Block a user