2008-02-07 02:43:56 +01:00
|
|
|
############################################################################
|
2008-11-26 19:59:14 +01:00
|
|
|
# configs/z80sim/nsh/Make.defs
|
2008-02-07 02:43:56 +01:00
|
|
|
#
|
2012-02-27 20:50:35 +01:00
|
|
|
# Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved.
|
|
|
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
2008-02-07 02:43:56 +01:00
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name NuttX nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
include ${TOPDIR}/.config
|
2012-08-27 16:07:17 +02:00
|
|
|
include ${TOPDIR}/tools/Config.mk
|
2008-02-07 02:43:56 +01:00
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
# 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.
|
2012-09-14 00:04:47 +02:00
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
|
|
|
|
SDCC_INSTALLDIR = C:\PROGRA~2\SDCC
|
|
|
|
SDCC_BINDIR = $(SDCC_INSTALLDIR)\bin
|
|
|
|
SDCC_LIBDIR = $(SDCC_INSTALLDIR)\lib\z80
|
2012-09-14 00:04:47 +02:00
|
|
|
else
|
2012-12-03 21:12:59 +01:00
|
|
|
SDCC_INSTALLDIR = /usr/local
|
|
|
|
SDCC_BINDIR = $(SDCC_INSTALLDIR)/bin
|
|
|
|
SDCC_LIBDIR = $(SDCC_INSTALLDIR)/share/sdcc/lib/z80
|
|
|
|
endif
|
2012-09-14 00:04:47 +02:00
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
CROSSDEV =
|
|
|
|
CC = sdcc
|
|
|
|
CPP = sdcpp
|
2012-12-07 20:02:57 +01:00
|
|
|
LD = sdldz80
|
|
|
|
AS = sdasz80
|
|
|
|
AR = sdar -r
|
|
|
|
ARCHCPUFLAGS = -mz80
|
2012-09-14 00:04:47 +02:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
2012-12-03 21:12:59 +01:00
|
|
|
ARCHOPTIMIZATION = --debug
|
2008-02-07 02:43:56 +01:00
|
|
|
else
|
2012-12-03 21:12:59 +01:00
|
|
|
ARCHOPTIMIZATION =
|
2008-02-07 02:43:56 +01:00
|
|
|
endif
|
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
ARCHPICFLAGS =
|
|
|
|
ARCHWARNINGS =
|
|
|
|
ARCHDEFINES =
|
|
|
|
ARCHINCLUDES = -I. -I$(TOPDIR)$(DELIM)include
|
|
|
|
|
|
|
|
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
|
|
|
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
|
2012-12-07 20:02:57 +01:00
|
|
|
AFLAGS = -x -a -l -o -s -g
|
2008-02-07 02:43:56 +01:00
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
SDCCLIB = z80.lib
|
2008-02-07 02:43:56 +01:00
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
ASMEXT = .asm
|
|
|
|
OBJEXT = .o
|
|
|
|
LIBEXT = .lib
|
|
|
|
EXEEXT = .hex
|
2008-02-07 02:43:56 +01:00
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
# 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
|
2008-02-07 02:43:56 +01:00
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
# 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
|
2008-02-07 02:43:56 +01:00
|
|
|
define CLEAN
|
2012-12-03 21:12:59 +01:00
|
|
|
$(Q) rm -f *.o *.asm *.rel *.lst *.rst *.sym *.adb *.lnk *.map *.mem *.hex *.cmd
|
2008-02-07 02:43:56 +01:00
|
|
|
endef
|
2012-12-03 21:12:59 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Windows native host tool definitions
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
|
|
|
|
HOSTCC = mingw32-gcc.exe
|
|
|
|
HOSTINCLUDES = -I.
|
2015-09-01 18:02:36 +02:00
|
|
|
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
|
2012-12-03 21:12:59 +01:00
|
|
|
HOSTLDFLAGS =
|
|
|
|
HOSTEXEEXT = .exe
|
|
|
|
|
|
|
|
# Windows-native host tools
|
|
|
|
|
|
|
|
MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative
|
2012-12-08 17:37:43 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
else
|
2008-02-07 02:43:56 +01:00
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
# Linux/Cygwin host tool definitions
|
2008-02-07 02:43:56 +01:00
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
HOSTCC = gcc
|
|
|
|
HOSTINCLUDES = -I.
|
2015-09-01 18:02:36 +02:00
|
|
|
HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
|
2012-12-03 21:12:59 +01:00
|
|
|
HOSTLDFLAGS =
|
|
|
|
|
|
|
|
# This is the tool to use for dependencies (i.e., none)
|
|
|
|
|
2016-01-09 21:13:44 +01:00
|
|
|
MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mkwindeps.sh
|
2012-12-03 21:12:59 +01:00
|
|
|
|
|
|
|
# SDCC for Linux, OSX, or Cygwin understands symbolic links. Windows SDCC
|
|
|
|
# running under Cygwin does not
|
|
|
|
|
|
|
|
ifeq ($(WINTOOL),y)
|
2012-12-08 17:37:43 +01:00
|
|
|
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)copydir.sh
|
2012-12-03 21:12:59 +01:00
|
|
|
else
|
|
|
|
DIRLINK = $(TOPDIR)$(DELIM)tools$(DELIM)link.sh
|
|
|
|
endif
|
2012-12-08 17:37:43 +01:00
|
|
|
DIRUNLINK = $(TOPDIR)$(DELIM)tools$(DELIM)unlink.sh
|
|
|
|
|
2012-12-03 21:12:59 +01:00
|
|
|
endif
|