## A makefile for the core application

CC = g++
CFLAGS =
LDFLAGS =

PROG = main.out
SRCS = main.cpp population.cpp individual.cpp table_fitness.cpp simulation_fitness.cpp generic_fitness.cpp transitions.cpp evolution.cpp result_table.cpp genetic_operators.cpp random_solution.cpp
OBJS = $(SRCS:.cpp=.o)

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

## rules for the source files
main.o: evolution.h individual.h table_fitness.h simulation_fitness.h generic_fitness.h random_solution.h

population.o: population.h population_block.h fresh_list_block.h individual.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

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

generic_fitness.o: generic_fitness.h generic_individual.h

transitions.o: transitions.h generic_individual.h

evolution.o: evolution.h population.h population_block.h individual.h result_table.h genetic_operators.h

result_table.o: result_table.h

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

random_solution.o: random_solution.h

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

# end of the makefile

