
# 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 Xukc is installed in the usual X locations
# Modify the following if this is not the case
# If you have the BlueStone 150 distribution, set BLUE_HOME appropriately
# Otherwise set XUKC_HOME to point to the root of your Xukc distribution
# Athena support is required for Xukc
BLUE_ROOT=$(BLUE_HOME)
XUKC_HOME=$(BLUE_ROOT)/prod/pub/fromNet/Dirt/Dirt/lib
#: system Solaris 32bit Workshop4 Compatible C++
#: default c
# No User Defined Widgets configured
ATHENA_ROOT=$(ATHENAHOME)
ATHENA_INCLUDE_PATH=-I$(ATHENA_ROOT)/include
ATHENA_LIBRARY_PATH=-L$(ATHENA_ROOT)/lib
ATHENA_CFLAGS=
ATHENA_LIBRARIES=$(ATHENA_LIBRARY_PATH) -lXaw
ATHENA_EXTRA_LIBRARIES=-lXmu -lXext
XUKC_ROOT=0
XUKC_INCLUDE_PATH=0
XUKC_LIBRARY_PATH=0
XUKC_CFLAGS=0
XUKC_LIBRARIES=0
XUKC_EXTRA_LIBRARIES=0
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
COMBINED_INCLUDE_PATH    = $(XUKC_INCLUDE_PATH) $(ATHENA_INCLUDE_PATH)
COMBINED_LIBRARY_PATH    = $(XUKC_LIBRARY_PATH) $(ATHENA_LIBRARY_PATH)
COMBINED_CFLAGS          = $(XUKC_CFLAGS) $(ATHENA_CFLAGS)
COMBINED_LIBRARIES       = $(XUKC_LIBRARIES) $(ATHENA_LIBRARIES)
COMBINED_EXTRA_LIBRARIES = $(XUKC_EXTRA_LIBRARIES) $(ATHENA_EXTRA_LIBRARIES)

XD_CONFIG_SAVE          = Xukc.xdc
XD_CONFIG_CODE          = Xukc_code.c
XD_CONFIG_CONFIG        = Xukc_config.c
XD_CONFIG_STUBS         = Xukc_stubs.c
XD_CONFIG_OBJS          = Xukc_code.o Xukc_config.o Xukc_stubs.o

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

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

all-generic: CHECK_XUKC_ENVIRONMENT visu.bin

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

CHECK_XUKC_ENVIRONMENT:
	@test -n "$(XUKC_DIR)" || (echo You may need to set \$$XUKC_DIR in the makefile or in your shell environment)

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

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

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

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


