# $Id: makefile,v 1.7 2001/08/05 22:30:55 peter Exp $

#------- User area --------
# Defines
	DEFS = 

# Target name	
	TRG  = main

# C Sources
	SRC  = ccamera.cc cvector.cc cmatrix.cc cray.cc ctransf.cc cintrsct.cc clink.cc cnode.cc cobject.cc csphere.cc cplane.cc cbox.cc cmesh.cc $(TRG).cc
#---------------------------

###### define some variables based on the AVR base path in $(AVR) #######
	CC		= c++
	AS		= $(CC) -x assembler-with-cpp	
	RM		= rm -f
	RN		= mv
	BIN		= objcopy
	INCLUDES	= -I.
	LIBDIR	= 
	SHELL   = /bin/sh
###### output format can be srec, ihex (avrobj is always created) #######
	FORMAT = 
####################### default compiler flags ##########################
	CPFLAGS	= -Wall -Wstrict-prototypes -Wno-uninitialized -march=k6 -O9
	LDFLAGS = -lm

#  	GCC-AVR standard Makefile part 2

#define all project specific object files
	OBJ	= $(SRC:.cc=.o)
	CPFLAGS += $(DEFS)
		  
#this defines the aims of the make process
all:	$(TRG)

include $(SRC:.cc=.d)	

# $(TRG) : $(filter-out $(TRG).o,$(OBJ))
$(TRG) : $(OBJ)
	$(CC) $(OBJ) $(LIB) $(LDFLAGS) -o $@

#compile: instructions to create assembler and/or object files from C source
%o : %cc 
	$(CC) -c $(CPFLAGS) $(INCLUDES) $< -o $@

# update prerequisites automatically
%.d: %.cc
	set -e; $(CC) -MM $(CPFLAGS) $< \
	| sed -e 's/$(*F).o[ :]*/$(*F).o $(subst /,\/,$@): makefile /' > $@; \
	[ -s $@ ] || rm -f $@

#make instruction to delete created files
clean:
	$(RM) $(OBJ)
	$(RM) $(SRC:.cc=.s)
	$(RM) *.bak
	$(RM) *.log

cvsclean: clean
	$(RM) $(TRG)
	$(RM) *.d tags
# $Log: makefile,v $
# Revision 1.7  2001/08/05 22:30:55  peter
# All targets now depend on the makefile
#
# Revision 1.6  2001/07/31 18:42:03  peter
# Finally added some comments. Finalized CVector (I think...)
#
# Revision 1.5  2001/07/29 06:19:01  peter
# Added an object counter. object ID and print method to each class. Fixed
# various annoying little bugs.
#
# Revision 1.4  2001/07/27 13:20:39  peter
# Fixed some CVS-introduced ambiguities.
#
# Revision 1.3  2001/07/23 07:11:51  peter
# Major changes:
#   * Extracted each class into its own header and source
#
# Minor changes:
#
# Revision 1.2  2001/07/22 21:04:20  peter
# Added 'cvsclean' target
#
# Revision 1.1  2001/07/22 20:44:12  peter
# Initial version in CVS
#
