/**/#
/**/#	This is an Imakefile for the XGobi program.  Changes you might
/**/#	want to make are  ...
/**/#	  Set the XGOBIDIR variable
/**/#	  You might need to set the random number generator, though
/**/#	    probably most architectures have drand48.
/**/#     If you want to use RPC (Remote Procedure Calls) to link
/**/#       xgobi to other software, see the section on RPC
/**/#

/**/#  Set XGOBIDIR to the directory containing 
/**/#  the xgobi directories src, help, ps, etc.
        XGOBIDIR = $(PWD)/..
              CC = gcc
              LD = 
     CDEBUGFLAGS = -g
#EXTRA_LDOPTIONS = -static
   EXTRA_DEFINES =

/**/#  Choose a random number generator, random or drand48
              #R = USE_RANDOM
               R = USE_DRAND48

/**/#
/**/# RPC: Remote Procedure Calls
/**/#

/**/#  If using RPC ...
#  EXTRA_DEFINES = -DRPC_USED
/**/# ... also, uncomment this #define
#define RPC

/**/#  If using RPC to communicate with XploRe ... 
#EXTRA_DEFINES = -DRPC_USED -DXPLORE

#ifdef HPArchitecture
               R = USE_DRAND48
       CCOPTIONS = -Aa -D_HPUX_SOURCE -DXLIB_ILLEGAL_ACCESS 
#endif

 LOCAL_LIBRARIES = XawClientLibs
   SYS_LIBRARIES = -lm
         DEFINES = -D$(R) -DDEFAULTDIR=\"$(XGOBIDIR)\" $(EXTRA_DEFINES)

SRCS = *.c
XGOBIOBJ = xgobi_init.o pipeline.o read_array.o \
	initialize.o widgets.o callbacks.o getfname.o \
	xyplot.o make_axes.o \
	spin_cbacks.o spin.o \
	tour_init.o tour_util.o tour.o tour_cbacks.o tour_send.o gt_ctls.o \
	tour_pp.o svd.o kernel.o \
	legendre.o hermite.o natrl_hermite.o de_indices.o \
	central_mass.o holes.o skewness.o \
	tour_section.o corr.o corr_index.o corr_pursuit.o corr_util.o \
	scaling.o scale_cbacks.o \
	brush_init.o brush_cbacks.o brush.o paint.o brush_send.o \
	identify.o var_panel.o transform.o \
	help.o prt_plotwin.o subset.o vc_lists.o \
	plot_once.o dotplot.o texture.o move_points.o \
	line_editor.o missing.o show_message.o \
    smooth.o smooth_fns.o smoothsk.o pspline.o \
	save_data.o new_data.o read_data.o jitter.o parcoords.o utils.o

RPCOBJ = rpc_client.o rpc_server_svc.o rpc_server_proc.o \
	rpc_functions.o rpc_xgobi.o rpc_spatial.o rpc_xpl.o

#ifdef RPC
OBJ = $(XGOBIOBJ) $(RPCOBJ)
#else
OBJ = $(XGOBIOBJ)
#endif

OBJS = xgobi.o ${OBJ}

ComplexProgramTarget(xgobi)

lib:: libxgobi.a
libxgobi.a:  ${OBJS}
	rm -f libxgobi.a
	ar cr libxgobi.a ${OBJ}
#ifdef RANLIB
	$(RANLIB) libxgobi.a
#endif


pure: ${OBJS}
	purify -cache-dir=/tmp  -always-use-cache-dir=yes \
	${CC} ${CFLAGS} ${LD} -o xgobi xgobi.o ${OBJ} ${LOCAL_LIBRARIES} \
	${SYS_LIBRARIES}

