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

CFLAGS=-O -D_NO_PROTO

## hp-ux 9.x
#SYSFLAGS=-I/usr/include/X11R5 -I/usr/include/Motif1.2
#SYS_LIBS=-lXm -L/usr/lib/X11R5 $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11
#XDFLAGS=-Wl,+b/usr/lib/X11R5:/usr/lib,+s
###

## everything standard
#SYSFLAGS=-I/usr/include/X11
#SYS_LIBS=-lXm -L/usr/lib $(XEW_LIBRARY) -Bdynamic -lXext -lXmu -lXt -lX11
###
 
## localX11
#SYSFLAGS=-I$(VISUROOT)/lib -I$(VISUROOT)/lib/X11 -DUSE_X11R6=1
#SYS_LIBS=-L/usr/lib -lXm $(XEW_LIBRARY) -L$(VISUROOT)/lib/X11 -lXt -lICE -lSM -lX11
###

## sco sysv3.4
#SYSFLAGS=-I/usr/include/X11
#SYS_LIBS=-lXm $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11 -lsocket -lintl -lmalloc -lm
#XDFLAGS=
###

## ibm aix
#SYSFLAGS=-I/usr/include/X11
#SYS_LIBS=-lXm $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11
#XDFLAGS=
###

## dec osf1
#SYSFLAGS=-I/usr/include/X11
#SYS_LIBS=-lXm $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11
#XDFLAGS=-taso
###

## ncr sysv4
#SYSFLAGS=-I/usr/include/X11
#SYS_LIBS=-lXm $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11 -lnsl -lsocket -lgen -lresolv
#XDFLAGS=
###

## nec sysv4
#SYSFLAGS=-I/usr/include/X11
#SYS_LIBS=-lXm $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11 -lnsl -lsocket -lgen -lresolv
#XDFLAGS=
###

## concurrent sysv4
#SYSFLAGS=-I/usr/include/X11
#SYS_LIBS=-lXm $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11 -lnsl -lsocket -lgen -lresolv
#XDFLAGS=
###

## sg irix
#SYSFLAGS=-I/usr/include/X11
#SYS_LIBS=-lXm $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11
#XDFLAGS=
###

## 64-bit sg irix
#SYSFLAGS=-I/usr/include/X11
#SYS_LIBS=-lXm $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11
#XDFLAGS=
#CFLAGS=$(CFLAGS) -32
###

## novell sysv4
#SYSFLAGS=-I/usr/X/include -I/usr/include/X11
#SYS_LIBS=-lXm -L/usr/X/lib $(XEW_LIBRARY) -lXext -lXmu -lXt -lXimp -lX11 -lnsl -lsocket -lgen -lresolv
#XDFLAGS=
###

## qnx 
#SYSFLAGS=-I/usr/include/X11 -DQNX
#SYS_LIBS=-N 128k -L/usr/lib/X11 $(XEW_LIBRARY) -lXmu -lXt_s -lX11_s -lXqnx_s -lXext -lsocket
#XDFLAGS=
###

# solaris 2.x
.SCCS_GET:

SYSFLAGS=-I/usr/include/X11 -I/usr/dt/include -I/usr/openwin/include -I/usr/openwin/include/X11
SYS_LIBS=-L/usr/openwin/lib -L/usr/dt/lib  -lXm $(XEW_LIBRARY) -lXext -lXmu -lXt -lX11 -lce -ltt -lnsl -lsocket -ldl -lgen
XDFLAGS=-R/usr/openwin/lib -R/usr/dt/lib
##

XDOBJ       = $(VISUROOT)/user_widgets/obj/visu.o $(VISUROOT)/user_widgets/obj/libXpm.a
XEW_OBJECTS = Xew_code.o Xew_config.o
IFLAGS      = -Ibitmaps -I$(VISUROOT)/user_widgets/hdrs

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

visu.bin:	$(XDOBJ) $(XEW_OBJECTS)
		CC -o $@ $(CFLAGS) $(XDOBJ) $(XEW_OBJECTS) $(XDFLAGS) $(SYS_LIBS) -lm -lc

Xew_code.c: Xew.xdc
	@echo "Xew code bridge file not found or out-of-date. (Re-)Generate using visu_config."

Xew_config.c: Xew.xdc
	@echo "Xew config bridge file not found or out-of-date. (Re-)Generate using visu_config."

clean:
	-rm -f $(XEW_OBJECTS) visu.bin
