
# 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=../..
#: system Solaris 32bit Workshop4 Compatible C++
#: default c
# No User Defined Widgets configured
ILOG_ROOT=$(ILVHOME)
ILOG_INCLUDE_PATH=-I$(ILOG_ROOT)/include -I$(VISUROOT)/user_widgets/IlogViews/include
ILOG_LIBRARY_PATH=-L$(ILOG_ROOT)/lib/sparc_5_4.0 -L$(VISUROOT)/user_widgets/IlogViews/src
ILOG_CFLAGS=
ILOG_LIBRARIES=$(ILOG_LIBRARY_PATH) -lilvgadgt -lilvwidget -lviews -lmviews
ILOG_EXTRA_LIBRARIES=
CFLAGS=-O -D_NO_PROTO
LINKER=CC -compat=5 -library=Cstd,Crun -staticlib=Cstd,Crun -norunpath
TMPOBJ=,tmp
MOTIFHOME=/usr/dt
MOTIFINCLUDES=-I${MOTIFHOME}/include
MOTIF_LIB_DIR=${MOTIFHOME}/lib${SYSDIR} -R${MOTIFHOME}/lib${SYSDIR}
MOTIFLIB=${MOTIFHOME}/lib/libXm.so.3
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
XINCLUDES=${MOTIFINCLUDES} -I/usr/openwin/include -I/usr/openwin/include/X11
CCC=CC
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   = Ilv.xdc
XD_CONFIG_CODE   = Ilv_code.c
XD_CONFIG_CONFIG = Ilv_config.c
XD_CONFIG_STUBS  = Ilv_stubs.c
XD_CONFIG_OBJS   = Ilv_config.o Ilv_code.o Ilv_stubs.o
XD_ILOG_WIDGET   = src/libilvwidget.a

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

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

all-generic: CHECK_ILOG_ENVIRONMENT visu.bin

visu.bin: $(XDOBJ) $(XD_ILOG_WIDGET) $(XD_CONFIG_OBJS)
	$(CCC) -o $(TMPOBJ) $(CFLAGS) $(XDOBJ) ${XD_CONFIG_OBJS} ${ILOG_LIBRARIES} ${MOTIFLIB} ${UWXSYSLIBS} $(ILOG_EXTRA_LIBRARIES) -lm -lc -ldl
	mv $(TMPOBJ) $@

CHECK_ILOG_ENVIRONMENT:
	@test -n "$(ILVHOME)" || (echo You must set \$$ILVHOME in the Makefile or your shell environment; exit 1)

$(XD_ILOG_WIDGET):
	(cd src ; make)

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

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

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

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


