# 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=../..

# Set INTDIR (to /usr/XintR2.2 ?) here or in your shell environment

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

## everything standard
#CFLAGS          = -D_NO_PROTO
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#XLIBS           = -L/usr/lib -lXext -lXm -lXt -lX11
###

## localX11
#CFLAGS          = -D_NO_PROTO -DUSE_X11R6=1
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = $(VISUROOT)/lib -I$(VISUROOT)/lib/X11
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = $(VISUROOT)/lib/X11
#XLIBS           = -lXm -lXt -lICE -lSM -lX11
###

## sco sysv3.4
#CFLAGS          = -D_NO_PROTO
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#XLIBS           = -L/usr/lib -lXext -lXm -lXt -lX11 -lsocket
###

## ibm aix
#CFLAGS          = -D_NO_PROTO
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#XLIBS           = -lXext -lXm -lXt -lX11
###

## dec osf1
#CFLAGS          = -taso -D_NO_PROTO
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/shlib
#X11_LIB_DIR     = /usr/shlib
#XLIBS           = -lXext -lXm -lXt -lX11
###

## novell sysv4
#CFLAGS          = -D_NO_PROTO
#MOTIF_INC_DIR   = /usr/X/include
#X11_INC_DIR     = /usr/X/include
#MOTIF_LIB_DIR   = /usr/X/lib
#X11_LIB_DIR     = /usr/X/lib
#XLIBS           = -lXext -lXm -lXt -lX11
###

## ncr sysv4
#CFLAGS          = -D_NO_PROTO
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#XLIBS           = -lXext -lXm -lXt -lX11
###

## concurrent sysv4
#CFLAGS          = -D_NO_PROTO
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#XLIBS           = -lXext -lXm -lXt -lX11
###

## qnx
#CFLAGS          = -DQNX -I/usr/include/X11
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib/X11
#X11_LIB_DIR     = /usr/lib/X11
#XLIBS	         = -N 128k -lXt_s -lX11_s -lXqnx_s -lXext -lsocket
###

## sg irix
#CFLAGS          = -D_NO_PROTO
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#XLIBS           = -lXext -lXm -lXt -lX11
###

## 64-bit sg irix
#CFLAGS          = -D_NO_PROTO -32
#MOTIF_INC_DIR   = /usr/include
#X11_INC_DIR     = /usr/include
#MOTIF_LIB_DIR   = /usr/lib
#X11_LIB_DIR     = /usr/lib
#XLIBS           = -lXext -lXm -lXt -lX11
###

## hp-ux 9.x
#CFLAGS          = -D_NO_PROTO -Wp,-H900000
#MOTIF_INC_DIR   = /usr/include/Motif1.2
#X11_INC_DIR     = /usr/include/X11R5
#MOTIF_LIB_DIR   = /usr/lib/Motif1.2
#X11_LIB_DIR     = /usr/lib/X11R5
#XLIBS           = -lXext -lXm -lXt -lX11
###

# solaris 2.x
CFLAGS          = -D_NO_PROTO
MOTIF_INC_DIR   = /usr/dt/include
X11_INC_DIR     = /usr/openwin/include
MOTIF_LIB_DIR   = /usr/dt/lib
X11_LIB_DIR     = /usr/openwin/lib
XLIBS           = -R/usr/openwin/lib -R/usr/dt/lib -lXext  -lXm -lXt -lX11 -lce -ltt -lnsl -lsocket -ldl -lgen
##

CPPFLAGS        = -I$(MOTIF_INC_DIR) -I$(X11_INC_DIR) -I${VISUROOT}/user_widgets/hdrs -I.
LDFLAGS         = -L$(INTDIR)/lib -L$(MOTIF_LIB_DIR) -L$(X11_LIB_DIR)
STDLIBS         = -lm

INTLIBS       = -lINT -lINTCGM -lINTC
XDOBJ           = ${VISUROOT}/user_widgets/obj/visu.o ${VISUROOT}/user_widgets/obj/libXpm.a

LIBS            = ${XLIBS} ${STDLIBS}

LCLIFLAGS=-Ibitmaps -I${VISUROOT}/user_widgets/hdrs
IFLAGS=-I$(INTDIR) $(LCLIFLAGS) -I${X11_INC_DIR} -I${MOTIF_INC_DIR} -I.

.c.o:
	rm -f $@
	@cc -c $(CFLAGS) $(IFLAGS) $*.c

visu.bin: CHECKENV $(XDOBJ) XintCode.o XintConfig.o xint_defines.o xint_xd_cvtr.o
	@echo Building WorkShop Visual with INT widgets integrated
	CC -o $@ $(CFLAGS) $(XDOBJ) XintCode.o XintConfig.o xint_defines.o xint_xd_cvtr.o ${LDFLAGS} $(INTLIBS) $(LIBS)

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