# Debugging with GCC.
CFLAGS = -O0 -ggdb3 -pg -Wall -DPARANOID

# Debugging with random C++ compilers.
#CFLAGS = -g -p -Wall -DPARANOID

# Optimiztion with random C++ compilers.
#CFLAGS = -O3 -p

TARGET=e3

HEADERS=\
 app.h \
 band.h \
 config.h \
 lispm.h \
 macroop.h \
 memmap.h \
 memobj.h \
 types.h \
 word.h

SOURCES=\
 app.cc \
 band.cc \
 e3.cc \
 lispm.cc \
 macroop.cc \
 mainops.cc \
 memmap.cc \
 memobj.cc \
 types.cc \
 word.cc

OBJECTS := $(SOURCES:.cc=.o)

.SUFFIXES : .o .cc

all : $(TARGET)

test : $(TARGET)
	./$(TARGET)
	gprof ./$(TARGET) | tee gprof.log

$(TARGET) : $(OBJECTS)
	$(CXX) $(CFLAGS) -o $(TARGET) $(OBJECTS)

depend : 
	makedepend -f depend.mk -Y $(SOURCES)

tags :
	etags $(HEADERS) $(SOURCES) 

checkin :
	for FILE in Makefile $(HEADERS) $(SOURCES) ; do echo "Makefile checkin" | ci -l $$FILE ; done

diff :
	for FILE in Makefile $(HEADERS) $(SOURCES) ; do rcsdiff $$FILE ; done

clean :
	rm -f $(TARGET) $(OBJECTS)

.cc.o :
	$(CXX) $(CFLAGS) -c $*.cc

cycle : clean all

include depend.mk
