diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-12-03 20:12:59 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-12-03 20:12:59 +0000 |
commit | b052b3b6508e6a9a51017072c541fa0eb8467fdb (patch) | |
tree | 17f5df6ecd839ddf1ef41cffc724c6161486e06b /nuttx/configs/z80sim/nsh/Make.defs | |
parent | 73705c2998717a35ad81c099340caa518eaed785 (diff) | |
download | px4-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/z80sim/nsh/Make.defs')
-rw-r--r-- | nuttx/configs/z80sim/nsh/Make.defs | 143 |
1 files changed, 108 insertions, 35 deletions
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 |