#
# This makefile is provided as a template to create a customized version
# of WorkShop Visual that is integrated with XRT/graph, XRT/3d, XRT/table, XRT/field, XRT/gear.
# This is only an example makefile and is provided as is.  The user is responsible
# for uncommenting and correcting this file to work within his or her own environment.
#
#  SCCSID -- @(#)Makefile.SOLARIS	1.5    96/01/15 KL Group Inc.

XRTOBJS     = xrtconfig.o xrtcode.o XRT_iface.o
XRT_INC_DIR = $(XRTHOME)/include
XRT_LIB_DIR = $(XRTHOME)/lib
LIBXRTGRAPH = -lxrtm
LIBXRT3D    = -lxrt3d
LIBXRTTABLE = -lxrttable -lXpm
LIBXRTFIELD = -lxrtfield
LIBXRTGEAR  = -lxrtgear
LIBXPM      = -lXpm

RM = /bin/rm -f
CP = /bin/cp
###########################################################################
# DO NOT EDIT the following lines.  Using "./Configure" with the appropriate
# options to configure this portion of the integration Makefile. Type
# "./Configure -help" for a list of valid options.
###########################################################################

HASFLAGS    = -DHASXRTGRAPH -DHASXRT3D -DHASXRTTABLE -DHASXRTFIELDE -DHASXRTGEAR
LIBXRTALL   = $(LIBXRTGRAPH) $(LIBXRT3D) $(LIBXRTTABLE) $(LIBXRTFIELD) $(LIBXRTGEAR) $(LIBXPM)
XDOBJDIR    = obj
XDBINNAM    = visu

###########################################################################

## solaris 2.x
CFLAGS          = -D_NO_PROTO $(HASFLAGS)
MOTIF_INC_DIR   = /usr/dt/include
X11_INC_DIR     = /usr/openwin/include
MOTIF_LIB_DIR   = /usr/dt/lib
X11_LIB_DIR     = /usr/openwin/lib
XLIBS           = -lXext -lXm -lXm -lXt -lX11

CPPFLAGS        = -I$(XRT_INC_DIR) -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR) -I../hdrs -I.
LDFLAGS         = -R/usr/openwin/lib -R/usr/dt/lib -L$(XRT_LIB_DIR) -L$(MOTIF_LIB_DIR) -L$(X11_LIB_DIR)
STDLIBS         = -lm -ltt -lsocket -lnsl -ldl -lw -lgen

XDOBJ           = $(VISUROOT)/user_widgets/${XDOBJDIR}/visu.o
LIBS            = $(LIBXRTALL)  ${XLIBS} ${STDLIBS}

IFLAGS=-I$(XRT_INC_DIR) -I$(VISUROOT)/user_widgets/hdrs -I${X11_INC_DIR} -I${MOTIF_INC_DIR} -I.

.c.o:
	$(RM) $@
	cc -c $(CFLAGS) $(IFLAGS) $*.c

all: ${XDBINNAM}

${XDBINNAM}: $(XRTOBJS)
	CC -o ${XDBINNAM} $(XDOBJ) $(XRTOBJS) ${LDFLAGS} $(LIBS) 
	$(XRTHOME)/bin/xrt_auth ${XDBINNAM}

install-icons:
	@echo "Installing widget icons in ${VISUROOT}: ./color_icons ./bitmaps ..."
	@for file in $(ICONFILES); do \
		$(RM) ${VISUROOT}/color_icons/$$file; \
		$(RM) ${VISUROOT}/bitmaps/$$file; \
		$(CP) color_icons/$$file ${VISUROOT}/color_icons/.; \
		$(CP) color_icons/$$file ${VISUROOT}/bitmaps/.; \
	done

clean:
	$(RM) visu $(XRTOBJS)
