
# 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=../..
# The default configuration is for the X11R5 version of the Athena widgets
# For X11R6, comment/uncomment XAW_CFLAGS and XD_CONFIG_SAVE lines further below
# We assume Athena is installed in the usual X locations
# Modify the following if this is not the case
#: 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
MOTIFHOME=/usr/dt
CFLAGS=-O -D_NO_PROTO
LINKER=CC -compat=5 -library=Cstd,Crun -staticlib=Cstd,Crun -norunpath
TMPOBJ=,tmp
CC=cc
MOTIFINCLUDES=-I${MOTIFHOME}/include
MOTIF_LIB_DIR=${MOTIFHOME}/lib${SYSDIR} -R${MOTIFHOME}/lib${SYSDIR}
MOTIFLIB=${MOTIFHOME}/lib/libXm.so.3
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 X11R5 Athena widget set
XAW_CFLAGS       =
XD_CONFIG_SAVE   = Athena.xdc
# The X11R6 Athena widget set
#XAW_CFLAGS       = -DX11R6_XAW
#XD_CONFIG_SAVE   = Athena.X11R6.xdc

# The following should not require modifications
XD_CONFIG_CODE   = Athena_code.c
XD_CONFIG_CONFIG = Athena_config.c
XD_CONFIG_STUBS  = Athena_stubs.c
XD_CONFIG_OBJS   = Athena_code.o Athena_config.o Athena_stubs.o

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

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

all-generic: visu.bin

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

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

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

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

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


