#
#  To compile with debug, use the env var CPP_DEBUG:
#
#	setenv CPP_DEBUG -g
#
#
#  To customize the include path or compile flags,
#  use these macros located below in this file:
#
#	LC++INCS	to modify include path
#	LC++OPTS	to modify compile flags
#
#
#  This Makefile still has these following external references:
#
#	/remote/dolphin/swre3/Server/uimx_2.6/bin/uxcgen
#	../../include/
#



#  SITEROOT defines the "Site" directory of the development tree.
#  It is a relative path from this current directory. All other
#  variables in this Makefile should be relative to SITEROOT.
#
SITEROOT	= $(GAMES_LOCATION)
INCDIR		= -I$(ALIAS_LOCATION)/ODS/Common/include -I$(SITEROOT)/include -I$(GAMES_LOCATION)/source/GameTools

DTOBJS      = $(GAMES_LOCATION)/lib/libDtOMio.so 

#  Include SGI common definitions.
#
include	/usr/include/make/commondefs



#  Source files for this directory.
#
CFILES =

C++FILES =	getvrml2.c++ getvrml2gui.c++ getvrml2anim.c++


#  User Interface files for this directory.
#
UIFILES =	

UISOURCES =	$(UIFILES:.if=.c)
UIOBJECTS =	$(UISOURCES:.c=.o)

OBJ1 = 		getvrml2.o getvrml2gui.o getvrml2anim.o VRML2GUILib.o

OBJ2 = 	

OBJ3 = 	

CPP_DEBUG	= -mips2 -O2


#  Files created by this Makefile which
#  need to be removed by clean & clobber.
#
#LDIRT =		Options.h \
#		VMapper.h \
#		$(UIFILES:.if=.c) \
#		so_locations \
#		*.rf

LDIRT =		so_locations \
		GetVRML2


#  Local macros used on the compile line. Use the env var
#  CPP_DEBUG to turn on debug (setenv CPP_DEBUG -g).
#
LC++INCS	= -I. $(INCDIR)
LC++OPTS	= ${CPP_DEBUG} -fullwarn -D_SVR4_SOURCE -D_SGI_SOURCE -DXT_CODE

LCINCS		= -I. $(INCDIR)
LCOPTS		= ${CPP_DEBUG} -fullwarn -D_SVR4_SOURCE -D_SGI_SOURCE -DXT_CODE



#  Targets for this Makefile.
#
TARGETS	=	GetVRML2

default:	$(TARGETS)



#  Include SGI common rules. This line must be after
#  the first rule in this Makefile. Add our own rules
#  after the SGI rules.
#
include $(COMMONRULES)


#  Convert a C++ source file (.c++) to an object file (.o)
#
.c++.o:
	$(C++) $(C++FLAGS) -c -o $@ $<


#  Convert a C source file (.c) to an object file (.o)
#
.c.o:
	$(CC) -c $(CFLAGS) -Xcpluscomm -o $@ $<


#  Convert a UIM/X interface file (.if) to an object file (.o)
#
UXCGEN		= $(SITEROOT)/bin/uxcgen
UXCFLAGS	= -a -h -x

.SUFFIXES:	.if

#.if.c:
#	@echo "\nProcessing $*.if"
#	$(UXCGEN) $(UXCFLAGS) $*.if
#	@echo "\nPassing $*.h through ExternC.awk"
#	awk -f ExternC.awk $*.h > $*.h,new
#	mv $*.h,new $*.h



# 
# Create VRML2GUILib.o from plugins/VRML2GUILib.c++ source
VRML2GUILib.o: $(GAMES_LOCATION)/source/GameTools/VRML2GUILib.c++
	$(C++) $(C++FLAGS) -c -o $@ $(GAMES_LOCATION)/source/GameTools/VRML2GUILib.c++

#  Link the GetVRML2 DSO.
#
GetVRML2: $(OBJ1) $(UIOBJECTS)
#	$(C++) -shared -o $@ $(OBJ1) $(UIOBJECTS)
	ld -shared -o $@  $(OBJ1) $(UIOBJECTS) $(DTOBJS) -limage



