#     The MB-system:	Makefile.template  8/2/94
#	$Id: Makefile.template 1862 2010-06-07 00:26:46Z 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/mbedit directory level
# Author:	D. W. Caress
# Date:		August 2, 1994
#
# $Log: Makefile.template,v $
# Revision 5.2  2009/03/13 07:05:58  caress
# Release 5.1.2beta02
#
# Revision 5.1  2006/03/06 21:36:26  caress
# Changed libproj and libgsf to libmbproj and libmbgsf.
#
# Revision 5.0  2003/07/27 20:52:58  caress
# Release 5.0.0
#
# Revision 4.12  2003/03/10 19:57:07  caress
# Added mr1pr library.
#
# Revision 4.11  2002/07/20 20:45:04  caress
# Release 5.0.beta20
#
# Revision 4.10  2001/06/30 17:39:31  caress
# Release 5.0.beta02
#
# Revision 4.9  2001/03/22  21:06:55  caress
# Trying to make release 5.0.beta0
#
# Revision 4.8  2000/09/30  07:20:51  caress
# Snapshot for Dale.
#
# Revision 4.7  1999/12/11  04:39:14  caress
# Moved xgraphics.c to src/xgraphics
#
# Revision 4.6  1998/10/05  17:45:32  caress
# MB-System version 4.6beta
#
# Revision 4.5  1997/09/23  13:55:25  caress
# Fixed typo.
#
# Revision 4.4  1997/04/21  16:56:14  caress
# MB-System 4.5 Beta Release.
#
# Revision 4.4  1997/04/16  21:29:30  caress
# Complete rewrite without uid file.
#
# Revision 4.3  1996/04/22  13:20:55  caress
# Now have DTR and MIN/MAX defines in mb_define.h
#
# Revision 4.2  1994/10/31  19:56:57  caress
# Change man pages from section 1 to l.
#
# Revision 4.1  1994/10/31  18:24:28  caress
# Changed man pages from section 1 to section l.
#
# Revision 4.0  1994/10/21  11:55:41  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 = -O2 -DSUN
LFLAGS = -lm

### 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 and man page
all: $(BINDIR)/mbedit

### link the executable
$(BINDIR)/mbedit: mbedit.o mbedit_prog.o \
		$(LIBDIR)/libmbio.a \
		$(LIBDIR)/libmbaux.a \
		$(PROJLIB) \
		$(GSFLIB) \
		$(LIBDIR)/libsapi.a \
		$(LIBDIR)/libmr1pr.a  \
		$(LIBDIR)/libmbps.a \
		$(LIBDIR)/libmbxgr.a \
		mbedit_callbacks.o \
		mbedit_creation.o mbedit_bxutils.o
	$(CC) $(CFLAGS) mbedit.o mbedit_prog.o \
		$(LIBDIR)/libmbio.a \
		$(LIBDIR)/libmbaux.a \
		$(PROJLIB) \
		$(GSFLIB) \
		$(LIBDIR)/libsapi.a \
		$(LIBDIR)/libmr1pr.a  \
		$(LIBDIR)/libmbps.a \
		$(LIBDIR)/libmbxgr.a \
		mbedit_callbacks.o \
		mbedit_creation.o mbedit_bxutils.o \
		$(MOTIFLIBS) $(LFLAGS) -o $(BINDIR)/mbedit

### compile the source files
mbedit.o: mbedit.c mbedit.h
	$(CC) $(CFLAGS) -I$(INCDIR) -I$(MOTIFINCDIR) -c mbedit.c
mbedit_creation.o: mbedit_creation.c
	$(CC) $(CFLAGS) -I$(INCDIR) -I$(MOTIFINCDIR) -c mbedit_creation.c
mbedit_bxutils.o: mbedit_bxutils.c
	$(CC) $(CFLAGS) -I$(INCDIR) -I$(MOTIFINCDIR) -c mbedit_bxutils.c
mbedit_prog.o: mbedit_prog.c mbedit.h  $(INCDIR)/mb_format.h \
		$(INCDIR)/mb_io.h $(INCDIR)/mb_status.h $(INCDIR)/mb_define.h
	$(CC) $(CFLAGS) -I$(INCDIR) -I$(MOTIFINCDIR) -c mbedit_prog.c
mbedit_callbacks.o: mbedit_callbacks.c mbedit.h  $(INCDIR)/mb_format.h \
		$(INCDIR)/mb_io.h $(INCDIR)/mb_status.h $(INCDIR)/mb_define.h
	$(CC) $(CFLAGS) -I$(INCDIR) -I$(MOTIFINCDIR) -I$(MOTIFINCDIR) -c mbedit_callbacks.c

clean: 
	rm -f core *.o

