#
# Defines
#


COMPILE = g++ -ggdb -O0 -Werror -Wall -Wno-deprecated -c

LINK = g++ -ggdb -Werror -Wall -Wno-deprecated -o $@


playoff_OBJ = \
    playoff.o \
    a_evaluate.o \
    aggression.o \
    alpha_beta.o \
    heuristic.o \
    makemove.o \
    p_evaluate.o \
    p_plain.o \
    pboard.o \
    t_evaluate.o \
    t_plain.o \
    three_row.o \
    unmakemove.o \
    win.o \
    win_table.o


polylearn_OBJ = \
    polylearn.o \
    a_evaluate.o \
    aggression.o \
    alpha_beta.o \
    heuristic.o \
    makemove.o \
    p_evaluate.o \
    p_plain.o \
    pboard.o \
    t_plain.o \
    t_evaluate.o \
    three_row.o \
    tournament_A.o \
    unmakemove.o \
    win.o \
    win_table.o

    
score4_OBJ = \
    score4.o \
    a_evaluate.o \
    aggression.o \
    alpha_beta.o \
    h_init.o \
    heuristic.o \
    learn.o \
    makemove.o \
    p_evaluate.o \
    p_plain.o \
    pboard.o \
    t_evaluate.o \
    t_plain.o \
    three_row.o \
    unmakemove.o \
    win.o \
    win_table.o

    
table_size_OBJ = \
    table_size.o \
    a_evaluate.o \
    aggression.o \
    h_init.o \
    heuristic.o \
    p_evaluate.o \
    p_plain.o \
    pboard.o \
    t_evaluate.o \
    t_plain.o \
    three_row.o \
    win_table.o


time_heuristic_OBJ = \
    time_heuristic.o \
    a_evaluate.o \
    aggression.o \
    h_init.o \
    heuristic.o \
    p_evaluate.o \
    p_plain.o \
    pboard.o \
    t_evaluate.o \
    t_plain.o \
    three_row.o \
    win_table.o


time_move_OBJ = \
    time_move.o \
    a_evaluate.o \
    aggression.o \
    h_init.o \
    heuristic.o \
    makemove.o \
    p_evaluate.o \
    p_plain.o \
    pboard.o \
    t_evaluate.o \
    t_plain.o \
    three_row.o \
    unmakemove.o \
    win.o \
    win_table.o


#
# all
#


all:  playoff \
      polylearn \
      score4 \
      table_size \
      time_heuristic \
      time_move


playoff:  $(playoff_OBJ)
	$(LINK) $(playoff_OBJ)

polylearn:  $(polylearn_OBJ)
	$(LINK) $(polylearn_OBJ)

score4:  $(score4_OBJ)
	$(LINK) $(score4_OBJ)

table_size:  $(table_size_OBJ)
	$(LINK) $(table_size_OBJ)

time_heuristic:  $(time_heuristic_OBJ)
	$(LINK) $(time_heuristic_OBJ)

time_move:  $(time_move_OBJ)
	$(LINK) $(time_move_OBJ)


a_evaluate.o:  a_evaluate.c 
	$(COMPILE) a_evaluate.c

aggression.o:  aggression.c 
	$(COMPILE) aggression.c

alpha_beta.o:  alpha_beta.c 
	$(COMPILE) alpha_beta.c

h_init.o:  h_init.c 
	$(COMPILE) h_init.c

heuristic.o:  heuristic.c 
	$(COMPILE) heuristic.c

learn.o:  learn.c 
	$(COMPILE) learn.c

makemove.o:  makemove.c 
	$(COMPILE) makemove.c

p_evaluate.o:  p_evaluate.c 
	$(COMPILE) p_evaluate.c

p_plain.o:  p_plain.c 
	$(COMPILE) p_plain.c

pboard.o:  pboard.c 
	$(COMPILE) pboard.c

playoff.o:  playoff.c 
	$(COMPILE) playoff.c

polylearn.o:  polylearn.c 
	$(COMPILE) polylearn.c

score4.o:  score4.c 
	$(COMPILE) score4.c

t_evaluate.o:  t_evaluate.c 
	$(COMPILE) t_evaluate.c

t_plain.o:  t_plain.c 
	$(COMPILE) t_plain.c

table_size.o:  table_size.c 
	$(COMPILE) table_size.c

three_row.o:  three_row.c 
	$(COMPILE) three_row.c

time_heuristic.o:  time_heuristic.c 
	$(COMPILE) time_heuristic.c

time_move.o:  time_move.c 
	$(COMPILE) time_move.c

tournament_A.o:  tournament_A.c 
	$(COMPILE) tournament_A.c

tournament_B.o:  tournament_B.c 
	$(COMPILE) tournament_B.c

unmakemove.o:  unmakemove.c 
	$(COMPILE) unmakemove.c

win.o:  win.c 
	$(COMPILE) win.c

win_table.o:  win_table.c 
	$(COMPILE) win_table.c


#
# clean
#

clean:	
	rm -f core.*
	rm -f *.o
	rm -rf doxygen_out
	rm -f playoff
	rm -f polylearn
	rm -f score4
	rm -f table_size
	rm -f time_heuristic
	rm -f time_move



#
# doxygen
#

doxygen:
	rm -fr doxygen_out/*
	$(DOXYGEN)/doxygen > /dev/null

