#
#  Makefile for the common reve routines.
#
#  @(#)Makefile 1.3 94/01/27
#
#  Copyright (C) 1990 - 1994 - Rich Burridge & Yves Gallot.
#  All rights reserved.
#
#  Permission is granted to copy this source, for redistribution
#  in source form only, provided the news headers in "substantially
#  unaltered format" are retained, the introductory messages are not
#  removed, and no monies are exchanged.
#
#  Permission is also granted to copy this source, without the
#  news headers, for the purposes of making an executable copy by
#  means of compilation, provided that such copy will not be used
#  for the purposes of competition in any othello tournaments, without
#  prior permission from the authors.
#
#  No responsibility is taken for any errors inherent either
#  to the comments or the code of this program, but if reported
#  (see README file), then an attempt will be made to fix them.
#
#=====================================================================
#
#  There are various small changes needed when compiling reve on
#  different systems. These have been isolated here, and should be
#  uncommented if needed.
#
#=======================================================================
#  It is possible to change the location of the reve edge table file
#  with the -e command line option. It can also be defined at compile
#  time, by uncommenting the macro definition below and setting
#  appropriately. If it's not present, then a sensible default value
#  is used.
#
#EDGENAMEFILE    = $(REVELIBDIR)/reve.edgetable
#EDGENAME        = -DEDGENAME=\"$(EDGENAMEFILE)\"
#-----------------------------------------------------------------------
#  If your system has the getdtablesize() library call, then you will
#  need to uncomment the following definition.
#
#HAS_GETDTAB = -DHAS_GETDTAB
#-----------------------------------------------------------------------
#  If you want the computer moves to be played by a separate program,
#  started by reve and connected to reve by a pair of pipes, then
#  uncomment this definition.
#
#HASREVEPROC     = -DHASREVEPROC
#-----------------------------------------------------------------------
#  It is possible to change the location of the reve help file
#  with the -h command line option. It can also be defined at compile
#  time, by uncommenting the macro definition below and setting
#  appropriately. If it's not present, then a sensible default value
#  is used.
#
#HELPNAMEFILE    = $(REVELIBDIR)/reve.help
#HELPNAME        = -DHELPNAME=\"$(HELPNAMEFILE)\"
#-----------------------------------------------------------------------
#  If your system doesn't have the getdtablesize() library call, then
#  you will need to uncomment the following definition. This will be
#  needed for SVR4.
#
#NOGETDTAB = -DNOGETDTAB
#-----------------------------------------------------------------------
#  If you don't want to compile in the networking code to allow reve to be
#  able to handle -opponent user@host, then uncomment the following
#  definition.
#
#NO_NETWORK      = -DNO_NETWORK
#-----------------------------------------------------------------------
#  If your machine doesn't have a definition for the timeval struct, then
#  you will need to uncomment this definition. It's needed to get Reve to
#  work an an AT&T UNIX PC (aka 7300 or 3b1).
#
#NO_TIMEVAL     = -DNO_TIMEVAL
#------------------------------------------------------------------------
#  The utility program trans, which can create Postscript output from a
#  reve game, uses a prologue file.
#
#  It is possible to change the location of the trans prologue file
#  by uncommenting the macro definition below and setting appropriately.
#  If it's not present, then a sensible default value is used.
#
#PROLOGUE = -DPROLOGUE=\"$(LIBDIR)\"
#------------------------------------------------------------------------
#  It is possible to change the location of the reve_proc program file
#  with the -r command line option. It can also be defined at compile
#  time, by uncommenting the macro definition below and setting
#  appropriately. If it's not present, then a sensible default value
#  is used.
#
#REVEPROCFILE  = $(REVEBINDIR)/reve_proc
#REVEPROC      = -DREVEPROC=\"$(REVEPROCFILE)\"
#------------------------------------------------------------------------
#  If you are running on a system, where the second parameter to a signal
#  call is a pointer to an integer function, then this definition needs
#  to be uncommented.
#
#SIGRET         = -DINT_SIGNAL
#-----------------------------------------------------------------------
#  If you are building reve on an SVR4 machine, then you should also
#  uncomment this definition.
#
#  If you are running on a 80286 machine, Microport's 5.2 port of SYSV,
#  SVAT, or Xenix286, then you will need to uncomment this definition.
#  This ought to work under 5.3 as well.
#
#SVR4  = -DSVR4
#===========================================================================
#  Compilation flags and standard macro definitions.
#
CDEFS    = $(EDGENAME) $(HAS_GETDTAB) $(HASREVEPROC) \
	   $(HELPNAME) $(NOGETDTAB) $(NO_NETWORK) \
	   $(NO_TIMEVAL) $(REVEPROC) $(SELTYPE) $(SIGRET) $(SVR4)
CCOMP    = -O

CC       = gcc

CFLAGS   = $(CCOMP) $(CDEFS)
CCFLAGS  = $(CCOMP) $(CDEFS)

LDFLAGS  =
LIBS     =

#=================================================================
 
.KEEP_STATE:

COMPSRCS        = rev_eval.c rev_ip.c rev_iycp.c
REVESRCS        = reve_proc.c $(COMPSRCS)
REVEDSRCS       = in.reved.c
STDSRCS         = boardstuff.c get.c procs.c socket.c $(COMPSRCS)
COMPOBJS        = rev_eval.o rev_ip.o rev_iycp.o
REVEOBJS        = reve_proc.o $(COMPOBJS)
REVEDOBJS       = in.reved.o
STDOBJS         = boardstuff.o get.o procs.o socket.o $(COMPOBJS)

HDRS            = ctl.h reve.h patchlevel.h

OTHERS          = CHANGES CHANGES.v1-1 README TODO reve.man MANIFEST FILES \
		  reve.man.text Makefile.dist

common: $(STDOBJS)

clean:
	rm -f *.o core

create: SCCS
	-sccs create $(STDSRCS) $(REVESRCS) reve_proc.c $(HDRS) $(OTHERS)

SCCS:
	mkdir SCCS
	chmod 755 SCCS

boardstuff.o:   boardstuff.c reve.h
get.o:          get.c reve.h
procs.o:        procs.c reve.h
rev_eval.o:     rev_eval.c reve.h
rev_ip.o:       rev_ip.c reve.h
rev_iycp.o:     rev_iycp.c reve.h
socket.o:       socket.c reve.h ctl.h
