#
# The XXX_DIR variables below MUST have ABSOLUTE path. Since this file
# is sourced from several directories relative path specification will
# be simple wrong.
#

SRC_DIR = /mach/issue/misc/gershon/irit/sgi4d
#
# All libraries created will be installed into the LIB_DIR directory.
#
LIB_DIR = $(SRC_DIR)/lib

#
# All includes files associated with the installed libraries will be
# installed into the INC_DIR directory.
#
INC_DIR = $(SRC_DIR)/inc

#
# All binaries created will be installed into the BIN_DIR directory.
#
BIN_DIR = $(SRC_DIR)/bin

#
# Uncomment the correct set of variables to be used or modify it for
# your system.
#
# -D flags:
#
# -D__GL__ - if your system supports gl graphics library (SGI 4d & IBM R6000).
#
# -D__X11__ - if your system supports X11. Only one of __GL__ or __X11__ should
#	be used.
#
#  Emulation to the following function are available by defining the
#  following. Look at misc_lib/xgeneral.c/h for implementation.
# -DGETCWD - if getcwd is not defined in this system.
# -DSTRSTR - if strstr is not defined in this system.
# -DSTRDUP - if strdup is not defined in this system.
# -DSTRICMP - if stricmp and strincmp are not defined in this system.
#
# -DTIMES - if times is defined in your system, otherwise uses time.
#
# -DRAND - if the (s)rand random number generator exists.
# -DRAND48 - ?rand48 random number generators exists.
#	If non of RAND or RAND48 are defined, (s)random is used.
#
# -DUSLEEP - if usleep is defined in the system.
# -DSGINAP - on sgi systems instead of usleep.
#
# -DNO_VOID_PTR - if your C compiler does not support (void *).
#
# -DUSE_VARARGS - if your system does not have stdarg.h and have the old
#	varargs.h.
#
# -DNO_CONCAT_STR - if 'char *p = "This is" "one string";' is illegal.
#
# -DGRAPDRVS - any combination of of 'xgldrvs', 'xgladap', 'x11drvs'.
#
# Other, possibly useful defines (for c code development):
#
# -DDEBUG - for some debugging functions in the code (that can be invoked
#		from a debugger).
#

#
# Flags for SGI 4d, Irix 3.x, using GL or X11:
#
# CC = cc
# DFLAGS = -DNO_VOID_PTR -DSTRICMP -DNO_CONCAT_STR -DSGINAP -DRAND48 -DTIMES -D__UNIX__ -D__GL__ -D__X11__
# CFLAGS = -O $(DFLAGS) -Olimit 1000 -Wf,-XNh5000 -Wf,-XNd5000 -G 4
# CFLAGS = -g $(DFLAGS) -Olimit 1000 -Wf,-XNh5000 -Wf,-XNd5000 -G 4
# MORELIBS = -lbsd
# GRAPX11LIBS = -lX11
# GRAPGLLIBS = -lgl_s
# GRAPDRVS = xgldrvs x11drvs nuldrvs

#
# Flags for SGI 4d, Irix 4.0, using GL or X11:
#
CC = cc -fullwarn -woff 302,303,269,927 -xansi
DFLAGS = -DSTRICMP -DSGINAP -DRAND48 -DTIMES -D__UNIX__ -D__GL__ -D__X11__
# CFLAGS = -O $(DFLAGS) -Olimit 1000 -Wf,-XNh5000 -Wf,-XNd5000 -G 4
CFLAGS = -g $(DFLAGS) -Olimit 1000 -Wf,-XNh5000 -Wf,-XNd5000 -G 4
MORELIBS = -lbsd
GRAPX11LIBS = -lX11
GRAPGLLIBS =-lgl_s
GRAPDRVS = xgldrvs x11drvs nuldrvs

#
# Flags for i386 SVR4 using X11
#
# CC = cc
# DFLAGS = -D__UNIX__ -D__X11__ -DSTRICMP 
# CFLAGS = -O $(DFLAGS)
# CFLAGS = -g $(DFLAGS)
# MORELIBS = -lsocket -lnsl
# GRAPX11LIBS = -lX11
# GRAPDRVS = x11drvs nuldrvs

#
# Flags for BSD4.3/SUN O.S. 4.1.1 using gcc 1.39 and X11:
# Note you cannot use SUN's native cc compiler since it does not support
# Ansi C.
#
# CC = gcc
# DFLAGS = -DUSE_VARARGS -DUSLEEP -DTIMES -D__UNIX__ -D__X11__
# CFLAGS = -O $(DFLAGS)
# CFLAGS = -g $(DFLAGS)
# MORELIBS = 
# GRAPX11LIBS = -lX11
# GRAPDRVS = x11drvs nuldrvs

#
# Flags for SUN ipx O.S. 4.1.3 using gcc 2.4.5 and X11:
# Note you cannot use SUN's native cc compiler since it does not support
# Ansi C.
#
# CC = gcc
# DFLAGS = -DTIMES -DUSLEEP -D__UNIX__ -D__X11__
# CFLAGS = -O2 $(DFLAGS)
# CFLAGS = -g $(DFLAGS)
# MORELIBS = 
# GRAPX11LIBS = -lX11
# GRAPDRVS = x11drvs nuldrvs

#
# Flags for HPBSD 4.3, HP300/400 and X11
# Note I used gnumake here since the provided make do not support the
# 'include ../makeflag.unx' directive.
#
# CC = gcc
# DFLAGS = -DUSE_VARARGS -DRAND48 -DTIMES -D__UNIX__ -D__X11__ -DSTRICMP -DSTRSTR -DGETCWD
# CFLAGS = -O $(DFLAGS)
# CFLAGS = -g -pg $(DFLAGS)
# MORELIBS = 
# GRAPX11LIBS = -lX11
# GRAPDRVS = x11drvs nuldrvs

#
# Flags for a DEC 5000/200, with gcc, x11:
#
# CC = gcc
# DFLAGS = -DSTRDUP -DSTRICMP -DRAND48 -DTIMES -D__UNIX__ -D__X11__
# CFLAGS = -O $(DFLAGS)
# CFLAGS = -O -fstrength-reduce -fcombine-regs -fforce-mem -fforce-addr -fomit-frame-pointer -finline-functions -fcaller-saves -fdelayed-branch $(DFLAGS)
# MORELIBS = 
# GRAPX11LIBS = -lX11
# GRAPDRVS = x11drvs nuldrvs

#
# Flags for a DEC 5000/240, with cc, x11:
#
# CC = cc
# DFLAGS = -DSTRDUP -DSTRICMP -DRAND48 -DTIMES -DNO_CONCAT_STR -D__UNIX__ -D__X11__
# CFLAGS = -O $(DFLAGS)
# CFLAGS = -g $(DFLAGS)
# MORELIBS = 
# GRAPX11LIBS = -lX11
# GRAPDRVS = x11drvs nuldrvs

#
# Flags for IBM RS6000 using GL or X11
# The gl implementation (in both software and hardware) on the RS6000
# could be better. Although basically working, its speed is approximately
# the same as X11 (You do get hardware rendering though)...
#
# CC = xlc
# DFLAGS = -D_POSIX_SOURCE -D_ALL_SOURCE -DSTRSTR -DSTRDUP -DSTRICMP -DRAND48 -DTIMES -D__UNIX__ -D__X11__ -D__GL__
# CFLAGS = -O -qnoro $(DFLAGS)
# CFLAGS = -g -pg -qnoro $(DFLAGS)
# MORELIBS =
# GRAPX11LIBS = -lX11
# GRAPGLLIBS = -lgl
# GRAPDRVS = xgldrvs x11drvs nuldrvs

#
# Flags for HP 7xx (snake) machines running hpux.
#
# CC = cc
# DFLAGS = -DSTRICMP  -DRAND -DTIMES -D__UNIX__ -D__X11__
# CFLAGS = -Aa -O $(DFLAGS) -D_INCLUDE_POSIX_SOURCE
# CFLAGS = -Aa -g $(DFLAGS) -D_INCLUDE_POSIX_SOURCE
# MORELIBS =
# GRAPX11LIBS = -L/usr/lib/X11R4 -lX11
# GRAPDRVS = x11drvs nuldrvs

#
# Flags for IBM PC, SYSV3.2, ISC 2.2.1 and MIT X11R4, using gcc 1.40
#
# CC = gcc
# DFLAGS = -DSTRICMP -DNO_CONCAT_STR -DUSE_VARARGS -DRAND48 -DTIMES -D__UNIX__ -D__X11__ -DNO_ASM -DISC
# CFLAGS = -O $(DFLAGS)
# MORELIBS = -L/usr2/lib -linet -lpt -lcposix
# GRAPX11LIBS = -lX11_s
# GRAPDRVS = x11drvs nuldrvs

#
# Flags for Evans & Sutherland ESV
#
# CC = cc
# DFLAGS = -DSTRICMP -DNO_CONCAT_STR -DRAND48 -DTIMES -D__UNIX__ -D__X11__ 
# CFLAGS = -systype sysv -s -O $(DFLAGS)
# MORELIBS = -systype sysv -lbsd
# GRAPX11LIBS = -lX11
# GRAPDRVS = x11drvs nuldrvs

#
# Default rule for compilation.
#
.c.o:
	$(CC) $(CFLAGS) -I. -I$(INC_DIR) -c $<

#
# All libraries.
#
LIBS =	-L$(LIB_DIR) -lgeom -lprsr -lcagd -lmisc # -lgif
