#
#  Directory: Site/dso/Wavefront
#
#  This directory builds GetWavefront.
#
#
#  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	= ..
INCDIR		= $(SITEROOT)/include
BINDIR		= $(SITEROOT)/bin



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



#  Source files for this directory.
#
C++FILES =  	MainDialogCB.c++ \
		WaveExport.c++



#  User Interface files for this directory.
#
UIFILES =	MainDialog.if

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



#  Files created by this Makefile which
#  need to be removed by clean & clobber.
#
LDIRT =		so_locations \
		GetWavefront



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

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



#  Targets for this Makefile.
#
TARGETS	=	GetWavefront

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:
	@echo "\nCompiling $*.c++"
	$(C++) $(C++FLAGS) -c -o $@ $<


#  Convert a C source file (.c) to an object file (.o)
#
.c.o:
	$(CC) -c $(CFLAGS) -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




#  Link the GetWavefront DSO.
#
GetWavefront: $(OBJECTS) $(UIOBJECTS)
	@echo "\nCreating DSO object $@"
#	$(C++) -shared -o $@ $(OBJECTS) $(UIOBJECTS)
	ld -shared -o $@ $(OBJECTS) $(UIOBJECTS)
	@if [ -d $(BINDIR)/plug-ins ] ; then cp $@ $(BINDIR)/plug-ins; fi;

