# LAP Makefile  -- for tyrrell's SimulatedEnvironment (Edmund Mouse)

# Put the program name (executable file) here
CC=g++ -g
# -O optimization -g debugging info
LIBS = -lm # -L/usr/lib -lm -lg++ 
#  LIBS = -lm -L/usr/lib/gcc-lib/i486-linux/2.5.8 -lgcc -lobjc
INCLUDE = -I/usr/local/tyrrell/as/no_graphics
CFLAGS = -g -Wall $(INCLUDE) -DQUIETLY -O3 

EMOBJS = brain-objs.o em-prims.o brain-read.o em.o

all : $(EMOBJS)

# Meta Rule for compiling .C extensions
# I have selected as C++ extension the .C one.
.cc.o :
	$(CC) $(CFLAGS) -c $*.cc

.C.o :
	$(CC) $(CFLAGS) -c $*.C



# stuff actually happening

brain-objs.o : braintrie.hh brain-objs.hh em.hh brain-objs.cc
	$(CC) $(CFLAGS) -c $*.cc

brain-read.o : brain-read.cc brain-objs.hh braintrie.hh em.hh
	$(CC) $(CFLAGS) -c $*.cc

em-prims.o : em-prims.cc em.hh braintrie.hh brain-objs.hh em-dirs.hh
	$(CC) $(CFLAGS) -c $*.cc

em.o : em.cc braintrie.hh brain-objs.hh brain-read.hh em.hh 
	$(CC) $(CFLAGS) -c $*.cc


# stuff unlikely to happen

test.o : test.cc braintrie.hh brain-objs.hh brain-read.hh monx.hh # monx-sense.hh monx-move.hh 
	$(CC) $(CFLAGS) -c $*.cc

test : $(MONXOBJS) test.o 
	$(CC) $(CFLAGS) -o $@ $@.o $(MONXOBJS)  $(LIBS)

