/****************************************************************************
 * Imakefile
 *
 * Make any compiler command line changes in this file
 ****************************************************************************/

/* If you're using Solaris, you may have to uncomment the line below */
/*
#undef ExtraLibraries
#define ExtraLibraries -lsocket -lnsl
*/

/* add any debugging options here.
 */
DEBUGOPTS =

/* Default options, for architectures that don't define an Architecture,
 * (for example the Alphas here at monash)
 */
CC = gcc

#if defined(AlphaArchitecture)	/* what is the correct definition? */
/* Alpha OSF/1
 */
CC = gcc
#endif

#if defined(SGIArchitecture)
CC = cc
#endif

#if defined(HPArchitecture)
/* Options for HP-UX
 */
CCOPTIONS = -Ae 
CC = cc
ARCHDEFINES = -DNO_SELECT_H
/* If you're daring and "what /bin/cc" >= A.09.61, then uncomment line below.
   Be warned that you may hit optimiser bugs though, depending on your compiler
   release. +O4 +Oall currently *does not* compile the code correctly */
/* CDEBUGFLAGS = +O4 +Onolimit +Oentrysched +Olibcalls +Onoinitcheck +Onoparmsoverlap */
#endif

#if defined(SunArchitecture)
/* Options for SunOS
 */
CC = gcc
CCOPTIONS = -I/usr/include/X11R5
ARCHDEFINES = -DNO_STRERROR -DNO_SELECT_H
/* Note for sun users - you may have to change CCOPTIONS to look in the
 * right directory for your site.
 * Also, you may have to change CPPPATH in config.h to point to the gnu
 * c pre-processor, as the default cpp seems to have trouble with the
 * vehicle files.
 */
#endif

#if defined(UltrixArchitecture)
/* Options for Ultrix
 */
CC = cc
CDEBUGFLAGS = -g
ARCHDEFINES = -DNO_SELECT_H
#endif

#Imake knows about cpp for this system
IMAKECPP  = CppCmd

NET3D_DIR = $(LIBDIR)/net3d
DEFINES = -DNET3D_DIR=\"$(NET3D_DIR)\" $(ARCHDEFINES) -DCPPCOMMAND=\"$(IMAKECPP)\" $(DEBUGOPTS)

SERVER_OBJS  = server.o command.o
CLIENT_OBJS  = client.o view.o game.o
NET_OBJS     = net.o
SHARED_OBJS  = file.o object.o matrix.o util.o brain.o
VEHICLE_OBJS = extras.o

COMMON_OBJS  = $(NET_OBJS) $(SHARED_OBJS) $(VEHICLE_OBJS)
OBJS         = $(CLIENT_OBJS) $(COMMON_OBJS)
DEPINCS	     = 3d.h net.h netprotos.h config.h icons.h net3d.h protos.h view_icon.h

LOCAL_LIBRARIES = -lX11 -lm ExtraLibraries

PROGRAMS = net3d net3dserv vtoc

AllTarget($(PROGRAMS))
ComplexProgramTarget(net3d)
SingleProgramTarget(net3dserv,$(SERVER_OBJS) $(COMMON_OBJS),$(LOCAL_LIBRARIES),$(HP_NULL_STR))
InstallProgram(net3dserv,$(BINDIR))
SingleProgramTarget(vtoc,vtoc.o,$(HP_NULL_STR),$(HP_NULL_STR))
MakeDirectories(install,$(NET3D_DIR))
	-cp *.v $(NET3D_DIR)
	-cd $(NET3D_DIR); chmod a+r *.v

extras.c: vtoc extras.v
	./vtoc extras.v >extras.c

clean::
	/bin/rm -f extras.c

