# /bin/make Makefile for the rwviewer demo

# Change this according to the compiler you wish to use
CC=gcc -DSYSV

# 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= /usr/openwin

# Change this to point to your Motif tree (if not in /usr/{lib,include})
MOTIF= /usr/dt
#MOTIF3= /net1/Motif1.2
MOTIF3= /net/X11R4/motif-1.1/motif-1.1.3

# Change this to point to the to of your RenderWare install tree
RENDERWARETOP = /opt/net1/renderware/rw
RENDERWARETOP3 = /net1/renderware/rw

OBJS=visu_cb.o visu_ini.o visu_func.o visu.o create_cb.o animation_cb.o \
     Trajectoire.o Video.o outils.o ResUtils.o Liste.o interfacage.o \
     creation_affiche.o creation_pixmap.o creation_world.o objet.o

DOBJS= ${OBJS:%.o=%.d.o}
OBJS3= ${OBJS:%.o=%.ip5.o}


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

INCLUDE3=\
	-I${MOTIF3}/include \
	-I${WINSYS}/include \
	-I${RENDERWARETOP3}/include \
	-I/usr/openwin/include/X11 \
	-I/usr/openwin/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}/SunOS5/lib/sun4m/

LFLAGS3= \
	-L${MOTIF3}/lib \
	-L${WINSYS}/lib \
	-L/net1/renderware/rw/SunOS4/lib/sun4c \
	-L/net/X11R4/motif-1.1/motif-1.1.3/lib \
	-L/net/X11R4/motif-1.1/motif-1.1.3/extensions/lib 

#-L/net/X11R5/lib

DLFLAGS= \
	-g \
	-L${MOTIF}/lib \
	-L${WINSYS}/lib \
	-L${RENDERWARETOP}/SunOS5/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= -lXext -lrw  -lXm -lXt -lX11 -lm 
DLIBS= -lrw -lXm -lXt lXext -lX11 -lm 

visu:	${OBJS}
	${CC} ${LFLAGS} ${QUALIFIER} -o $@ ${OBJS} ${LIBS}

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

visu3:	${OBJS3}
	${CC} ${LFLAGS3} ${QUALIFIER} -o $@ ${OBJS3} ${LIBS}

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

visu2:	${OBJS2}
	${CC} ${LFLAGS} ${QUALIFIER} -o $@ ${OBJS} ${LIBS}

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

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

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

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