##########################################################################
# Copyright 1999 MBARI                                             
##########################################################################
# Summary  : Makefile for Kearfott
# Filename : Makefile
# Author   : Hans Thomas
# Project  : 
# Version  : Version 1.0
# Created  : 12/06/99
# Modified : 12/06/99
# Archived :
##########################################################################
# Modification History:
# $Header$
#
##########################################################################

CC	    = cc
CCPP	    = cc
LD	    = cc
AR 	    = wlib
DEPEND_TOOL = makedepend

AUV_BIN_DIR = ../bin

DEBUG 	    = -g
EXCEPTION_HANDLING = -WC,-xs

## OPTIMIZE = -4 -Os
OPTIMIZE = 

## MAP_OUTPUT = -S -ms -M
MAP_OUTPUT =

CFLAGS	    = -c $(DEBUG) $(MAP_OUTPUT) $(OPTIMIZE) -D_QNX -DUNIX  
CPPFLAGS    = -c $(DEBUG) $(MAP_OUTPUT) $(OPTIMIZE) -D_QNX -DUNIX \
	         $(EXCEPTION_HANDLING)

INCLUDES    = 	-I.  \
	      	-I../utils \
	      	-I../framework  \
		-I../taskIF \
		-I../DataLog \
		-I../ahrs \
		-I../gps \
		-I../Reson7K \
	      	-I/usr/include \
		-I..

LDFLAGS	    = -g
LIBPATH	    = /usr/lib:../lib

LIBS        =   ../utils/utils.lib \
		../framework/auvFramework.lib \
		../DataLog/dataLog.lib \
		../taskIF/taskInterfaces.lib \
		../ahrs/AHRSOutput.o \
		../gps/GpsUtils.o \
		../gps/GpsOutput.o \
                ../Reson7K/Reson7K.lib \
		/usr/local/lib/gctpc/geolib.a
#		../gps/GpsLog.o \

OBJS	=	Kearfott.o KearfottServer.o KearfottOutput.o DvlOutput.o \
		DvlServer.o DvlLog.o KearfottLog.o \
		GpsServer.o KearfottGpsLog.o


TARGETS =	kearfottTest kearfott kearfottServer kearfottDvlServer \
		kearfottPlayback kearfottGpsServer

-include ../autonomy.make # this file contains the general
                       # modifications we want to apply to
                       # all the modules 


all:		$(TARGETS)

kearfottTest:	_kearfottTest.o $(OBJS) $(LIBS)
	$(LD) $(LDFLAGS) _kearfottTest.o $(OBJS) $(LIBS) -o $@

kearfottPlayback:  _kearfottPlayback.o $(OBJS) $(LIBS)
	$(LD) $(LDFLAGS) _kearfottPlayback.o $(OBJS) $(LIBS) -o $@

kearfottServer:	_kearfottServer.o $(OBJS) $(LIBS)
	$(LD) $(LDFLAGS) _kearfottServer.o $(OBJS) $(LIBS) -o $@

kearfottDvlServer:	_dvlServer.o $(OBJS) $(LIBS)
	$(LD) $(LDFLAGS) _dvlServer.o $(OBJS) $(LIBS) -o $@

kearfottGpsServer:	_gpsServer.o $(OBJS) $(LIBS)
	$(LD) $(LDFLAGS) _gpsServer.o $(OBJS) $(LIBS) -o $@

kearfott:	_kearfott.o $(OBJS) $(LIBS)
	$(LD) $(LDFLAGS) _kearfott.o $(OBJS) $(LIBS) -o $@

install:	$(TARGETS)
		cp -fnv $(TARGETS) $(AUV_BIN_DIR)/.

##########################################################################
# Do not modify anything below this line unless absolutely necessary

.SUFFIXES:
.SUFFIXES:	.o .c .cc .d .idl

%.d: %.c
	    @echo Generating dependencies for $?
	    @$(DEPEND_TOOL) $(INCLUDES) $? -f $@.tmp
	    @mv $@.tmp $@

%.d: %.cc
	    @echo Generating dependencies for $?
	    @$(DEPEND_TOOL) $(INCLUDES) $? -f $@.tmp
	    @mv $@.tmp $@

%.o: %.c 
	    $(CC) $(CFLAGS) $(INCLUDES) $< -o $@	

%.o: %.cc
	    $(CCPP) $(CPPFLAGS) $(INCLUDES) $< -o $@

DEST	    = .

MAKEFILE    = Makefile



depend:	

clean:
	rm -f core *.o $(OBJS:.o=.d) *.yy *.tab.* $(TARGETS)

update:
	cvs update $(CC_SRCS) $MAKEFILE

commit:
	cvs commit $(CC_SRCS) $MAKEFILE

include       $(OBJS:.o=.d)
##########################################################################









