# Makefile template for MATH library tests
#--------------------------------------------------------------
#
# COMMON DEFINITIONS
#
include ../Common
#
# FILES TO BE TESTED
#
executables := $(patsubst %.cc,%,$(wildcard *.cc))
#
# TARGETS
#
all: $(executables)

.PHONY: all lib clean

$(executables): %: %.o
	@$(RM) $@
	$(CXX) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L../src -lmath

%.o: %.cc lib
	$(CXX) -c -Wall $(CPPFLAGS) $(CXXFLAGS) $<

lib:
	@$(MAKE) -s -C .. $@

clean:
	@echo "Cleaning tests directory..."
	@$(RM) *.o $(executables) core *~ *bak vomit.mat
	@( cd langtests ; $(RM) *.o a.out *~ )

%:
	@$(MAKE) -s -C .. $@
