CXX? = g++
CFLAGS = -Wall -Wconversion -O3 -fPIC
all: FkNN FkNNSVM FkNNSVM-nr FaLKNR FaLK-SVM-train FaLK-SVM-predict

FkNN: FkNN.cpp cover_tree.o knn.o svm.o par_est.o per_eval.o
	$(CXX) $(CFLAGS) FkNN.cpp cover_tree.o knn.o svm.o par_est.o per_eval.o -o FkNN -lm
FkNNSVM: FkNNSVM.cpp cover_tree.o knn.o svm.o  par_est.o per_eval.o
	$(CXX) $(CFLAGS) FkNNSVM.cpp cover_tree.o knn.o svm.o par_est.o per_eval.o -o FkNNSVM -lm
FkNNSVM-nr: FkNNSVM-nr.cpp cover_tree.o knn.o svm.o noise_reduction.o fast_lsvm.o par_est.o per_eval.o
	$(CXX) $(CFLAGS) FkNNSVM-nr.cpp cover_tree.o knn.o svm.o noise_reduction.o fast_lsvm.o par_est.o per_eval.o -o FkNNSVM-nr -lm
FaLKNR: FaLKNR.cpp cover_tree.o svm.o noise_reduction.o knn.o par_est.o fast_lsvm.o per_eval.o
	$(CXX) $(CFLAGS) FaLKNR.cpp cover_tree.o svm.o noise_reduction.o knn.o par_est.o fast_lsvm.o per_eval.o -o FaLKNR -lm
FaLK-SVM-train: FaLK-SVM-train.cpp cover_tree.o svm.o knn.o par_est.o fast_lsvm.o per_eval.o
	$(CXX) $(CFLAGS) FaLK-SVM-train.cpp cover_tree.o svm.o knn.o par_est.o fast_lsvm.o per_eval.o -o FaLK-SVM-train -lm
FaLK-SVM-predict: FaLK-SVM-train.cpp cover_tree.o svm.o knn.o par_est.o fast_lsvm.o per_eval.o
	$(CXX) $(CFLAGS) FaLK-SVM-predict.cpp cover_tree.o svm.o knn.o par_est.o fast_lsvm.o per_eval.o -o FaLK-SVM-predict -lm
	
svm.o: svm.cpp svm.h
	$(CXX) $(CFLAGS) $(CFLAGSLIBSVM) -c svm.cpp
cover_tree.o: cover_tree.cpp cover_tree.h
	$(CXX) $(CFLAGS) $(CFLAGSLIBSVM) -c cover_tree.cpp
noise_reduction.o: noise_reduction.cpp noise_reduction.h
	$(CXX) $(CFLAGS) -c noise_reduction.cpp
fast_lsvm.o: fast_lsvm.cpp fast_lsvm.h
	$(CXX) $(CFLAGS) -c fast_lsvm.cpp
knn.o: knn.cpp knn.h
	$(CXX) $(CFLAGS) -c knn.cpp
par_est.o: par_est.cpp par_est.h
	$(CXX) $(CFLAGS) -c par_est.cpp
per_eval.o: per_eval.cpp per_eval.h
	$(CXX) $(CFLAGS) -c per_eval.cpp
clean:
	rm -f *~ *.o FkNN FkNNSVM FkNNSVM-nr FaLKNR FaLK-SVM-train FaLK-SVM-predict