##########################################################################
# Copyright 2004 MBARI                                             
##########################################################################
# Summary  : Makefile for Reson6046 Driver
# Filename : Makefile
# Author   : Rich Henthorn
# Project  : 
# Version  : Version 1.0
# Created  : 01/16/04
# Archived :
##########################################################################
# Modification History:
#
##########################################################################

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/usr/include           

LDFLAGS	    = -g -lmqueue

LIBPATH	    = /usr/lib:../lib

#LIBS        =   

OBJS	    =  EdgeTechHandler.o  EdgeTechSubsystem.o  EdgeTechMessage.o  fsdwClient.o	

TARGETS =   fsdw.lib \
			fsdwTest

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


all:		$(TARGETS)


fsdw.lib :	$(OBJS)	
	$(AR) fsdw.lib +- $(OBJS) 

fsdwTest :	$(OBJS)
	$(LD) $(LDFLAGS) -o fsdwTest $(OBJS) $(LIBS)
    

install:


##########################################################################
# 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- $@

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

%.o: %.c 
	    $(CC) $(CFLAGS) $(INCLUDES) $< -o $@	
	    @echo
%.o: %.cc
	    $(CCPP) $(CPPFLAGS) $(INCLUDES) $< -o $@
	    @echo

DEST	    = .

MAKEFILE    = Makefile

include       $(OBJS:.o=.d)

depend:	

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

update:
	cvs update $(CC_SRCS) $MAKEFILE

commit:
	cvs commit $(CC_SRCS) $MAKEFILE

##########################################################################

CXXFLAGS =	-g

#-Wall -fmessage-length=0

OBJS =		 EdgeTechHandler.o EdgeTechSubsystem.o EdgeTechMessage.o fsdwClient.o 


#EdgeTechHandler.o  EdgeTechSystemTime.o EdgeTechNetworkProtocol.o SubsystemConfig.o 
OS=QNX


#ifeq ($(OS),QNX)
#	CXXFLAGS += -D_QNX
#	ARCH = qnx
#else 
#	ARCH = win
#endif

#LIBS =
#TARGETDIR = ./bin/$(ARCH)/
#TARGET =	fsdwClient fsdw.lib

#$(TARGET): $(OBJS)
	#mkdir -p $(TARGETDIR)
	#$(CXX) -o $(TARGET) $(OBJS) $(LIBS)


#all: $(TARGET)
#	@echo " You are running $(OS) "
	
#clean:
#	rm -f $(OBJS) $(TARGETS)
#	rm -Rf $(TARGETDIR)
