# /bin/make Makefile for the rwmaze demo

# Change this according to the compiler you wish to use
CC=/net/bin/gcc

# Set default OSTYPE and SPARCTYPE if not already set
OSTYPE :sh = if [ !$?OSTYPE ];\
	     then if [ -x /usr/sbin/prtconf ]; \
	          then echo "SunOS5";\
		  else echo "SunOS4";\
		  fi;\
	      else echo \$OSTYPE;\
	      fi

SPARCTYPE :sh = if [ !$?SPARCTYPE ];\
		then if [ `uname -m` = "sun4m" ];\
		     then echo "sun4m";\
		     elif [ `uname -m` = "sun4c" ];\
		     then echo "sun4c";\
		     else echo "sun4";\
		     fi\
	        else echo \$SPARCTYPE;\
	        fi

# Change this according to the library who wish to link with
LIBPATH = sun4

# Change to inform your compiler of the host CPU type
QUALIFIER= -mcypress

# Change this to point to you X11 tree (if not in /usr/{lib,include})
WINSYS= /apps/X11R5

# Change this to point to your Motif tree (if not in /usr/{lib,include})
MOTIF= /n/cruella/3dg/Motif

# Change this to point to the to of your RenderWare install tree
RENDERWARETOP = ../..

OBJS= rwmaze.o MessageBox.o ResUtils.o
DOBJS= ${OBJS:%.o=%.d.o}


INCLUDE=\
	-I${MOTIF}/include \
	-I${WINSYS}/include \
	-I${RENDERWARETOP}/include \

# Change this to the optimization flags for your compiler
CFLAGS= \
	-O2 \
	-ffast-math \
	-fstrength-reduce \
	-fdelayed-branch \
	-fexpensive-optimizations \
	-fomit-frame-pointer


DCFLAGS= \
	-ggdb \
	-I${MOTIF}/include \
	-I${WINSYS}/include \
	-I${RENDERWARETOP}/include \
	-O2 \
	-ffast-math \
	-fstrength-reduce \
	-fdelayed-branch \
	-fexpensive-optimizations \
	-fomit-frame-pointer

LFLAGS= \
	-L${MOTIF}/lib \
	-L${WINSYS}/lib \
	-L${RENDERWARETOP}/${OSTYPE}/lib/${LIBPATH}

DLFLAGS= \
	-g \
	-L${MOTIF}/lib \
	-L${WINSYS}/lib \
	-L${RENDERWARETOP}/${OSTYPE}/lib/devel

# Solaris 2 libraries
LIBS= -lrw -lXm -lXt -lXext -lX11 -lgen -lm
DLIBS= -lrw -lXm -lXt -lXext -lX11 -lgen -lm
# Solaris 1 libraries
LIBS= -lrw -lXm -lXt -lXext -lX11  -lm
DLIBS= -lrw -lXm -lXt -lXext -lX11 -lm

rwmaze:	${OBJS}
	${CC} ${LFLAGS} ${QUALIFIER} -o $@ ${OBJS} ${LIBS}
	strip $@
	ldd $@

%.o: %.c
	${CC} ${INCLUDE} ${CFLAGS} ${QUALIFIER} -c $< -o $@

rwmazeDebug: ${DOBJS}
	${CC} ${DLFLAGS} -o $@ ${DOBJS} ${DLIBS}

%.d.o: %.c
	${CC} ${DCFLAGS} -c $< -o $@

clean:
	rm -rf ${OBJS} ${DOBJS}

