#
# Makefile for testapps
#

#  Copyright (C) 2005 Bryan Clair
# 
#  This file is part of CLOP.
# 
#  CLOP is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
# 
#  CLOP is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
# 
#  You should have received a copy of the GNU General Public License
#  along with CLOP; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
# 

#
# Add main pools code directory to path for finding targets.
#
poolsdir = ..
VPATH = $(poolsdir)
CXXFLAGS = -I$(poolsdir)

.PHONY : all
all: tourney football

#
# Test apps for football pools
#
fb_apps = fb_fixedbet fb_varbet fb_2fixed fb_varfix fb_2varbets

fb_objects = FootballPack.o PoolMath.o StatTest.o

#
# Builds all fb apps
#
.PHONY : football
football: $(fb_apps)

#
# Each fb_executable % depends on %.C and the fb_object files
#
$(fb_apps): % : %.C $(fb_objects)
	$(CXX) $(CXXFLAGS) $^ -o $@ -lgsl -lgslcblas


#
# Test apps for tournament pools
#
ta_apps = ttest pickbyluck opponentview strategies tourneysim \
	vartest vartest2 covartest covartest2 covartest3 h2h_winround

ta_other_apps = smoothtest pick_neighbor neighbortest

ta_objects = TourneyBasics.o TourneyPack.o TourneyWinround.o TourneyH2H.o \
             TourneyApp.o PoolMath.o TourneyPicks.o StatTest.o

#
# Builds all TourneyApps
#
.PHONY : tourney
tourney: $(ta_apps) $(ta_other_apps)

#
# Each ta_executable % depends on %.C and the ta_object files
#
$(ta_apps): % : %.C $(ta_objects)
	$(CXX) $(CXXFLAGS) $^ -o $@ 

#
# Other executables
#
smoothtest: smoothtest.C $(ta_objects) Normal.o
	$(CXX) $(CXXFLAGS) $^ -o $@ -lgsl -lgslcblas -lm

pick_neighbor: TourneyPicks.o PoolMath.o

neighbortest: TourneyPicks.o

#
# Removes all executables and object files
#
.PHONY : clean
clean:
	rm -f Tourney*.o StatTest.o $(fb_apps) $(ta_apps) $(ta_other_apps)


