##########################################################################
# Copyright 1999 MBARI                                             
##########################################################################
# Summary  : Makefile for utils subdirectory
# Filename : Makefile
# Author   : Andrew Pearce
# 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 = /usr/altex/bin/makedepend

DEBUG 	    = -g -DYYDEBUG=0
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)

ONBOARD     = /home/oreilly/ocean/auv/altex/onboard

INCLUDES    = 	-I.  \
		-I$(ONBOARD)/utils/ \
	      	-I/usr/include           


LDFLAGS	    = -g
LIBPATH	    = 

LIBS        = 

OBJS 	    =	idlToC++.o \
		idl.o \
		idl.tab.o \
		idl.yy.o \
		IdlParser.o \
		IdlToCpp.o

TARGETS = idlToC++

all:		$(TARGETS)


idl.tab.cc:	idl.y
	yacc -b idl -d -v idl.y
	mv idl.tab.c idl.tab.cc


idl.yy.cc:	idl.l 
	lex idl.l
	mv lex.yy.c idl.yy.cc



idlToC++:	$(OBJS)
	$(LD) $(LDFLAGS) $(OBJS) -o $@


##########################################################################
# 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 $(OBJS) $(OBJS:.o=.d) *.lib *.yy *.tab.* $(TARGETS)

update:
	cvs update $(CC_SRCS) $MAKEFILE

commit:
	cvs commit $(CC_SRCS) $MAKEFILE

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









