# Explicit setting of SHELL - beware since this gets inherited
# by commands invoked by Make
SHELL=/bin/sh

UILFLAGS=-I/usr/include/uil
MRMLIBS=-lMrm

## everything is in /usr/include or /usr/lib
#XINCLUDES=
#XLIBS=
#LDLIBS=
###

## sg irix
#XINCLUDES=-I/usr/include/X11
#XLIBS=
#LDLIBS=
#CCC=CC
###

## ibm aix
#XINCLUDES=
#XLIBS=
#LDLIBS=
#CCC=xlC -+
###

## dec osf1
#XINCLUDES=
#XLIBS=-L/usr/shlib
#LDLIBS=
#CCC=cxx
###

## concurrent sysv4
#XINCLUDES=-I/usr/include/X11
#XLIBS=
#LDLIBS=
#CCC=/opt/epc/bin/c++
###

## ncr sysv4
#XINCLUDES=
#XLIBS=
#LDLIBS=-lnsl -lsocket -lgen -lresolv
###

## nec sysv4
#XINCLUDES=
#XLIBS=
#LDLIBS=-lnsl -lsocket -lgen -lresolv
###

## novell sysv4
#XINCLUDES=-I/usr/X/include -I/usr/X/include/X11
#XLIBS=-L/usr/X/lib -L/usr/ccs/lib
#LDLIBS=-lXimp -lnsl -lsocket -lgen -lresolv
###

## HALstation solaris 2.x
#XINCLUDES=-I/usr/dt/include -I/usr/openwin/include -I/usr/openwin/include/X11
#XLIBS=-L/usr/dt/lib -R/usr/dt/lib -L/usr/openwin/lib -R/usr/openwin/lib
#CC=hcc
#CPPFLAGS=-KV7 -Xk
## For ANSI C code generation use:
##CPPFLAGS=-KV7 -Xa
#CCC=hcc -KV7
#UILFLAGS=-I/usr/include/uil -I/usr/dt/include/uil
###

# solaris 2.x
XINCLUDES=-I/usr/dt/include -I/usr/openwin/include -I/usr/openwin/include/X11
XLIBS=-L/usr/dt/lib -L/usr/openwin/lib -R/usr/dt/lib -R/usr/openwin/lib
LDLIBS=-lgen
CCC=CC
MRMLIBS=-L/usr/dt/lib -lMrm
UILFLAGS=-I/usr/include/uil -I/usr/dt/include/uil
VISUROOT:sh= visuroot
##

## sco sysv3.4
## -lmalloc may also be required on LDLIBS line
#XINCLUDES=
#XLIBS=
#LDLIBS=-lXext -lXmu -lsocket -lintl
#CCC=CC +.cxx +.cpp +.C
###

## hp-ux 9.x
## -Wp,-H900000 recommended if too many cpp defines.
## For K&R code generation use:
##CPPFLAGS=-Wp,-H900000
## For ANSI C code generation use:
#CPPFLAGS=-Wp,-H900000 -Aa -D_HPUX_SOURCE
#XINCLUDES=-I/usr/include/X11R5 -I/usr/include/Motif1.2
#XLIBS=-L/usr/lib/X11R5 -L/usr/lib/Motif1.2
#LDLIBS=
#CCC=CC
#UILFLAGS=-I/usr/include/uil -I/usr/include/Motif1.2/uil
###

## qnx 
#XINCLUDES=-I/usr/include/X11 -DQNX
#LDLIBS=-N 128k -L/usr/lib/X11  -lXt_s -lX11_s -lXqnx_s -lXext -lsocket
#XLIBS=
#CCC=CC
###

#LDLIBS = -lPW
# Program configuration
# ---------------------

XPMLIBDIR = ${VISUROOT}/user_widgets/obj
XPMDIR = ${VISUROOT}/contrib/xpm/lib
LDFLAGS = ${XLIBS} -L${XPMLIBDIR}
MOTIFLIBS = -lXpm -lXm -lXt -lX11

XPCLASS = $(VISUROOT)/src/motifxp
XPCLASSLIBS = $(XPCLASS)/lib/libmotifxp.a


CFLAGS=-I. ${XINCLUDES} -I${XPMDIR}
CCFLAGS=${CFLAGS} -I${XPCLASS}/h

UIL=uil

#MOTIFLIBS = -lXm -lXt -lX11 -lPW

#WorkShop Visual:XD_C_PROGRAMS=XDG_C_PROGRAM_LIST

#WorkShop Visual:XD_C_PROGRAM_OBJECTS=XDG_C_PROGRAM_OBJECT_LIST

#WorkShop Visual:XD_C_PROGRAM_SOURCES=XDG_C_PROGRAM_SOURCE_LIST

#WorkShop Visual:XD_C_OBJECTS=XDG_C_OBJECT_LIST

#WorkShop Visual:XD_C_SOURCES=XDG_C_SOURCE_LIST

#WorkShop Visual:XD_C_STUB_OBJECTS=XDG_C_STUB_OBJECT_LIST

#WorkShop Visual:XD_C_STUB_SOURCES=XDG_C_STUB_SOURCE_LIST

#WorkShop Visual:XD_CC_PROGRAMS=XDG_CC_PROGRAM_LIST

#WorkShop Visual:XD_CC_PROGRAM_OBJECTS=XDG_CC_PROGRAM_OBJECT_LIST

#WorkShop Visual:XD_CC_PROGRAM_SOURCES=XDG_CC_PROGRAM_SOURCE_LIST

#WorkShop Visual:XD_CC_OBJECTS=XDG_CC_OBJECT_LIST

#WorkShop Visual:XD_CC_SOURCES=XDG_CC_SOURCE_LIST

#WorkShop Visual:XD_CC_STUB_OBJECTS=XDG_CC_STUB_OBJECT_LIST

#WorkShop Visual:XD_CC_STUB_SOURCES=XDG_CC_STUB_SOURCE_LIST

#WorkShop Visual:XD_C_FOR_UIL_PROGRAMS=XDG_C_FOR_UIL_PROGRAM_LIST

#WorkShop Visual:XD_C_FOR_UIL_PROGRAM_OBJECTS=XDG_C_FOR_UIL_PROGRAM_OBJECT_LIST

#WorkShop Visual:XD_C_FOR_UIL_PROGRAM_SOURCES=XDG_C_FOR_UIL_PROGRAM_SOURCE_LIST

#WorkShop Visual:XD_C_FOR_UIL_OBJECTS=XDG_C_FOR_UIL_OBJECT_LIST

#WorkShop Visual:XD_C_FOR_UIL_SOURCES=XDG_C_FOR_UIL_SOURCE_LIST

#WorkShop Visual:XD_UIL_OBJECTS=XDG_UIL_OBJECT_LIST

XD_ALL_C_SOURCES=$(XD_C_PROGRAM_SOURCES) $(XD_C_SOURCES) $(XD_C_STUB_SOURCES) $(XD_C_FOR_UIL_PROGRAM_SOURCES) $(XD_C_FOR_UIL_SOURCES)

XD_ALL_CC_SOURCES=$(XD_CC_PROGRAM_SOURCES) $(XD_CC_SOURCES) $(XD_CC_STUB_SOURCES)

all: CHECKENV CHECKROOT $(XD_C_PROGRAMS) $(XD_CC_PROGRAMS) $(XD_C_FOR_UIL_PROGRAMS) $(XD_UIL_OBJECTS)

depend:
	makedepend -- $(CFLAGS) $(CPPFLAGS) -- $(XD_ALL_C_SOURCES)
	makedepend -a -- $(CCFLAGS) $(CPPFLAGS) -- $(XD_ALL_CC_SOURCES)

clean:
	rm -f $(XD_C_PROGRAMS) $(XD_C_PROGRAM_OBJECTS) $(XD_C_OBJECTS) \
	      $(XD_CC_PROGRAMS) $(XD_CC_PROGRAM_OBJECTS) $(XD_CC_OBJECTS) \
	      $(XD_C_STUB_OBJECTS) \
	      $(XD_CC_STUB_OBJECTS) \
	      $(XD_C_FOR_UIL_PROGRAMS) $(XD_C_FOR_UIL_PROGRAM_OBJECTS) $(XD_C_FOR_UIL_OBJECTS) \
	      $(XD_UIL_OBJECTS)

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

CHECKROOT:
	@test -d "$(XPCLASS)" || (echo \$$VISUROOT must point to a valid root directory; exit 1)
	@test -d "$(VISUROOT)/make_templates" || (echo \$$VISUROOT must point to a valid root directory; exit 1)

#WorkShop Visual:XDG_C_PROGRAM: XDG_C_PROGRAM_OBJECT $(XD_C_OBJECTS) $(XD_C_STUB_OBJECTS)
#WorkShop Visual:	$(CC) XDG_C_DEBUG_FLAGS $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o XDG_C_PROGRAM XDG_C_PROGRAM_OBJECT $(XD_C_OBJECTS) $(XD_C_STUB_OBJECTS) $(MOTIFLIBS) $(LDLIBS)

#WorkShop Visual:XDG_C_PROGRAM_OBJECT: XDG_C_PROGRAM_SOURCE
#WorkShop Visual:	$(CC) XDG_C_DEBUG_FLAGS $(CFLAGS) $(CPPFLAGS) -c XDG_C_PROGRAM_SOURCE

#WorkShop Visual:XDG_C_OBJECT: XDG_C_SOURCE
#WorkShop Visual:	$(CC) XDG_C_DEBUG_FLAGS $(CFLAGS) $(CPPFLAGS) -c XDG_C_SOURCE

#WorkShop Visual:XDG_C_STUB_OBJECT: XDG_C_STUB_SOURCE
#WorkShop Visual:	$(CC) XDG_C_DEBUG_FLAGS $(CFLAGS) $(CPPFLAGS) -c XDG_C_STUB_SOURCE

#WorkShop Visual:XDG_CC_PROGRAM: XDG_CC_PROGRAM_OBJECT $(XD_CC_OBJECTS) $(XD_CC_STUB_OBJECTS)
#WorkShop Visual:	$(CCC) XDG_CPP_DEBUG_FLAGS $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) -o XDG_CC_PROGRAM XDG_CC_PROGRAM_OBJECT $(XD_CC_OBJECTS) $(XD_CC_STUB_OBJECTS) $(XPCLASSLIBS) $(MOTIFLIBS) $(LDLIBS)

#WorkShop Visual:XDG_CC_PROGRAM_OBJECT: XDG_CC_PROGRAM_SOURCE
#WorkShop Visual:	$(CCC) XDG_CPP_DEBUG_FLAGS $(CCFLAGS) $(CPPFLAGS) -c XDG_CC_PROGRAM_SOURCE

#WorkShop Visual:XDG_CC_OBJECT: XDG_CC_SOURCE
#WorkShop Visual:	$(CCC) XDG_CPP_DEBUG_FLAGS $(CCFLAGS) $(CPPFLAGS) -c XDG_CC_SOURCE

#WorkShop Visual:XDG_CC_STUB_OBJECT: XDG_CC_STUB_SOURCE
#WorkShop Visual:	$(CCC) XDG_CPP_DEBUG_FLAGS $(CCFLAGS) $(CPPFLAGS) -c XDG_CC_STUB_SOURCE

#WorkShop Visual:XDG_C_FOR_UIL_PROGRAM: XDG_C_FOR_UIL_PROGRAM_OBJECT $(XD_C_FOR_UIL_OBJECTS) $(XD_C_STUB_OBJECTS)
#WorkShop Visual:	$(CC) XDG_C_DEBUG_FLAGS $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o XDG_C_FOR_UIL_PROGRAM XDG_C_FOR_UIL_PROGRAM_OBJECT $(XD_C_FOR_UIL_OBJECTS) $(XD_C_STUB_OBJECTS) $(MRMLIBS) $(MOTIFLIBS) $(LDLIBS)

#WorkShop Visual:XDG_C_FOR_UIL_PROGRAM_OBJECT: XDG_C_FOR_UIL_PROGRAM_SOURCE
#WorkShop Visual:	$(CC) XDG_C_DEBUG_FLAGS $(CFLAGS) $(CPPFLAGS) -c XDG_C_FOR_UIL_PROGRAM_SOURCE

#WorkShop Visual:XDG_C_FOR_UIL_OBJECT: XDG_C_FOR_UIL_SOURCE
#WorkShop Visual:	$(CC) XDG_C_DEBUG_FLAGS $(CFLAGS) $(CPPFLAGS) -c XDG_C_FOR_UIL_SOURCE

#WorkShop Visual:XDG_UIL_OBJECT: XDG_UIL_SOURCE
#WorkShop Visual:	$(UIL) $(UILFLAGS) -o XDG_UIL_OBJECT XDG_UIL_SOURCE
