#************************************************************************
#  This is part of the evolver toolkit for exploring genetic progamming.
#  Copyright (C) 1996 Benjamin Bennett and Yeasah G. Pell
#
#  This library is free software; you can redistribute it and/or modify
#  it under the terms of the GNU Library General Public License as
#  published by the Free Software Foundation; either version 2 of the
#  License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Library General Public License for more details.
#
#  You should have received a copy of the GNU Library General Public
#  License along with this library; if not, write to the Free Software
#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#  Contact information: Benjamin Bennett<fiji@limey.net> and Yeasah
#    G. Pell<yeasah@wpi.edu>
#************************************************************************

# Makefile for the genetic algorithm program

.SUFFIXES : .cpp
.cpp.o :
	$(CXX) $(CXXFLAGS) -c $<


#CXXFLAGS = -g -Wall -DNET_MODEL -DDEBUG_MEMORY -DDEBUG_GENERATION -DDEBUG_ALL
CXXFLAGS = -O2 -Wall -DNET_MODEL

OBJS = generation.o operator.o program.o fitness.o \
 generation_breed.o generation_evaluate.o generation_rank.o network.o \
 netnode.o pipe.o intarray.o

SRCS = generic.H generation.cpp operator.cpp optable.cpp program.cpp \
 fitness.cpp generation_breed.cpp generation_evaluate.cpp \
 generation_rank.cpp test_generation.cpp test_generic.cpp \
 test_model.cpp genetic.cpp optable_net1.cpp network_model1.cpp \
 network.cpp netnode.cpp pipe.cpp test_net_model.cpp intarray.cpp

all: genetic

depend:	${SRCS}
	touch .depend
	makedepend -f.depend -I/usr/include/g++ -- $(CXXFLAGS) -- $(SRCS)

test_generic: test_generic.o
	${CXX} ${CXXFLAGS} ${CPPFLAGS} test_generic.o -o $@

test_queue: test_queue.o
	${CXX} ${CXXFLAGS} ${CPPFLAGS} test_queue.o -o $@

test_generation: ${OBJS} test_generation.o test_model.o
	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${OBJS} test_generation.o \
		test_model.o -o $@

test_net_model: network.o netnode.o pipe.o test_net_model.o
	${CXX} ${CXXFLAGS} ${CPPFLAGS} network.o netnode.o pipe.o \
		test_net_model.o -o $@

genetic: ${OBJS} genetic.o network_model1.o optable_net1.o
	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${OBJS} network_model1.o \
		optable_net1.o genetic.o -o $@

int_model: ${OBJS} genetic.o test_model.o optable.o
	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${OBJS} test_model.o \
		optable.o genetic.o -o $@

clean: 
	rm -f *.o .depend test_generic test_generation test_net_model \
		test_queue int_model genetic

ifneq (.depend,$(wildcard .depend))
else
include .depend 
endif

