#
#  Makefile
#  ARToolKit5
#
#  This file is part of ARToolKit.
#
#  ARToolKit is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  ARToolKit 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 Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public License
#  along with ARToolKit.  If not, see <http://www.gnu.org/licenses/>.
#
#  As a special exception, the copyright holders of this library give you
#  permission to link this library with independent modules to produce an
#  executable, regardless of the license terms of these independent modules, and to
#  copy and distribute the resulting executable under terms of your choice,
#  provided that you also meet, for each linked independent module, the terms and
#  conditions of the license of that module. An independent module is a module
#  which is neither derived from nor based on this library. If you modify this
#  library, you may extend this exception to your version of the library, but you
#  are not obligated to do so. If you do not wish to do so, delete this exception
#  statement from your version.
#
#  Copyright 2015 Daqri, LLC. All rights reserved.
#  Copyright 2006-2015 ARToolworks, Inc. All rights reserved.
#  Author(s): Hirokazu Kato, Philip Lamb
#

UNAME = $(shell uname)

AR_HOME = ../../..
AR_CPPFLAGS = -I$(AR_HOME)/include -I$(AR_HOME)/lib/SRC/KPM/FreakMatcher

CC=@CC@
CXX=@CXX@
CPPFLAGS = $(AR_CPPFLAGS)
CFLAGS = @CFLAG@
CXXFLAGS = @CFLAG@
AR=@AR@
ARFLAGS=@ARFLAGS@
RANLIB = @RANLIB@

TARGET = $(AR_HOME)/lib/libKPM.a

HEADERS = \
	$(AR_HOME)/include/KPM/kpm.h      \
	$(AR_HOME)/include/KPM/kpmType.h  \
	kpmFopen.h                        \
    kpmPrivate.h                      \
	FreakMatcher/detectors/DoG_scale_invariant_detector.h  \
	FreakMatcher/detectors/gaussian_scale_space_pyramid.h  \
	FreakMatcher/detectors/gradients.h  \
	FreakMatcher/detectors/harris-inline.h  \
	FreakMatcher/detectors/harris.h  \
	FreakMatcher/detectors/interpolate.h  \
	FreakMatcher/detectors/orientation_assignment.h  \
	FreakMatcher/detectors/pyramid-inline.h  \
	FreakMatcher/detectors/pyramid.h  \
	FreakMatcher/facade/visual_database_facade.h  \
	FreakMatcher/framework/date_time.h  \
	FreakMatcher/framework/error.h  \
	FreakMatcher/framework/exception.h  \
	FreakMatcher/framework/image.h  \
	FreakMatcher/framework/image_utils.h  \
	FreakMatcher/framework/logger.h  \
	FreakMatcher/framework/timers.h  \
	FreakMatcher/homography_estimation/homography_solver.h  \
	FreakMatcher/homography_estimation/robust_homography.h  \
	FreakMatcher/matchers/binary_hierarchical_clustering.h  \
	FreakMatcher/matchers/feature_matcher-inline.h  \
	FreakMatcher/matchers/feature_matcher.h  \
	FreakMatcher/matchers/feature_point.h  \
	FreakMatcher/matchers/feature_store.h  \
	FreakMatcher/matchers/freak.h  \
	FreakMatcher/matchers/freak84-inline.h  \
	FreakMatcher/matchers/hough_similarity_voting.h  \
	FreakMatcher/matchers/keyframe.h  \
	FreakMatcher/matchers/kmedoids.h  \
	FreakMatcher/matchers/matcher_types.h  \
	FreakMatcher/matchers/visual_database-inline.h  \
	FreakMatcher/matchers/visual_database.h  \
	FreakMatcher/matchers/visual_database_types.h  \
	FreakMatcher/math/cholesky.h  \
	FreakMatcher/math/cholesky_linear_solvers.h  \
	FreakMatcher/math/geometry.h  \
	FreakMatcher/math/hamming.h  \
	FreakMatcher/math/homography.h  \
	FreakMatcher/math/indexing.h  \
	FreakMatcher/math/linear_algebra.h  \
	FreakMatcher/math/linear_solvers.h  \
	FreakMatcher/math/math_utils.h  \
	FreakMatcher/math/matrix.h  \
	FreakMatcher/math/polynomial.h  \
	FreakMatcher/math/quaternion.h  \
	FreakMatcher/math/rand.h  \
	FreakMatcher/math/robustifiers.h  \
	FreakMatcher/utils/feature_drawing.h  \
	FreakMatcher/utils/partial_sort.h  \
	FreakMatcher/utils/point.h  \


OBJS = \
	kpmHandle.o      \
	kpmRefDataSet.o  \
	kpmMatching.o    \
	kpmResult.o      \
	kpmUtil.o        \
	kpmFopen.o       \
	FreakMatcher/detectors/DoG_scale_invariant_detector.o  \
	FreakMatcher/detectors/gaussian_scale_space_pyramid.o  \
	FreakMatcher/detectors/gradients.o  \
	FreakMatcher/detectors/harris.o  \
	FreakMatcher/detectors/orientation_assignment.o  \
	FreakMatcher/detectors/pyramid.o  \
	FreakMatcher/facade/visual_database_facade.o  \
	FreakMatcher/matchers/hough_similarity_voting.o  \
	FreakMatcher/matchers/freak.o  \
	FreakMatcher/framework/date_time.o  \
	FreakMatcher/framework/image.o  \
	FreakMatcher/framework/logger.o  \
	FreakMatcher/framework/timers.o  \


# Implicit rule, to compile C++ files with the .cpp suffix (rule already exists for .cc).
%.o : %.cpp
	$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@

default build all: $(TARGET)

$(OBJS): $(HEADERS)

$(TARGET): $(OBJS)
	$(AR) $(ARFLAGS) $@ $^
	$(RANLIB) $@ 

clean:
	-rm -f $(OBJS)
	-rm -f $(TARGET)

allclean:
	-rm -f $(OBJS)
	-rm -f $(TARGET)
	-rm -f Makefile

distclean:
	rm -f $(OBJS)
	rm -f Makefile