##########################################################################
# Copyright 1999 MBARI                                             
##########################################################################
# Summary  : Makefile for Parvus fan card driver
# Filename : Makefile
# Author   : rsm
# Project  : 
# Version  : Version 1.0
# Created  : 2004/3/12
# Modified : 
# Archived :
##########################################################################
# Modification History:
# $Header$
#
##########################################################################

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

DEBUG 	    = -g
EXCEPTION_HANDLING = -WC,-xs

## OPTIMIZE = -4 -Os
OPTIMIZE = 

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

AUV_BIN_DIR = ../bin

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

INCLUDES    = -I.  \
	      -I.. \
	      -I../utils \
	      -I../framework \
	      -I../taskIF \
	      -I../DataLog \
	      -I/usr/include           
#
# T1 is privity leve1 one, required by the inp and outp functions.
#
LDFLAGS1    = -g -T1                
LDFLAGS	    = 
LIBPATH	    = /usr/lib:../lib

LIBS        =   ../utils/utils.lib \
		../taskIF/taskInterfaces.lib \
		../DataLog/dataLog.lib \
		../framework/auvFramework.lib


OBJS	    =	envUtils.o Fan.o FanLog.o FanOutput.o FanServer.o

TARGETS =	fanTestSimple fan fanServer fanTest

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

all:		$(OBJS) $(TARGETS)

fanTestSimple:  _fanTestSimple.o $(OBJS) $(LIBS) 
	$(LD) $(LDFLAGS1) _fanTestSimple.o $(OBJS) $(LIBS) -o $@

fanTest:  _fanTest.o $(OBJS) $(LIBS) 
	$(LD) $(LDFLAGS1) _fanTest.o $(OBJS) $(LIBS) -o $@

fan:  	_fan.o $(OBJS) $(LIBS) 
	$(LD) $(LDFLAGS1) _fan.o $(OBJS) $(LIBS) -o $@

fanServer:	_fanServer.o $(OBJS) $(LIBS) 
	$(LD) $(LDFLAGS) _fanServer.o $(OBJS) $(LIBS) -o $@

install:
		cp -f $(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 $@	
	    @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

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









