# $Id: makefile.am 3769 2015-12-29 16:13:16Z bradbell $
# -----------------------------------------------------------------------------
# CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
#
# CppAD is distributed under multiple licenses. This distribution is under
# the terms of the
#                     GNU General Public License Version 3.
#
# A copy of this license is included in the COPYING file of this distribution.
# Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
# -----------------------------------------------------------------------------
# automake input file
#
# CppAD pusts all it's preprocessor definitions in the cppad/configure.hpp
DEFS          =
#
# -------------------------------------------------------------------------
if CppAD_OPENMP
OPENMP_SRC_FILES   = alloc_openmp.cpp
else
OPENMP_SRC_FILES   =
endif
# -------------------------------------------------------------------------
if CppAD_ADOLC
ADOLC_SRC_FILES   = base_adolc.cpp
ADOLC_EXTRA_FILES =
ADOLC_LIB         = -ladolc -lColPack -L$(ADOLC_DIR)/lib -L$(ADOLC_DIR)/lib64
ADOLC_FLAGS       = -DCPPAD_ADOLC_TEST -I$(ADOLC_DIR)/include
else
ADOLC_EXTRA_FILES = base_adolc.cpp
ADOLC_SRC_FILES   =
ADOLC_LIB         =
ADOLC_FLAGS       =
endif
# -------------------------------------------------------------------------
if CppAD_IPOPT
IPOPT_SRC_FILES   = ipopt_solve.cpp
IPOPT_EXTRA_FILES =
IPOPT_LIB         = -lipopt \
	$(CPPAD_IPOPT_LIBS) $(FCLIBS) $(PTHREAD_LIB) $(DL_LIB)
IPOPT_FLAGS       = -DCPPAD_IPOPT_TEST -I$(IPOPT_DIR)/include
else
IPOPT_EXTRA_FILES = ipopt_solve.cpp
IPOPT_SRC_FILES   =
IPOPT_LIB         =
IPOPT_FLAGS       =
endif
# -------------------------------------------------------------------------
if CppAD_EIGEN_DIR
# make a special library so can have it's own compile flags (see configure.ac)
EIGEN_EXTRA_FILES   =
noinst_LIBRARIES    = libeigen.a
libeigen_a_SOURCES  =  cppad_eigen.cpp
EIGEN_LIB           = -L. -leigen
libeigen_a_CXXFLAGS = \
	-g \
	$(CXX_FLAGS_EIGEN) \
	-DCPPAD_EIGEN_TEST \
	 -I$(EIGEN_DIR)/include
else
EIGEN_EXTRA_FILES   = cppad_eigen.cpp
EIGEN_LIB           =
endif
# -------------------------------------------------------------------------
# Microsoft project files and script to run a single test
EXTRA_DIST        =  \
	test_one.sh.in  \
	$(ADOLC_EXTRA_FILES) \
	$(IPOPT_EXTRA_FILES) \
	$(EIGEN_EXTRA_FILES)
#
check_PROGRAMS    = test_more
#
AM_CPPFLAGS       = -I. \
	-I$(top_srcdir) \
	$(BOOST_INCLUDE) \
	$(EIGEN_INCLUDE) \
	$(ADOLC_FLAGS) \
	$(IPOPT_FLAGS) \
	$(OPENMP_FLAGS)
#
AM_CXXFLAGS       = -g $(ADOLC_FLAGS) $(IPOPT_FLAGS) $(CXX_FLAGS)
#
AM_LDFLAGS        = $(OPENMP_FLAGS)
LDADD             = $(ADOLC_LIB) $(IPOPT_LIB) $(EIGEN_LIB) $(OPENMP_FLAGS)
#
test_more_SOURCES  = \
	$(ADOLC_SRC_FILES) \
	$(IPOPT_SRC_FILES) \
	$(OPENMP_SRC_FILES) \
	test_more.cpp \
	abs.cpp \
	acos.cpp \
	acosh.cpp \
	adfun_copy.cpp \
	asin.cpp \
	asinh.cpp \
	assign.cpp \
	add.cpp \
	add_eq.cpp \
	add_zero.cpp \
	atan.cpp \
	atanh.cpp \
	atan2.cpp \
	azmul.cpp \
	base_alloc.cpp \
	check_simple_vector.cpp \
	checkpoint.cpp \
	compare.cpp \
	compare_change.cpp \
	cond_exp.cpp \
	cond_exp_ad.cpp \
	cond_exp_rev.cpp \
	copy.cpp \
	cos.cpp \
	cosh.cpp \
	dbl_epsilon.cpp \
	div.cpp \
	div_eq.cpp \
	div_zero_one.cpp \
	erf.cpp \
	exp.cpp \
	expm1.cpp \
	extern_value.cpp \
	extern_value.hpp \
	for_hess.cpp \
	for_sparse_jac.cpp \
	forward.cpp \
	forward_dir.cpp \
	forward_order.cpp \
	from_base.cpp \
	fun_check.cpp \
	jacobian.cpp \
	num_limits.cpp \
	log.cpp \
	log1p.cpp \
	log10.cpp \
	mul.cpp \
	mul_cskip.cpp \
	mul_eq.cpp \
	mul_level.cpp \
	mul_cond_rev.cpp \
	mul_zdouble.cpp \
	mul_zero_one.cpp \
	near_equal_ext.cpp \
	neg.cpp \
	ode_err_control.cpp \
	old_usead_2.cpp \
	old_usead_1.cpp \
	old_tan.cpp \
	old_reciprocal.cpp \
	old_mat_mul.cpp \
	old_mat_mul.hpp \
	omp_alloc.cpp \
	optimize.cpp \
	parameter.cpp \
	poly.cpp \
	pow.cpp \
	pow_int.cpp \
	print_for.cpp \
	romberg_one.cpp \
	rosen_34.cpp \
	runge_45.cpp \
	reverse.cpp \
	rev_sparse_hes.cpp \
	rev_sparse_jac.cpp \
	rev_two.cpp \
	simple_vector.cpp \
	sin.cpp \
	sin_cos.cpp \
	sinh.cpp \
	sparse_hessian.cpp \
	sparse_jacobian.cpp \
	sparse_vec_ad.cpp \
	sqrt.cpp \
	std_math.cpp \
	sub.cpp \
	sub_eq.cpp \
	sub_zero.cpp \
	tan.cpp \
	test_vector.cpp \
	to_string.cpp \
	track_new_del.cpp \
	value.cpp \
	vec_ad.cpp \
	vec_ad_par.cpp \
	vec_unary.cpp \
	zdouble.cpp

test: check
	./test_more
