# sample makefile for building an EA evolving a new genotype

# START eventually modify the name of EO dir
DIR_EO = ../../src
# END eventually modify the name of EO dir

# eo libs
LIB_EO = $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a

# implicit compile rules
.SUFFIXES: .cpp
.cpp: ; $(CXX)  -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g  -o $@  $*.cpp $(LIB_EO)

.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -c $*.cpp

# local sources
COMMON_SOURCES =    eoMyStruct.h \
   eoMyStructEvalFunc.h \
   eoMyStructInit.h \
   eoMyStructMutation.h \
   eoMyStructQuadCrossover.h \
   make_genotype_MyStruct.h \
   make_op_MyStruct.h

NO_LIB_SOURCES = MyStructEA.cpp

LIB_SOURCES = MyStructLibEA.cpp make_MyStruct.cpp

SOURCES = $(COMMON_SOURCES) MyStructEA.cpp MyStructLibEA.cpp make_MyStruct.cpp

ALL = MyStructEA MyStructLibEA

MyStructEA : MyStructEA.cpp
	$(CXX) -I. -I$(DIR_EO) -g -o $@ MyStructEA.cpp $(LIB_EO) -lm 

MyStructLibEA : MyStructLibEA.o make_MyStruct.o
	$(CXX) -g -o $@ MyStructLibEA.o make_MyStruct.o $(LIB_EO) -lm

tar : ; tar czvf MyStruct.tgz *.h *.cpp Makefile

all : $(ALL)

clean : ; /bin/rm  *.o $(ALL)

########## local dependencies
MyStructEA.cpp : $(COMMON_SOURCES) 
MyStructLibEA.o : $(COMMON_SOURCES) MyStructLibEA.cpp
make_MyStruct.o : make_MyStruct.cpp eoMyStruct.h 
