# The basic definitions for all Amiga Makefiles of DGD
#
# This Makefile was written for Dennis Vadura's DMake 3.6.
#
# DMake supports a generic startup with common macro definitions, so for me
# the following macros are defined automatically:
#
# MAKE= $(MAKECMD) $(MFLAGS)
# CC,LD,AS= dcc,dlink,das
# CFLAGS= -O ""
# YTAB= y.tab
# CP= c:copy
# RM= c:delete
# MV= c:rename
#
# The original makefile had 'CC= gcc' in it...
# The CFLAGS- and YFLAGS-values are modified for Mud-Stuff below.
# There is also a section below where you can add your own pet compiler.

#-----------------------------------------------------------------------------

# What Amiga-compiler do we use? Known by this Makefile (and some sources) are:
#   Compiler families (CCFAMILY):
#	DICE: any DICE compiler
#   Compiler versions (WHATCC, for more subtle differences):
#	DICE207: DICE 2.07.53

CCFAMILY= DICE
WHATCC= DICE207

# What type of net package do we use? Known by this Makefile are:
#   AS225 : Commodores AS225 software
#   AMITCP: The AmiTCP package from hut.fi
#
# Leave it empty for the simulation (the default).

NETTYPE= AMITCP

# Which yacc to use?

YACC= byacc
YFLAGS=

# Unix has an option '-f' for it's 'rm' - not the Amiga, so I define
#   RMF= $(RM) -f
# and modify it for Amiga as:

RMF= $(RM)

#-----------------------------------------------------------------------------
# -- Compiler specifics --
#
# Set CCOPTS to any options you need to compile LPMud, what includes
# warning- and optimization options!
#
# If your compiler doesn't define the cpp-symbol AMIGA, it's a good idea
# to add it here.
# If your compiler doesn't have own code for float maths, you must
# define _NO_OWN_FLOATS so OS 1.3-versions will compile properly.
#
# To compile the hosts/amiga/alarm_rr, your compiler must be able to
# generate C-Code with registerized parameters. If it needs a special
# option to do this, put it into ROPT.
#
# If your compiler needs additional sources, put them into XSRC, and
# the object files to generate into XOBJ.
# If your compiler doesn't have alloca(), make approbiate patches in host.h

.IF $(CCFAMILY) == DICE

# -gs tells DICE to use dynamic stack code (needed for its alloca)
# -mC tells DICE to use the large code model.
# -mD tells DICE to use the large data model.
# -s  tells DICE to include symbolic information into the executable.
# AMIGA is defined automatically.

CCOPTS = -s -gs -mC # -mD -DAMIGA

ROPT= -mRR

.END


# -- Net specifics --
#
# Set NETDEF to define the appropriate symbol selecting the special
# interface code.
# Set NETLIB to specify any additionally needed linker library.
#
# Default first...

NETDEF=
NETLIB=

.IF $(NETTYPE) == AS225
NETDEF= -DAS255
NETLIB= -l socket
.END

.IF $(NETTYPE) == AMITCP
NETDEF= -DAMITCP
NETLIB= -l net
.END

# -----------------------------------------------------------------------
# Some final defines for the gamedriver.

HOST=	 AMIGA
DEFINES= -D$(HOST) -D$(WHATCC) $(NETDEF)
DEBUG=	 -DDEBUG
CCFLAGS= $(CCOPTS) $(DEFINES) $(DEBUG)
LDFLAGS= $(CCOPTS)
LIBS=	 $(NETLIB) -lm
