summaryrefslogtreecommitdiff
path: root/nuttx/configs
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-03 20:12:59 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-03 20:12:59 +0000
commitb052b3b6508e6a9a51017072c541fa0eb8467fdb (patch)
tree17f5df6ecd839ddf1ef41cffc724c6161486e06b /nuttx/configs
parent73705c2998717a35ad81c099340caa518eaed785 (diff)
downloadpx4-nuttx-b052b3b6508e6a9a51017072c541fa0eb8467fdb.tar.gz
px4-nuttx-b052b3b6508e6a9a51017072c541fa0eb8467fdb.tar.bz2
px4-nuttx-b052b3b6508e6a9a51017072c541fa0eb8467fdb.zip
Progress toward a z80 native Windows build -- still needs some work
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5411 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/configs')
-rw-r--r--nuttx/configs/pjrc-8051/Make.defs2
-rw-r--r--nuttx/configs/xtrs/nsh/Make.defs143
-rw-r--r--nuttx/configs/xtrs/ostest/Make.defs143
-rw-r--r--nuttx/configs/xtrs/pashello/Make.defs143
-rw-r--r--nuttx/configs/z80sim/README.txt35
-rw-r--r--nuttx/configs/z80sim/nsh/Make.defs143
-rw-r--r--nuttx/configs/z80sim/ostest/Make.defs143
-rw-r--r--nuttx/configs/z80sim/ostest/defconfig14
-rw-r--r--nuttx/configs/z80sim/ostest/setenv.bat50
-rw-r--r--nuttx/configs/z80sim/pashello/Make.defs143
-rw-r--r--nuttx/configs/z80sim/scripts/setenv.bat50
-rwxr-xr-xnuttx/configs/z80sim/scripts/setenv.sh (renamed from nuttx/configs/z80sim/ostest/setenv.sh)31
12 files changed, 816 insertions, 224 deletions
diff --git a/nuttx/configs/pjrc-8051/Make.defs b/nuttx/configs/pjrc-8051/Make.defs
index 154d36556..8dd552990 100644
--- a/nuttx/configs/pjrc-8051/Make.defs
+++ b/nuttx/configs/pjrc-8051/Make.defs
@@ -66,7 +66,7 @@ EXEEXT = .hex
define ASSEMBLE
@echo "AS: $1"
- @$(AS) $(ASFLAGS) $1
+ @$(AS) $(AFLAGS) $1
endef
define CLEAN
diff --git a/nuttx/configs/xtrs/nsh/Make.defs b/nuttx/configs/xtrs/nsh/Make.defs
index 0eac402ab..749b69315 100644
--- a/nuttx/configs/xtrs/nsh/Make.defs
+++ b/nuttx/configs/xtrs/nsh/Make.defs
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
-CROSSDEV =
-CC = sdcc
-CPP = sdcpp
-AR = sdcclib -a
-
-ifeq ($(CONFIG_SDCC_OLD),y)
-
-LD = link-z80
-AS = as-z80
-ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+# These are the directories where the SDCC toolchain is installed. NOTE
+# 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\z80
else
+ SDCC_INSTALLDIR = /usr/local
+ SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
+ SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
+endif
-LD = sdldz80
-AS = sdasz80
-ARCHCPUFLAGS = -mz80
+CROSSDEV =
+CC = sdcc
+CPP = sdcpp
+AR = sdcclib -a
+ifeq ($(CONFIG_SDCC_OLD),y)
+ LD = link-z80
+ AS = as-z80
+ ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+else
+ LD = sdldz80
+ AS = sdasz80
+ ARCHCPUFLAGS = -mz80
endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
- ARCHOPTIMIZATION = --debug
+ ARCHOPTIMIZATION = --debug
else
- ARCHOPTIMIZATION =
+ ARCHOPTIMIZATION =
endif
-ARCHPICFLAGS =
-ARCHWARNINGS =
-ARCHDEFINES =
-ARCHINCLUDES = -I. -I$(TOPDIR)/include
+ARCHPICFLAGS =
+ARCHWARNINGS =
+ARCHDEFINES =
+ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = -x -a -l -o -s
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
- $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-ASFLAGS = -x -a -l -o -s
+SDCCLIB = z80.lib
-SDCCLIBDIR = /usr/local/share/sdcc/lib/z80
-SDCCLIB = z80.lib
+ASMEXT = .asm
+OBJEXT = .o
+LIBEXT = .lib
+EXEEXT = .cmd
-ASMEXT = .asm
-OBJEXT = .o
-LIBEXT = .lib
-EXEEXT = .cmd
+# 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
+ @echo "AS: $1"
+ $(Q) $(AS) $(AFLAGS) $2 $1
+endef
+# Custom CLEAN definition
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define CLEAN
+ $(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
+else
define CLEAN
- @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex
+ $(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
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
+# Linux/Cygwin host tool definitions
-HOSTCC = gcc
-HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
-HOSTLDFLAGS =
+ 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
diff --git a/nuttx/configs/xtrs/ostest/Make.defs b/nuttx/configs/xtrs/ostest/Make.defs
index ae26822d5..550c70d3c 100644
--- a/nuttx/configs/xtrs/ostest/Make.defs
+++ b/nuttx/configs/xtrs/ostest/Make.defs
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
-CROSSDEV =
-CC = sdcc
-CPP = sdcpp
-AR = sdcclib -a
-
-ifeq ($(CONFIG_SDCC_OLD),y)
-
-LD = link-z80
-AS = as-z80
-ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+# These are the directories where the SDCC toolchain is installed. NOTE
+# 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\z80
else
+ SDCC_INSTALLDIR = /usr/local
+ SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
+ SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
+endif
-LD = sdldz80
-AS = sdasz80
-ARCHCPUFLAGS = -mz80
+CROSSDEV =
+CC = sdcc
+CPP = sdcpp
+AR = sdcclib -a
+ifeq ($(CONFIG_SDCC_OLD),y)
+ LD = link-z80
+ AS = as-z80
+ ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+else
+ LD = sdldz80
+ AS = sdasz80
+ ARCHCPUFLAGS = -mz80
endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
- ARCHOPTIMIZATION = --debug
+ ARCHOPTIMIZATION = --debug
else
- ARCHOPTIMIZATION =
+ ARCHOPTIMIZATION =
endif
-ARCHPICFLAGS =
-ARCHWARNINGS =
-ARCHDEFINES =
-ARCHINCLUDES = -I. -I$(TOPDIR)/include
+ARCHPICFLAGS =
+ARCHWARNINGS =
+ARCHDEFINES =
+ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = -x -a -l -o -s
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
- $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-ASFLAGS = -x -a -l -o -s
+SDCCLIB = z80.lib
-SDCCLIBDIR = /usr/local/share/sdcc/lib/z80
-SDCCLIB = z80.lib
+ASMEXT = .asm
+OBJEXT = .o
+LIBEXT = .lib
+EXEEXT = .cmd
-ASMEXT = .asm
-OBJEXT = .o
-LIBEXT = .lib
-EXEEXT = .cmd
+# 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
+ @echo "AS: $1"
+ $(Q) $(AS) $(AFLAGS) $2 $1
+endef
+# Custom CLEAN definition
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define CLEAN
+ $(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
+else
define CLEAN
- @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex
+ $(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
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
+# Linux/Cygwin host tool definitions
-HOSTCC = gcc
-HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
-HOSTLDFLAGS =
+ 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
diff --git a/nuttx/configs/xtrs/pashello/Make.defs b/nuttx/configs/xtrs/pashello/Make.defs
index 30caae7fd..409e303c1 100644
--- a/nuttx/configs/xtrs/pashello/Make.defs
+++ b/nuttx/configs/xtrs/pashello/Make.defs
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
-CROSSDEV =
-CC = sdcc
-CPP = sdcpp
-AR = sdcclib -a
-
-ifeq ($(CONFIG_SDCC_OLD),y)
-
-LD = link-z80
-AS = as-z80
-ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+# These are the directories where the SDCC toolchain is installed. NOTE
+# 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\z80
else
+ SDCC_INSTALLDIR = /usr/local
+ SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
+ SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
+endif
-LD = sdldz80
-AS = sdasz80
-ARCHCPUFLAGS = -mz80
+CROSSDEV =
+CC = sdcc
+CPP = sdcpp
+AR = sdcclib -a
+ifeq ($(CONFIG_SDCC_OLD),y)
+ LD = link-z80
+ AS = as-z80
+ ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+else
+ LD = sdldz80
+ AS = sdasz80
+ ARCHCPUFLAGS = -mz80
endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
- ARCHOPTIMIZATION = --debug
+ ARCHOPTIMIZATION = --debug
else
- ARCHOPTIMIZATION =
+ ARCHOPTIMIZATION =
endif
-ARCHPICFLAGS =
-ARCHWARNINGS =
-ARCHDEFINES =
-ARCHINCLUDES = -I. -I$(TOPDIR)/include
+ARCHPICFLAGS =
+ARCHWARNINGS =
+ARCHDEFINES =
+ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = -x -a -l -o -s
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
- $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-ASFLAGS = -x -a -l -o -s
+SDCCLIB = z80.lib
-SDCCLIBDIR = /usr/local/share/sdcc/lib/z80
-SDCCLIB = z80.lib
+ASMEXT = .asm
+OBJEXT = .o
+LIBEXT = .lib
+EXEEXT = .cmd
-ASMEXT = .asm
-OBJEXT = .o
-LIBEXT = .lib
-EXEEXT = .cmd
+# 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
+ @echo "AS: $1"
+ $(Q) $(AS) $(AFLAGS) $2 $1
+endef
+# Custom CLEAN definition
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define CLEAN
+ $(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
+else
define CLEAN
- @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex
+ $(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
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
+# Linux/Cygwin host tool definitions
-HOSTCC = gcc
-HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
-HOSTLDFLAGS =
+ 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
diff --git a/nuttx/configs/z80sim/README.txt b/nuttx/configs/z80sim/README.txt
index f8bca5b19..c371cdaff 100644
--- a/nuttx/configs/z80sim/README.txt
+++ b/nuttx/configs/z80sim/README.txt
@@ -41,11 +41,38 @@ Configuring NuttX
b. Execute 'make menuconfig' in nuttx/ in order to start the
reconfiguration process.
- 2. The current configuration is untested. When last attempted
- on Ubuntu 12.10 with SDCC 3.2.0, the build failed with the
- following internal error:
+ 2. The default setup for this configuration uses a windows native build.
+ NOTE that build does *NOT* work build successfully using SDCC 3.2.0:
+ 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.
+
+ 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 ***
- *** 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
diff --git a/nuttx/configs/z80sim/nsh/Make.defs b/nuttx/configs/z80sim/nsh/Make.defs
index 11253020e..a5b325e79 100644
--- a/nuttx/configs/z80sim/nsh/Make.defs
+++ b/nuttx/configs/z80sim/nsh/Make.defs
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
-CROSSDEV =
-CC = sdcc
-CPP = sdcpp
-AR = sdcclib -a
-
-ifeq ($(CONFIG_SDCC_OLD),y)
-
-LD = link-z80
-AS = as-z80
-ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+# These are the directories where the SDCC toolchain is installed. NOTE
+# 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\z80
else
+ SDCC_INSTALLDIR = /usr/local
+ SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
+ SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
+endif
-LD = sdldz80
-AS = sdasz80
-ARCHCPUFLAGS = -mz80
+CROSSDEV =
+CC = sdcc
+CPP = sdcpp
+AR = sdcclib -a
+ifeq ($(CONFIG_SDCC_OLD),y)
+ LD = link-z80
+ AS = as-z80
+ ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+else
+ LD = sdldz80
+ AS = sdasz80
+ ARCHCPUFLAGS = -mz80
endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
- ARCHOPTIMIZATION = --debug
+ ARCHOPTIMIZATION = --debug
else
- ARCHOPTIMIZATION =
+ ARCHOPTIMIZATION =
endif
-ARCHPICFLAGS =
-ARCHWARNINGS =
-ARCHDEFINES =
-ARCHINCLUDES = -I. -I$(TOPDIR)/include
+ARCHPICFLAGS =
+ARCHWARNINGS =
+ARCHDEFINES =
+ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = -x -a -l -o -s
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
- $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-ASFLAGS = -x -a -l -o -s
+SDCCLIB = z80.lib
-SDCCLIBDIR = /usr/local/share/sdcc/lib/z80
-SDCCLIB = z80.lib
+ASMEXT = .asm
+OBJEXT = .o
+LIBEXT = .lib
+EXEEXT = .hex
-ASMEXT = .asm
-OBJEXT = .o
-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
+ @echo "AS: $1"
+ $(Q) $(AS) $(AFLAGS) $2 $1
+endef
+# Custom CLEAN definition
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define CLEAN
+ $(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
+else
define CLEAN
- @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex
+ $(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
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
+# Linux/Cygwin host tool definitions
-HOSTCC = gcc
-HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
-HOSTLDFLAGS =
+ 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
diff --git a/nuttx/configs/z80sim/ostest/Make.defs b/nuttx/configs/z80sim/ostest/Make.defs
index d0185b4f9..54b6d8c45 100644
--- a/nuttx/configs/z80sim/ostest/Make.defs
+++ b/nuttx/configs/z80sim/ostest/Make.defs
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
-CROSSDEV =
-CC = sdcc
-CPP = sdcpp
-AR = sdcclib -a
-
-ifeq ($(CONFIG_SDCC_OLD),y)
-
-LD = link-z80
-AS = as-z80
-ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+# These are the directories where the SDCC toolchain is installed. NOTE
+# 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\z80
else
+ SDCC_INSTALLDIR = /usr/local
+ SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
+ SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
+endif
-LD = sdldz80
-AS = sdasz80
-ARCHCPUFLAGS = -mz80
+CROSSDEV =
+CC = sdcc
+CPP = sdcpp
+AR = sdcclib -a
+ifeq ($(CONFIG_SDCC_OLD),y)
+ LD = link-z80
+ AS = as-z80
+ ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+else
+ LD = sdldz80
+ AS = sdasz80
+ ARCHCPUFLAGS = -mz80
endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
- ARCHOPTIMIZATION = --debug
+ ARCHOPTIMIZATION = --debug
else
- ARCHOPTIMIZATION =
+ ARCHOPTIMIZATION =
endif
-ARCHPICFLAGS =
-ARCHWARNINGS =
-ARCHDEFINES =
-ARCHINCLUDES = -I. -I$(TOPDIR)/include
+ARCHPICFLAGS =
+ARCHWARNINGS =
+ARCHDEFINES =
+ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = -x -a -l -o -s
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
- $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-ASFLAGS = -x -a -l -o -s
+SDCCLIB = z80.lib
-SDCCLIBDIR = /usr/local/share/sdcc/lib/z80
-SDCCLIB = z80.lib
+ASMEXT = .asm
+OBJEXT = .o
+LIBEXT = .lib
+EXEEXT = .hex
-ASMEXT = .asm
-OBJEXT = .o
-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
+ @echo "AS: $1"
+ $(Q) $(AS) $(AFLAGS) $2 $1
+endef
+# Custom CLEAN definition
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define CLEAN
+ $(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
+else
define CLEAN
- @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex
+ $(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
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
+# Linux/Cygwin host tool definitions
-HOSTCC = gcc
-HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
-HOSTLDFLAGS =
+ 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
diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig
index 8c2da3614..fa79acd30 100644
--- a/nuttx/configs/z80sim/ostest/defconfig
+++ b/nuttx/configs/z80sim/ostest/defconfig
@@ -8,15 +8,20 @@ CONFIG_NUTTX_NEWCONFIG=y
# Build Setup
#
# CONFIG_EXPERIMENTAL is not set
-CONFIG_HOST_LINUX=y
+# CONFIG_HOST_LINUX 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_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
#
-# CONFIG_APPS_DIR="../apps"
+# CONFIG_APPS_DIR="..\apps"
# 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_EZ80F92 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
diff --git a/nuttx/configs/z80sim/ostest/setenv.bat b/nuttx/configs/z80sim/ostest/setenv.bat
new file mode 100644
index 000000000..e5c7ff5bf
--- /dev/null
+++ b/nuttx/configs/z80sim/ostest/setenv.bat
@@ -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%
diff --git a/nuttx/configs/z80sim/pashello/Make.defs b/nuttx/configs/z80sim/pashello/Make.defs
index 16d3ff342..076aad7ed 100644
--- a/nuttx/configs/z80sim/pashello/Make.defs
+++ b/nuttx/configs/z80sim/pashello/Make.defs
@@ -36,56 +36,129 @@
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
-CROSSDEV =
-CC = sdcc
-CPP = sdcpp
-AR = sdcclib -a
-
-ifeq ($(CONFIG_SDCC_OLD),y)
-
-LD = link-z80
-AS = as-z80
-ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+# These are the directories where the SDCC toolchain is installed. NOTE
+# 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\z80
else
+ SDCC_INSTALLDIR = /usr/local
+ SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
+ SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
+endif
-LD = sdldz80
-AS = sdasz80
-ARCHCPUFLAGS = -mz80
+CROSSDEV =
+CC = sdcc
+CPP = sdcpp
+AR = sdcclib -a
+ifeq ($(CONFIG_SDCC_OLD),y)
+ LD = link-z80
+ AS = as-z80
+ ARCHCPUFLAGS = -mz80 --stack-auto --int-long-reent --float-reent
+else
+ LD = sdldz80
+ AS = sdasz80
+ ARCHCPUFLAGS = -mz80
endif
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
- ARCHOPTIMIZATION = --debug
+ ARCHOPTIMIZATION = --debug
else
- ARCHOPTIMIZATION =
+ ARCHOPTIMIZATION =
endif
-ARCHPICFLAGS =
-ARCHWARNINGS =
-ARCHDEFINES =
-ARCHINCLUDES = -I. -I$(TOPDIR)/include
+ARCHPICFLAGS =
+ARCHWARNINGS =
+ARCHDEFINES =
+ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
+
+CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
+AFLAGS = -x -a -l -o -s
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
- $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-ASFLAGS = -x -a -l -o -s
+SDCCLIB = z80.lib
-SDCCLIBDIR = /usr/local/share/sdcc/lib/z80
-SDCCLIB = z80.lib
+ASMEXT = .asm
+OBJEXT = .o
+LIBEXT = .lib
+EXEEXT = .hex
-ASMEXT = .asm
-OBJEXT = .o
-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
+ @echo "AS: $1"
+ $(Q) $(AS) $(AFLAGS) $2 $1
+endef
+# Custom CLEAN definition
+
+ifeq ($(CONFIG_WINDOWS_NATIVE),y)
+define CLEAN
+ $(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
+else
define CLEAN
- @rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex
+ $(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
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
+# Linux/Cygwin host tool definitions
-HOSTCC = gcc
-HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
-HOSTLDFLAGS =
+ 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
diff --git a/nuttx/configs/z80sim/scripts/setenv.bat b/nuttx/configs/z80sim/scripts/setenv.bat
new file mode 100644
index 000000000..c266d1e81
--- /dev/null
+++ b/nuttx/configs/z80sim/scripts/setenv.bat
@@ -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%
diff --git a/nuttx/configs/z80sim/ostest/setenv.sh b/nuttx/configs/z80sim/scripts/setenv.sh
index 239e35286..ead1e1f5f 100755
--- a/nuttx/configs/z80sim/ostest/setenv.sh
+++ b/nuttx/configs/z80sim/scripts/setenv.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# 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>
#
# Redistribution and use in source and binary forms, with or without
@@ -32,14 +32,35 @@
# POSSIBILITY OF SUCH DAMAGE.
#
-if [ "$(basename $0)" = "setenv.sh" ] ; then
+if [ "$_" = "$0" ] ; then
echo "You must source this script, not run it!" 1>&2
exit 1
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
+
+if [ -z "${PATH_ORIG}" ]; then
+ 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"
-export SDCC_BIN=/usr/local/bin
-export PATH=${SDCC_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
+#
+# Add the path to the toolchain to the PATH varialble
+#
+export PATH="${TOOLCHAIN_BIN}":/sbin:/usr/sbin:${PATH_ORIG}
echo "PATH : ${PATH}"