#     The MB-system:	Makefile.template  8/2/94
#	$Id: Makefile.template 1770 2009-10-19 17:16:39Z caress $
#
#     Copyright (c) 1993-2009 by
#     David W. Caress (caress@mbari.org)
#       Monterey Bay Aquarium Research Institute
#       Moss Landing, CA 95039
#     and Dale N. Chayes (dale@ldeo.columbia.edu)
#       Lamont-Doherty Earth Observatory
#       Palisades, NY  10964
#
#     See README file for copying and redistribution conditions.
#
# Makefile template for MB-system at the src/mbvelocitytool directory level
# Author:	D. W. Caress
# Date:		September 14, 1994
#
# $Log: Makefile.template,v $
# Revision 5.6  2009/03/13 07:05:58  caress
# Release 5.1.2beta02
#
# Revision 5.5  2006/03/06 21:40:13  caress
# Changed libproj and libgsf to libmbproj and libmbgsf.
#
# Revision 5.4  2003/07/27 20:49:49  caress
# Release 5.0.0
#
# Revision 5.3  2003/03/10 20:01:03  caress
# Added mr1pr library.
#
# Revision 5.2  2002/07/20 20:46:57  caress
# Release 5.0.beta20
#
# Revision 5.1  2001/06/30 17:41:43  caress
# Release 5.0.beta02
#
# Revision 5.0  2001/03/22  21:12:28  caress
# Trying to make release 5.0.beta0.
#
# Revision 4.9  2000/09/30  07:22:08  caress
# Snapshot for Dale.
#
# Revision 4.8  1999/12/11  04:43:26  caress
# Moved xgraphics.c to src/xgraphics
#
# Revision 4.7  1998/10/05  19:18:58  caress
# MB-System version 4.6beta
#
# Revision 4.6  1997/09/12  18:55:07  caress
# Moved mb_rt.c to src/mbrt directory.
#
# Revision 4.5  1997/04/21  17:09:54  caress
# MB-System 4.5 Beta Release.
#
# Revision 4.5  1997/04/16  21:35:31  caress
# Complete rewrite of mbvelocitytool without uid file.
#
# Revision 4.4  1996/04/22  13:22:47  caress
# Now have DTR and MIN/MAX defines in mb_define.h
#
# Revision 4.3  1994/11/18  18:58:19  caress
# First gradient raytracing version.
#
# Revision 4.2  1994/10/31  20:06:09  caress
# Change man pages from section 1 to l.
#
# Revision 4.1  1994/10/31  18:30:17  caress
# y
# Changed man pages from section 1 to section l.
#
# Revision 4.0  1994/10/21  12:43:44  caress
# Release V4.0
#
#

### sets locations of vital objects
BINDIR = ../../bin
LIBDIR = ../../lib
INCDIR = ../../include

# *** CHANGE THESE TO FIT YOUR LOCAL ENVIRONMENT ***
#
# Locations of Motif include files:
MOTIFINCDIR = /usr/include/Xm
MOTIFLIBS = -lXm -lXt -lX11
#
# Compilers 
CC = cc
#
# Compile and load flags:
CFLAGS = -g -DIRIX
LFLAGS =  -lmalloc -lm -lsun -g

### set gsflib - could be version supplied with MB-System or other installation
GSFLIB  = $(LIBDIR)/libmbgsf.a

### set projlib - could be version supplied with MB-System or other installation
PROJLIB  = $(LIBDIR)/libmbproj.a
#
# *** LEAVE EVERYTHING ELSE BELOW ALONE ***

### make all makes the executable, .uid file, and man page
all: $(BINDIR)/mbvelocitytool 

### link the executable
$(BINDIR)/mbvelocitytool: mbvelocity.o \
		mbvelocity_callbacks.o \
		mbvelocity_creation.o \
		mbvelocity_bxutils.o \
		mbvelocity_prog.o \
		$(LIBDIR)/libmbio.a \
		$(PROJLIB) \
		$(GSFLIB) \
		$(LIBDIR)/libmr1pr.a \
		$(LIBDIR)/libsapi.a \
		$(LIBDIR)/libmbaux.a \
		$(LIBDIR)/libmbxgr.a
	$(CC) $(CFLAGS) mbvelocity.o \
		mbvelocity_callbacks.o \
		mbvelocity_creation.o \
		mbvelocity_bxutils.o \
		mbvelocity_prog.o \
		$(LIBDIR)/libmbio.a \
		$(PROJLIB) \
		$(GSFLIB) \
		$(LIBDIR)/libmr1pr.a \
		$(LIBDIR)/libsapi.a \
		$(LIBDIR)/libmbaux.a \
		$(LIBDIR)/libmbxgr.a \
		$(MOTIFLIBS) $(LFLAGS) \
		-o $(BINDIR)/mbvelocitytool

### compile the source files
mbvelocity.o: mbvelocity.c mbvelocity.h mbvelocity_creation.h 
	$(CC) $(CFLAGS) -I$(INCDIR) -I$(MOTIFINCDIR) -c mbvelocity.c
mbvelocity_callbacks.o: mbvelocity_callbacks.c mbvelocity.h
	$(CC) $(CFLAGS) -I$(INCDIR) -I$(MOTIFINCDIR) -c mbvelocity_callbacks.c
mbvelocity_creation.o: mbvelocity_creation.c mbvelocity.h mbvelocity_creation.h
	$(CC) $(CFLAGS) -I$(INCDIR) -I$(MOTIFINCDIR) -c mbvelocity_creation.c
mbvelocity_bxutils.o: mbvelocity_bxutils.c
	$(CC) $(CFLAGS) -I$(INCDIR) -I$(MOTIFINCDIR) -c mbvelocity_bxutils.c
mbvelocity_prog.o: mbvelocity_prog.c mbvelocity.h $(INCDIR)/mb_format.h \
		$(INCDIR)/mb_io.h $(INCDIR)/mb_status.h $(INCDIR)/mb_define.h
	$(CC) $(CFLAGS) -I$(INCDIR) -c mbvelocity_prog.c

clean: 
	rm -f core *.o

