
# Explicit setting of SHELL - beware since this gets inherited
# by commands invoked by Make

SHELL=/bin/sh
TARGET=generic
ABIDIR=
SYSDIR=
ABICFLAGS=
ABICCFLAGS=
ABILDFLAGS=

# Default rule
all: all-${TARGET}

# The following may be overridden by an equivalent environment variable
# pointing to the root of the WorkShop Visual tree if this Makefile is used
# outside of the WorkShop Visual tree.
VISUROOT=../..
# We assume Histo-Plotter is installed in the usual X locations
# Modify the following if this is not the case
# Modify the following if Histo-Plotter no longer has old _XmDrawShadow/_XmHighlightBorder code
HPLOT_INTEGRATION_CFLAGS=-DOBSOLETE_MOTIF_CODE
#: system Solaris 32bit Workshop4 Compatible C++
#: default c
# No User Defined Widgets configured
HPLOT_ROOT=$(HPLOTHOME)
HPLOT_INCLUDE_PATH=-I$(HPLOT_ROOT)/plot_widgets
HPLOT_LIBRARY_PATH=-L$(HPLOT_ROOT)/plot_widgets
HPLOT_CFLAGS=
HPLOT_LIBRARIES=$(HPLOT_LIBRARY_PATH) -lPlotW
HPLOT_EXTRA_LIBRARIES=-L$(HPLOT_ROOT)/util -lNUtil -lm
MOTIFHOME=/usr/dt
MOTIFINCLUDES=-I${MOTIFHOME}/include
MOTIF_LIB_DIR=${MOTIFHOME}/lib${SYSDIR} -R${MOTIFHOME}/lib${SYSDIR}
MOTIFLIB=${MOTIFHOME}/lib/libXm.so.3
CFLAGS=-O -D_NO_PROTO
LINKER=CC -compat=5 -library=Cstd,Crun -staticlib=Cstd,Crun -norunpath
TMPOBJ=,tmp
CC=cc
XINCLUDES=${MOTIFINCLUDES} -I/usr/openwin/include -I/usr/openwin/include/X11
X11_LIB_DIR=/usr/openwin/lib${SYSDIR} -R/usr/openwin/lib${SYSDIR}
XSYSLIBS=-L${X11_LIB_DIR} -lXmu -lXt -lX11 -lXext -lnsl -lsocket -lgen
UWXSYSLIBS=${XSYSLIBS} -lce -ltt -ldl -liostream
XDFLAGS=-R/usr/openwin/lib -R/usr/dt/lib
ABI1CFLAGS=
ABI1CCFLAGS=-compat=4
ABI1LDFLAGS=
ABI1ABIDIR=/compat-pre5
ABI1SYSDIR=
ABICFLAGS=${ABI1CFLAGS}
ABICCFLAGS=${ABI1CCFLAGS}
ABILDFLAGS=${ABI1LDFLAGS}
SYSDIR=
ABIDIR=/compat-pre5
#: end


# The following should not require modifications
XD_CONFIG_SAVE   = Plot.xdc
XD_CONFIG_CODE   = Plot_code.c
XD_CONFIG_CONFIG = Plot_config.c
XD_CONFIG_STUBS  = Plot_stubs.c
XD_CONFIG_PATCH  = Plot_patch.c
XD_CONFIG_OBJS   = Plot_code.o Plot_config.o Plot_stubs.o Plot_patch.o

IFLAGS = -Ibuiltin_bitmaps -Ibitmaps -I${VISUROOT}/user_widgets/hdrs -I. $(HPLOT_INCLUDE_PATH)
XDOBJ  = ${VISUROOT}/user_widgets/obj/visu.o ${VISUROOT}/user_widgets/obj/libXpm.a

.c.o:
	rm -f $@
	${CC} -c $(CFLAGS) $(HPLOT_INTEGRATION_CFLAGS) $(HPLOT_CFLAGS) $(IFLAGS) ${XINCLUDES} $*.c

all-generic: visu.bin

visu.bin:	CHECK_HPLOT_ENVIRONMENT $(XDOBJ) $(XD_CONFIG_OBJS)
	${LINKER} -o $(TMPOBJ) $(CFLAGS) $(XDOBJ) $(XD_CONFIG_OBJS) ${XDFLAGS} ${MOTIFLIB} ${HPLOT_LIBRARIES} ${UWXSYSLIBS} $(HPLOT_EXTRA_LIBRARIES) -lm -lc
	mv $(TMPOBJ) $@

CHECK_HPLOT_ENVIRONMENT:
	@test -n "$(HPLOTHOME)" || (echo You might need to set \$$HPLOTHOME in the Makefile or your shell environment)

$(XD_CONFIG_CONFIG): $(XD_CONFIG_SAVE)
	@echo "The Histo-plot Config file was not found or is out-of-date. (Re-)Generate using visu_config."

$(XD_CONFIG_CODE) : $(XD_CONFIG_SAVE)
	@echo "The Histo-plot Code file was not found or is out-of-date. (Re-)Generate using visu_config."

$(XD_CONFIG_STUBS): $(XD_CONFIG_SAVE)
	@echo "The Histo-plot Stubs file was not found or is out-of-date. (Re-)Generate using visu_config."

clean:
	-rm -f visu.bin $(XD_CONFIG_OBJS) $(TMPOBJ)


