## A makefile for the code testing utility

CC = g++
CFLAGS =
LDFLAGS =

PROG = test.out
SRCS = test.cpp population_test.cpp population.cpp population_block_test.cpp fresh_list_block_test.cpp individual_test.cpp individual.cpp table_fitness.cpp generic_fitness.cpp genetic_operators_test.cpp genetic_operators.cpp transitions.cpp
OBJS = $(SRCS:.cpp=.o)

## build the program from the object files
$(PROG): $(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)

## rules for the source files
test.o: population_test.h population_block_test.h fresh_list_block_test.h individual_test.h genetic_operators_test.h

population_test.o: population_test.h population.h population_block.h individual.h generic_individual.h

population.o: population.h population_block.h fresh_list_block.h individual.h generic_individual.h

population_block_test.o: population_block_test.h population_block.h individual.h generic_individual.h

fresh_list_block_test.o: fresh_list_block_test.h fresh_list_block.h

individual_test.o: individual_test.h individual.h table_fitness.h generic_individual.h

individual.o: individual.h generic_fitness.h generic_individual.h

table_fitness.o: table_fitness.h individual.h generic_fitness.h generic_individual.h transitions.h

generic_fitness.o: generic_fitness.h generic_individual.h

genetic_operators_test.o: genetic_operators_test.h population_block.h individual.h generic_individual.h genetic_operators.h

genetic_operators.o: genetic_operators.h population_block.h individual.h generic_individual.h

transitions.o: transitions.h generic_individual.h

## remove all the compilation and debugging files
clean:
	rm -f core $(PROG) $(OBJS)

# end of the makefile

