Progress toward a z80 native Windows build -- still needs some work

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5411 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-12-03 20:12:59 +00:00
parent 343ea041c7
commit c2fa801660
16 changed files with 847 additions and 246 deletions
+3
View File
@@ -3731,4 +3731,7 @@
* configs/z80sim/ostest: Converted to build with the Kconfig/mconf tool. * configs/z80sim/ostest: Converted to build with the Kconfig/mconf tool.
Current configuration failed to build for me (Ubuntu 12.10, SDCC 3.2.0 Current configuration failed to build for me (Ubuntu 12.10, SDCC 3.2.0
pre-built for Linux) due to a glibc memory corruptionerror in SDCC. pre-built for Linux) due to a glibc memory corruptionerror in SDCC.
* configs/z80sim/ostest: Default is now the Windows native build. See
configs/z80sim/README.txt for instructions to convert back to a Linux or
or Cygwin build.
+7 -7
View File
@@ -96,12 +96,12 @@ $(COBJS): %$(OBJEXT): %.c
# This is a kludge to work around some conflicting symbols in libsdcc.lib # This is a kludge to work around some conflicting symbols in libsdcc.lib
$(SDCCLIBDIR)/myz80.lib: $(SDCCLIBDIR)/$(SDCCLIB) $(SDCC_LIBDIR)/myz80.lib: $(SDCC_LIBDIR)/$(SDCCLIB)
$(Q) cat $(SDCCLIBDIR)/$(SDCCLIB) | \ $(Q) cat $(SDCC_LIBDIR)/$(SDCCLIB) | \
grep -v alloc | grep -v free | grep -v printf | \ grep -v alloc | grep -v free | grep -v printf | \
grep -v _str | grep -v _mem | grep -v crt0\.o \ grep -v _str | grep -v _mem | grep -v crt0\.o \
> myz80.lib > myz80.lib
$(Q) mv -f myz80.lib $(SDCCLIBDIR)/myz80.lib $(Q) mv -f myz80.lib $(SDCC_LIBDIR)/myz80.lib
# Create a header file that contains addressing information needed by the code # Create a header file that contains addressing information needed by the code
@@ -143,11 +143,11 @@ board/libboard$(LIBEXT):
# This target builds the final executable # This target builds the final executable
pass1.hex: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) pass1.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT)
@echo "LD: pass1.hex" @echo "LD: pass1.hex"
@echo "--" >pass1.lnk # Non-interactive @echo "--" >pass1.lnk # Non-interactive
@echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library @echo "-k $(BOARDDIR)" >>pass1.lnk # Path to board library
@echo "-k $(SDCCLIBDIR)" >>pass1.lnk # Path to SDCC z80 library @echo "-k $(SDCC_LIBDIR)" >>pass1.lnk # Path to SDCC z80 library
@echo "-l libboard$(LIBEXT)" >>pass1.lnk # Name of board library @echo "-l libboard$(LIBEXT)" >>pass1.lnk # Name of board library
$(Q) for LIB in $(LINKLIBS); do \ $(Q) for LIB in $(LINKLIBS); do \
echo "-l $(TOPDIR)/lib/$$LIB" >> pass1.lnk ;\ echo "-l $(TOPDIR)/lib/$$LIB" >> pass1.lnk ;\
@@ -176,11 +176,11 @@ endif
$(Q) $(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT) $(Q) $(MAKE) TOPDIR="$(TOPDIR)" libarch$(LIBEXT)
$(Q) $(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_OBJ) $(Q) $(MAKE) TOPDIR="$(TOPDIR)" $(HEAD_OBJ)
nuttx.hex: up_mem.h asm_mem.h $(SDCCLIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT) nuttx.hex: up_mem.h asm_mem.h $(SDCC_LIBDIR)/myz80.lib $(HEAD_OBJ) board/libboard$(LIBEXT)
@echo "LD: nuttx.hex" @echo "LD: nuttx.hex"
@echo "--" >nuttx.lnk # Non-interactive @echo "--" >nuttx.lnk # Non-interactive
@echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library @echo "-k $(BOARDDIR)" >>nuttx.lnk # Path to board library
@echo "-k $(SDCCLIBDIR)" >>nuttx.lnk # Path to SDCC z80 library @echo "-k $(SDCC_LIBDIR)" >>nuttx.lnk # Path to SDCC z80 library
@echo "-l libboard$(LIBEXT)" >>nuttx.lnk # Name of board library @echo "-l libboard$(LIBEXT)" >>nuttx.lnk # Name of board library
$(Q) for LIB in $(LINKLIBS); do \ $(Q) for LIB in $(LINKLIBS); do \
echo "-l $(TOPDIR)/lib/$$LIB" >> nuttx.lnk ;\ echo "-l $(TOPDIR)/lib/$$LIB" >> nuttx.lnk ;\
+1
View File
@@ -12,6 +12,7 @@ choice
config Z80_TOOLCHAIN_SDCCL config Z80_TOOLCHAIN_SDCCL
bool "SDCC for Linux, MAC OSX, or Cygwin" bool "SDCC for Linux, MAC OSX, or Cygwin"
depends on !WINDOWS_NATIVE
config Z80_TOOLCHAIN_SDCCW config Z80_TOOLCHAIN_SDCCW
bool "SDCC for Windows" bool "SDCC for Windows"
+1 -1
View File
@@ -66,7 +66,7 @@ EXEEXT = .hex
define ASSEMBLE define ASSEMBLE
@echo "AS: $1" @echo "AS: $1"
@$(AS) $(ASFLAGS) $1 @$(AS) $(AFLAGS) $1
endef endef
define CLEAN define CLEAN
+110 -37
View File
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/tools/Config.mk
CROSSDEV = # These are the directories where the SDCC toolchain is installed. NOTE
CC = sdcc # that short 8.3 path names are used in order to avoid spaces. On my machine
CPP = sdcpp # I have:
AR = sdcclib -a #
# 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\z80
else
SDCC_INSTALLDIR = /usr/local
SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
endif
CROSSDEV =
CC = sdcc
CPP = sdcpp
AR = sdcclib -a
ifeq ($(CONFIG_SDCC_OLD),y) ifeq ($(CONFIG_SDCC_OLD),y)
LD = link-z80
LD = link-z80 AS = as-z80
AS = as-z80 ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
else else
LD = sdldz80
LD = sdldz80 AS = sdasz80
AS = sdasz80 ARCHCPUFLAGS = -mz80
ARCHCPUFLAGS = -mz80
endif endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = --debug ARCHOPTIMIZATION = --debug
else else
ARCHOPTIMIZATION = ARCHOPTIMIZATION =
endif endif
ARCHPICFLAGS = ARCHPICFLAGS =
ARCHWARNINGS = ARCHWARNINGS =
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -I$(TOPDIR)/include ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = -x -a -l -o -s
ASFLAGS = -x -a -l -o -s
SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 SDCCLIB = z80.lib
SDCCLIB = z80.lib
ASMEXT = .asm ASMEXT = .asm
OBJEXT = .o OBJEXT = .o
LIBEXT = .lib LIBEXT = .lib
EXEEXT = .cmd EXEEXT = .cmd
define CLEAN # Custom ASSEMBLE definition. The most common toolchain, GCC, uses the
@rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex # 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
@echo "AS: $1"
$(Q) $(AS) $(AFLAGS) $2 $1
endef endef
MKDEP = $(TOPDIR)/tools/mkdeps.sh # Custom CLEAN definition
HOSTCC = gcc ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTINCLUDES = -I. define CLEAN
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe $(Q) if exist *.o (del /f /q *.o)
HOSTLDFLAGS = $(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
else
define CLEAN
$(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd
endef
endif
# Windows native host tool definitions
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTCC = mingw32-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
HOSTEXEEXT = .exe
# Windows-native host tools
MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
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)winlink.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
else
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
endif
endif
+110 -37
View File
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/tools/Config.mk
CROSSDEV = # These are the directories where the SDCC toolchain is installed. NOTE
CC = sdcc # that short 8.3 path names are used in order to avoid spaces. On my machine
CPP = sdcpp # I have:
AR = sdcclib -a #
# 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\z80
else
SDCC_INSTALLDIR = /usr/local
SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
endif
CROSSDEV =
CC = sdcc
CPP = sdcpp
AR = sdcclib -a
ifeq ($(CONFIG_SDCC_OLD),y) ifeq ($(CONFIG_SDCC_OLD),y)
LD = link-z80
LD = link-z80 AS = as-z80
AS = as-z80 ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
else else
LD = sdldz80
LD = sdldz80 AS = sdasz80
AS = sdasz80 ARCHCPUFLAGS = -mz80
ARCHCPUFLAGS = -mz80
endif endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = --debug ARCHOPTIMIZATION = --debug
else else
ARCHOPTIMIZATION = ARCHOPTIMIZATION =
endif endif
ARCHPICFLAGS = ARCHPICFLAGS =
ARCHWARNINGS = ARCHWARNINGS =
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -I$(TOPDIR)/include ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = -x -a -l -o -s
ASFLAGS = -x -a -l -o -s
SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 SDCCLIB = z80.lib
SDCCLIB = z80.lib
ASMEXT = .asm ASMEXT = .asm
OBJEXT = .o OBJEXT = .o
LIBEXT = .lib LIBEXT = .lib
EXEEXT = .cmd EXEEXT = .cmd
define CLEAN # Custom ASSEMBLE definition. The most common toolchain, GCC, uses the
@rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex # 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
@echo "AS: $1"
$(Q) $(AS) $(AFLAGS) $2 $1
endef endef
MKDEP = $(TOPDIR)/tools/mkdeps.sh # Custom CLEAN definition
HOSTCC = gcc ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTINCLUDES = -I. define CLEAN
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe $(Q) if exist *.o (del /f /q *.o)
HOSTLDFLAGS = $(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
else
define CLEAN
$(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd
endef
endif
# Windows native host tool definitions
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTCC = mingw32-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
HOSTEXEEXT = .exe
# Windows-native host tools
MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
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)winlink.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
else
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
endif
endif
+110 -37
View File
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/tools/Config.mk
CROSSDEV = # These are the directories where the SDCC toolchain is installed. NOTE
CC = sdcc # that short 8.3 path names are used in order to avoid spaces. On my machine
CPP = sdcpp # I have:
AR = sdcclib -a #
# 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\z80
else
SDCC_INSTALLDIR = /usr/local
SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
endif
CROSSDEV =
CC = sdcc
CPP = sdcpp
AR = sdcclib -a
ifeq ($(CONFIG_SDCC_OLD),y) ifeq ($(CONFIG_SDCC_OLD),y)
LD = link-z80
LD = link-z80 AS = as-z80
AS = as-z80 ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
else else
LD = sdldz80
LD = sdldz80 AS = sdasz80
AS = sdasz80 ARCHCPUFLAGS = -mz80
ARCHCPUFLAGS = -mz80
endif endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = --debug ARCHOPTIMIZATION = --debug
else else
ARCHOPTIMIZATION = ARCHOPTIMIZATION =
endif endif
ARCHPICFLAGS = ARCHPICFLAGS =
ARCHWARNINGS = ARCHWARNINGS =
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -I$(TOPDIR)/include ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = -x -a -l -o -s
ASFLAGS = -x -a -l -o -s
SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 SDCCLIB = z80.lib
SDCCLIB = z80.lib
ASMEXT = .asm ASMEXT = .asm
OBJEXT = .o OBJEXT = .o
LIBEXT = .lib LIBEXT = .lib
EXEEXT = .cmd EXEEXT = .cmd
define CLEAN # Custom ASSEMBLE definition. The most common toolchain, GCC, uses the
@rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex # 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
@echo "AS: $1"
$(Q) $(AS) $(AFLAGS) $2 $1
endef endef
MKDEP = $(TOPDIR)/tools/mkdeps.sh # Custom CLEAN definition
HOSTCC = gcc ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTINCLUDES = -I. define CLEAN
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe $(Q) if exist *.o (del /f /q *.o)
HOSTLDFLAGS = $(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
else
define CLEAN
$(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd
endef
endif
# Windows native host tool definitions
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTCC = mingw32-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
HOSTEXEEXT = .exe
# Windows-native host tools
MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
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)winlink.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
else
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
endif
endif
+31 -4
View File
@@ -41,11 +41,38 @@ Configuring NuttX
b. Execute 'make menuconfig' in nuttx/ in order to start the b. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process. reconfiguration process.
2. The current configuration is untested. When last attempted 2. The default setup for this configuration uses a windows native build.
on Ubuntu 12.10 with SDCC 3.2.0, the build failed with the NOTE that build does *NOT* work build successfully using SDCC 3.2.0:
following internal error: Windows halts claiming that sdcclib is no long responding. 3.2.0 is
the latest released version as of this writing. This problem has,
apparently been corrected in the repository; a snapshot data 11-23-2012
(3.2.1) did not have this problem.
*** glibc detected *** sdcclib: malloc(): memory corruption: 0x09f09768 *** This configuration was last verified sucessfully prior to the
the configure to Kconfig/mconf tool using SDCC 2.6.0 built to run
natively under Cygwin.
3. This configuration can be converted to run under Linux (or Cygwin or
OSX), by modifying the configuration file as follows:
-CONFIG_HOST_WINDOWS=y
-CONFIG_WINDOWS_NATIVE=y
+CONFIG_HOST_LINUX=y
-CONFIG_Z80_TOOLCHAIN_SDCCW=y
+CONFIG_Z80_TOOLCHAIN_SDCCL=y
You make also have to change the value of CONFIG_APPS_DIR. You cannot
use the default setenv.bat. Use configs/z80sim/script/setenv.sh instead.
When last attempted on Ubuntu 12.10 with SDCC 3.2.0 for Linux, the build
failed with the following internal error:
*** glibc detected *** sdcclib: malloc(): memory corruption: 0x09f09768 ***
I believe that this is related to the sdcclib error also reported under
windows for SDCC 3.2.0. It can probably also be avoided by updating to
a more recent snapshot.
nsh nsh
+110 -37
View File
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/tools/Config.mk
CROSSDEV = # These are the directories where the SDCC toolchain is installed. NOTE
CC = sdcc # that short 8.3 path names are used in order to avoid spaces. On my machine
CPP = sdcpp # I have:
AR = sdcclib -a #
# 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\z80
else
SDCC_INSTALLDIR = /usr/local
SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
endif
CROSSDEV =
CC = sdcc
CPP = sdcpp
AR = sdcclib -a
ifeq ($(CONFIG_SDCC_OLD),y) ifeq ($(CONFIG_SDCC_OLD),y)
LD = link-z80
LD = link-z80 AS = as-z80
AS = as-z80 ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
else else
LD = sdldz80
LD = sdldz80 AS = sdasz80
AS = sdasz80 ARCHCPUFLAGS = -mz80
ARCHCPUFLAGS = -mz80
endif endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = --debug ARCHOPTIMIZATION = --debug
else else
ARCHOPTIMIZATION = ARCHOPTIMIZATION =
endif endif
ARCHPICFLAGS = ARCHPICFLAGS =
ARCHWARNINGS = ARCHWARNINGS =
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -I$(TOPDIR)/include ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = -x -a -l -o -s
ASFLAGS = -x -a -l -o -s
SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 SDCCLIB = z80.lib
SDCCLIB = z80.lib
ASMEXT = .asm ASMEXT = .asm
OBJEXT = .o OBJEXT = .o
LIBEXT = .lib LIBEXT = .lib
EXEEXT = .hex EXEEXT = .hex
define CLEAN # Custom ASSEMBLE definition. The most common toolchain, GCC, uses the
@rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex # 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
@echo "AS: $1"
$(Q) $(AS) $(AFLAGS) $2 $1
endef endef
MKDEP = $(TOPDIR)/tools/mkdeps.sh # Custom CLEAN definition
HOSTCC = gcc ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTINCLUDES = -I. define CLEAN
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe $(Q) if exist *.o (del /f /q *.o)
HOSTLDFLAGS = $(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
else
define CLEAN
$(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd
endef
endif
# Windows native host tool definitions
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTCC = mingw32-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
HOSTEXEEXT = .exe
# Windows-native host tools
MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
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)winlink.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
else
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
endif
endif
+110 -37
View File
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/tools/Config.mk
CROSSDEV = # These are the directories where the SDCC toolchain is installed. NOTE
CC = sdcc # that short 8.3 path names are used in order to avoid spaces. On my machine
CPP = sdcpp # I have:
AR = sdcclib -a #
# 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\z80
else
SDCC_INSTALLDIR = /usr/local
SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
endif
CROSSDEV =
CC = sdcc
CPP = sdcpp
AR = sdcclib -a
ifeq ($(CONFIG_SDCC_OLD),y) ifeq ($(CONFIG_SDCC_OLD),y)
LD = link-z80
LD = link-z80 AS = as-z80
AS = as-z80 ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
else else
LD = sdldz80
LD = sdldz80 AS = sdasz80
AS = sdasz80 ARCHCPUFLAGS = -mz80
ARCHCPUFLAGS = -mz80
endif endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = --debug ARCHOPTIMIZATION = --debug
else else
ARCHOPTIMIZATION = ARCHOPTIMIZATION =
endif endif
ARCHPICFLAGS = ARCHPICFLAGS =
ARCHWARNINGS = ARCHWARNINGS =
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -I$(TOPDIR)/include ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = -x -a -l -o -s
ASFLAGS = -x -a -l -o -s
SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 SDCCLIB = z80.lib
SDCCLIB = z80.lib
ASMEXT = .asm ASMEXT = .asm
OBJEXT = .o OBJEXT = .o
LIBEXT = .lib LIBEXT = .lib
EXEEXT = .hex EXEEXT = .hex
define CLEAN # Custom ASSEMBLE definition. The most common toolchain, GCC, uses the
@rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex # 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
@echo "AS: $1"
$(Q) $(AS) $(AFLAGS) $2 $1
endef endef
MKDEP = $(TOPDIR)/tools/mkdeps.sh # Custom CLEAN definition
HOSTCC = gcc ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTINCLUDES = -I. define CLEAN
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe $(Q) if exist *.o (del /f /q *.o)
HOSTLDFLAGS = $(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
else
define CLEAN
$(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd
endef
endif
# Windows native host tool definitions
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTCC = mingw32-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
HOSTEXEEXT = .exe
# Windows-native host tools
MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
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)winlink.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
else
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
endif
endif
+10 -4
View File
@@ -8,15 +8,20 @@ CONFIG_NUTTX_NEWCONFIG=y
# Build Setup # Build Setup
# #
# CONFIG_EXPERIMENTAL is not set # CONFIG_EXPERIMENTAL is not set
CONFIG_HOST_LINUX=y # CONFIG_HOST_LINUX is not set
# CONFIG_HOST_OSX is not set # CONFIG_HOST_OSX is not set
# CONFIG_HOST_WINDOWS is not set CONFIG_HOST_WINDOWS=y
# CONFIG_HOST_OTHER is not set # CONFIG_HOST_OTHER is not set
CONFIG_WINDOWS_NATIVE=y
# CONFIG_WINDOWS_CYGWIN is not set
# CONFIG_WINDOWS_MSYS is not set
# CONFIG_WINDOWS_OTHER is not set
# CONFIG_WINDOWS_MKLINK is not set
# #
# Build Configuration # Build Configuration
# #
# CONFIG_APPS_DIR="../apps" # CONFIG_APPS_DIR="..\apps"
# CONFIG_BUILD_2PASS is not set # CONFIG_BUILD_2PASS is not set
# #
@@ -64,7 +69,8 @@ CONFIG_ARCH_CHIP_Z80=y
# CONFIG_ARCH_CHIP_EZ80F91 is not set # CONFIG_ARCH_CHIP_EZ80F91 is not set
# CONFIG_ARCH_CHIP_EZ80F92 is not set # CONFIG_ARCH_CHIP_EZ80F92 is not set
# CONFIG_ARCH_CHIP_EZ80F93 is not set # CONFIG_ARCH_CHIP_EZ80F93 is not set
CONFIG_Z80_TOOLCHAIN_SDCCL=y # CONFIG_Z80_TOOLCHAIN_SDCCL is not set
CONFIG_Z80_TOOLCHAIN_SDCCW=y
# #
# Architecture Options # Architecture Options
+50
View File
@@ -0,0 +1,50 @@
@echo off
rem configs/z80sim/ostest/setenv.bat
rem
rem Copyright (C) 2012 Gregory Nutt. All rights reserved.
rem Author: Gregory Nutt <gnutt@nuttx.org>
rem
rem Redistribution and use in source and binary forms, with or without
rem modification, are permitted provided that the following conditions
rem are met:
rem
rem 1. Redistributions of source code must retain the above copyright
rem notice, this list of conditions and the following disclaimer.
rem 2. Redistributions in binary form must reproduce the above copyright
rem notice, this list of conditions and the following disclaimer in
rem the documentation and/or other materials provided with the
rem distribution.
rem 3. Neither the name NuttX nor the names of its contributors may be
rem used to endorse or promote products derived from this software
rem without specific prior written permission.
rem
rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 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
rem http://www.mingw.org/ for further info.
set PATH=C:\MinGW\bin;%PATH%
rem This is the location where I installed the SDCC toolchain for windows.
set PATH=C:\Program Files (x86)\SDCC/bin;%PATH%
rem This is the location where I installed the GNUWin32 tools. See
rem http://gnuwin32.sourceforge.net/.
set PATH=C:\gnuwin32\bin;%PATH%
echo %PATH%
+110 -37
View File
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk include ${TOPDIR}/tools/Config.mk
CROSSDEV = # These are the directories where the SDCC toolchain is installed. NOTE
CC = sdcc # that short 8.3 path names are used in order to avoid spaces. On my machine
CPP = sdcpp # I have:
AR = sdcclib -a #
# 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\z80
else
SDCC_INSTALLDIR = /usr/local
SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
endif
CROSSDEV =
CC = sdcc
CPP = sdcpp
AR = sdcclib -a
ifeq ($(CONFIG_SDCC_OLD),y) ifeq ($(CONFIG_SDCC_OLD),y)
LD = link-z80
LD = link-z80 AS = as-z80
AS = as-z80 ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
else else
LD = sdldz80
LD = sdldz80 AS = sdasz80
AS = sdasz80 ARCHCPUFLAGS = -mz80
ARCHCPUFLAGS = -mz80
endif endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = --debug ARCHOPTIMIZATION = --debug
else else
ARCHOPTIMIZATION = ARCHOPTIMIZATION =
endif endif
ARCHPICFLAGS = ARCHPICFLAGS =
ARCHWARNINGS = ARCHWARNINGS =
ARCHDEFINES = ARCHDEFINES =
ARCHINCLUDES = -I. -I$(TOPDIR)/include ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = -x -a -l -o -s
ASFLAGS = -x -a -l -o -s
SDCCLIBDIR = /usr/local/share/sdcc/lib/z80 SDCCLIB = z80.lib
SDCCLIB = z80.lib
ASMEXT = .asm ASMEXT = .asm
OBJEXT = .o OBJEXT = .o
LIBEXT = .lib LIBEXT = .lib
EXEEXT = .hex EXEEXT = .hex
define CLEAN # Custom ASSEMBLE definition. The most common toolchain, GCC, uses the
@rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex # 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
@echo "AS: $1"
$(Q) $(AS) $(AFLAGS) $2 $1
endef endef
MKDEP = $(TOPDIR)/tools/mkdeps.sh # Custom CLEAN definition
HOSTCC = gcc ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTINCLUDES = -I. define CLEAN
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe $(Q) if exist *.o (del /f /q *.o)
HOSTLDFLAGS = $(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
else
define CLEAN
$(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd
endef
endif
# Windows native host tool definitions
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
HOSTCC = mingw32-gcc.exe
HOSTINCLUDES = -I.
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
HOSTEXEEXT = .exe
# Windows-native host tools
MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
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)winlink.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
else
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
endif
endif
+50
View File
@@ -0,0 +1,50 @@
@echo off
rem configs/z80sim/scripts/setenv.bat
rem
rem Copyright (C) 2012 Gregory Nutt. All rights reserved.
rem Author: Gregory Nutt <gnutt@nuttx.org>
rem
rem Redistribution and use in source and binary forms, with or without
rem modification, are permitted provided that the following conditions
rem are met:
rem
rem 1. Redistributions of source code must retain the above copyright
rem notice, this list of conditions and the following disclaimer.
rem 2. Redistributions in binary form must reproduce the above copyright
rem notice, this list of conditions and the following disclaimer in
rem the documentation and/or other materials provided with the
rem distribution.
rem 3. Neither the name NuttX nor the names of its contributors may be
rem used to endorse or promote products derived from this software
rem without specific prior written permission.
rem
rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 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
rem http://www.mingw.org/ for further info.
set PATH=C:\MinGW\bin;%PATH%
rem This is the location where I installed the SDCC toolchain for windows.
set PATH=C:\Program Files (x86)\SDCC/bin;%PATH%
rem This is the location where I installed the GNUWin32 tools. See
rem http://gnuwin32.sourceforge.net/.
set PATH=C:\gnuwin32\bin;%PATH%
echo %PATH%
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# configs/z80sim/ostest/setenv.sh # configs/z80sim/ostest/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,35 @@
# 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}"
+8 -3
View File
@@ -134,10 +134,16 @@ endef
# ASSEMBLE - Default macro to assemble one assembly language file # ASSEMBLE - Default macro to assemble one assembly language file
# Example: $(call ASSEMBLE, in-file, out-file) # Example: $(call ASSEMBLE, in-file, out-file)
# #
# NOTE that the most common toolchain, GCC, uses the compiler to assemble
# files because this has the advantage of running the C Pre-Processor against
# the assembly language files. This is not possible with other toolchains;
# platforms using those other tools should define AS and over-ride this
# definition in order to use the assembler directly.
#
# Depends on these settings defined in board-specific Make.defs file # Depends on these settings defined in board-specific Make.defs file
# installed at $(TOPDIR)/Make.defs: # installed at $(TOPDIR)/Make.defs:
# #
# CC - By default, the C compiler is used to compile assembly lagnuage # CC - By default, the C compiler is used to compile assembly language
# files # files
# AFLAGS - Options to pass to the C+compiler # AFLAGS - Options to pass to the C+compiler
@@ -164,8 +170,7 @@ endef
ifeq ($(CONFIG_WINDOWS_NATIVE),y) ifeq ($(CONFIG_WINDOWS_NATIVE),y)
define ARCHIVE define ARCHIVE
@echo "AR: $2" @echo AR: $2
$(AR) $1
$(Q) $(AR) $1 $(2) $(Q) $(AR) $1 $(2)
endef endef
else else