
CC			= gcc

CFLAGS			= -c -O2 #-Wall
OPTION			= -DSELECTION -DCROSSOVER -DMUTATION #-DCHECK_POP
#ADDOPTION		= -DCHECK_POP -DSTEPBYSTEP

PROGRAMOO		= tsp.exe

OBJSOO			= ga.o initialize_gene_order.o random2.o calc_fitness.o tsp.o roulette_elite_selection.o subtour_exchange_crossover.o mutation_order.o

LIBS			= -lm

$(PROGRAMOO)		: $(OBJSOO)
	$(CC) $(OBJSOO) -o $(PROGRAMOO) $(LIBS) 

ga.o	:	ga.c	parameter.h
	$(CC) $(CFLAGS) $(OPTION) $(ADDOPTION) ga.c

initialize_gene_order.o	:	initialize_gene_order.c	parameter.h
	$(CC) $(CFLAGS) initialize_gene_order.c

tsp.o	:	tsp.c	parameter.h
	$(CC) $(CFLAGS) tsp.c

calc_fitness.o	:	calc_fitness.c	parameter.h
	$(CC) $(CFLAGS) calc_fitness.c

random2.o	:	random2.c
	$(CC) $(CFLAGS) random2.c

roulette_elite_selection.o	:	roulette_elite_selection.c	parameter.h
	$(CC) $(CFLAGS) roulette_elite_selection.c

subtour_exchange_crossover.o	:	subtour_exchange_crossover.c	parameter.h
	$(CC) $(CFLAGS) subtour_exchange_crossover.c

mutation_order.o	:	mutation_order.c	parameter.h
	$(CC) $(CFLAGS) mutation_order.c

clean	:	
	rm -f *.o a.out a.out.core tsp.exe tsp.exe.core
