#		@(#)makefile.xgrid	1.9  06/09/99
#
#	Makefile for xgrid directory
#	X Windows application xgridedit
#	Contributed by Hugh Fisher, 1992
#
#	PW: Note that this old code gives plenty of Warnings.
#	I have no time or energy to fix them; if you do,
#	pls send to me.

include ../makegmt.macros

# You may have to set some paths and switches that deal
# with access to X11 and related resources.  It is
# currently set for Sun Solaris 2.6
#-------------------------------------------------------
# 1. Set the X11 and OpenWin library paths:

X11	= /usr/X11
OPENWIN = /usr/openwin

# 2. Set X11 libraries to link with:

# --------- SETTINGS UNDER SUN SOLARIS 2.x -------------
# Only need -L/usr/openwin/lib on Suns.
# Bracketing -lXmu with -Bstatic and -Bdynamic avoids
# a bug in Suns X implementation
# [PW: This is an old fix from 1995 - still relevant?]
#
# Use these LDFLAGS for Suns:
#
LDFLAGS= -L$(OPENWIN)/lib -lolgx -lxview -lXaw -lXt -lX11 -Bstatic -lXmu -Bdynamic -lXext -lnsl -lm
#-------------------------------------------------------

# ------------ SETTINGS UNDER PC LINUX -----------------
# Use these LDFLAGS for Linux:
#
#LDFLAGS= -L$(X11)/lib -L$(OPENWIN)/lib -lxview -lolgx -lXaw -lXt -lX11 -lXmu -lXext -lm
#-------------------------------------------------------

# ------------ SETTINGS UNDER SGI IRIX -----------------
# Use these LDFLAGS for SGIs:
#
#LDFLAGS= -lXaw -lXt -lXmu -lXext -lX11 -lm -lsun
#-------------------------------------------------------

# ------------ SETTINGS UNDER IBM RS6000 -----------------
# Use these LDFLAGS for IBMs:
#
X11R5	= /usr/lpp/X11/lib/R5
#LDFLAGS= -L$(X11R5) -L$(X11)/lib -lXaw -lXt -lX11 -lXmu -lXext -lm
#-------------------------------------------------------

# For other platforms: Pls let us know what worked

#--------------------------------------------
# STOP HERE - THE REST IS FIXED
#--------------------------------------------

CDF	= -L$(NETCDF)/lib -lnetcdf

OBJS= 	xgrid_utility.o xgrid_Xutility.o xgrid_Canvas.o \
	xgrid_Panner.o xgrid_GMTgrid.o xgrid_controls.o \
	xgrid_messages.o

EDITOBJS= xgrid_view.o xgrid_textView.o xgrid_textInput.o

#	Location of GMT and CDF header files

CFLAGS=	$(CC_OPT) -I.. -I$(NETCDF)/include -I$(OPENWIN)/include \
	-I$(X11)/include

all:		xgridedit

install:	all
		cp xgridedit $(BINDIR)

clean:
		rm -f *.o xgridedit *%

xgridedit:	$(OBJS) $(EDITOBJS) xgridedit.o
		$(CC) $(CFLAGS) xgridedit.o -o xgridedit $(OBJS) \
			$(EDITOBJS) $(CDF) $(LDFLAGS)

xgridedit.o:	xGridEdit.c xgrid_utility.h xgrid_controls.h \
			xgrid_messages.h xgrid_view.h xgrid_textInput.h
		$(CC) $(CFLAGS) -c xGridEdit.c -o xgridedit.o

xgrid_utility.o:	xgrid_utility.h

xgrid_Xutility.o:	xgrid_utility.h xgrid_Xutility.h

xgrid_Canvas.o:		xgrid_Canvas.h xgrid_CanvasP.h

xgrid_Panner.o:		xgrid_Canvas.h xgrid_Panner.h xgrid_PannerP.h

xgrid_GMTgrid.o:	xgrid_utility.h xgrid_GMTgrid.h

xgrid_controls.o:	xgrid_utility.h xgrid_Xutility.h xgrid_controls.h

xgrid_messages.o:	xgrid_utility.h xgrid_Xutility.h xgrid_messages.h

#	xGridEdit

xgrid_textView.o:	xgrid_utility.h xgrid_Xutility.h xgrid_GMTgrid.h \
			xgrid_Canvas.h xgrid_Panner.h xgrid_textView.h

xgrid_textInput.o:	xgrid_utility.h xgrid_Xutility.h xgrid_GMTgrid.h \
			xgrid_textInput.h

xgrid_view.o:		xgrid_utility.h xgrid_Xutility.h xgrid_GMTgrid.h \
			xgrid_view.h
