CC = g++
FLAGS = -Wall -std=c++11 -g
LIB = -larmadillo
TARGET = CxxTest.out
TARGET_PATH = ../../bin_test/
OBJ = TestOnHermite.o

all: Test00 Test01 Test02 Test03

repo_test:
	mkdir $(TARGET_PATH)

$(TARGET):

Test00: ../poly.o ../hermite_matrix.o ../laguerre_matrix.o
	cxxtestgen --error-printer -o Test00.cpp Test00.hpp
	$(CC) $(FLAGS) -c Test00.cpp -o Test00.o $(LIB)
	$(CC) $(FLAGS) Test00.o ../poly.o ../laguerre_matrix.o ../hermite_matrix.o -o $@ $(LIB)

Test01: ../basis.o ../poly.o ../hermite_matrix.o ../laguerre_matrix.o
	cxxtestgen --error-printer -o Test01.cpp Test01.hpp
	$(CC) $(FLAGS) -c Test01.cpp -o Test01.o $(LIB)
	$(CC) $(FLAGS) Test01.o ../basis.o ../poly.o ../laguerre_matrix.o ../hermite_matrix.o -o $@ $(LIB)

Test02: ../basis.o ../poly.o ../hermite_matrix.o ../laguerre_matrix.o
	cxxtestgen --error-printer -o Test02.cpp Test02.hpp
	$(CC) $(FLAGS) -c Test02.cpp -o Test02.o $(LIB)
	$(CC) $(FLAGS) Test02.o ../basis.o ../poly.o ../laguerre_matrix.o ../hermite_matrix.o -o $@ $(LIB)

Test03: ../basis.o ../poly.o ../hermite_matrix.o ../laguerre_matrix.o
	cxxtestgen --error-printer -o Test03.cpp Test03.hpp
	$(CC) $(FLAGS) -c Test03.cpp -o Test03.o $(LIB)
	$(CC) $(FLAGS) Test03.o ../basis.o ../poly.o ../laguerre_matrix.o ../hermite_matrix.o -o $@ $(LIB)

.PHONY: clean_PHONY

clean_PHONY:
	rm -f *.o
	rm -f *.cpp

clean:
	rm -f $(all)
	rm -f $(OBJ)
	rm -f *.cpp
	rm -rf $(TARGET_PATH)
	rm -f test.out
	rm -f *.o
	rm -f Test0?
