Commit 80b5c233 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Build system for MEX files:

- remove the dirty vpath hack
- factorize between the two estimation DLLs
- factorize within SWZ makefile
parent e0c0f236
vpath %.cc $(top_srcdir)/../../sources/bytecode
vpath %.hh $(top_srcdir)/../../sources/bytecode
noinst_PROGRAMS = bytecode
# bytecode_CPPFLAGS interacts badly with VPATH
CPPFLAGS += -I$(top_srcdir)/../../sources/bytecode -I$(top_srcdir)/../../../preprocessor
bytecode_CPPFLAGS = -I$(top_srcdir)/../../sources/bytecode -I$(top_srcdir)/../../../preprocessor
TOPDIR = $(top_srcdir)/../../sources/bytecode
nodist_bytecode_SOURCES = \
bytecode.cc \
Interpreter.cc \
Mem_Mngr.cc \
SparseMatrix.cc \
Interpreter.hh \
Mem_Mngr.hh \
SparseMatrix.hh \
ErrorHandling.hh
$(TOPDIR)/bytecode.cc \
$(TOPDIR)/Interpreter.cc \
$(TOPDIR)/Mem_Mngr.cc \
$(TOPDIR)/SparseMatrix.cc \
$(TOPDIR)/Interpreter.hh \
$(TOPDIR)/Mem_Mngr.hh \
$(TOPDIR)/SparseMatrix.hh \
$(TOPDIR)/ErrorHandling.hh
vpath %.cpp $(top_srcdir)/../../../dynare++/extern/matlab
noinst_PROGRAMS = dynare_simul_
# Can't use gensylv_CPPFLAGS, because it interacts badly with VPATH
CPPFLAGS += -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../../dynare++/tl/cc -I$(top_srcdir)/../../../dynare++/kord -I$(top_srcdir)/../../sources
dynare_simul__CPPFLAGS = -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../../dynare++/tl/cc -I$(top_srcdir)/../../../dynare++/kord -I$(top_srcdir)/../../sources
CXXFLAGS += $(PTHREAD_CFLAGS)
dynare_simul__CXXFLAGS = $(PTHREAD_CFLAGS)
# libdynare++ must come before pthread
dynare_simul__LDADD = ../libdynare++/libdynare++.a $(PTHREAD_LIBS)
nodist_dynare_simul__SOURCES = dynare_simul.cpp
nodist_dynare_simul__SOURCES = $(top_srcdir)/../../../dynare++/extern/matlab/dynare_simul.cpp
noinst_PROGRAMS = logposterior logMHMCMCposterior
# We use shared flags so that automake does not compile things two times
CPPFLAGS += -I$(top_srcdir)/../../sources/estimation/libmat -I$(top_srcdir)/../../sources/estimation/utils $(BOOST_CPPFLAGS)
LDFLAGS += $(BOOST_LDFLAGS)
LDADD = $(LIBADD_DLOPEN)
TOPDIR = $(top_srcdir)/../../sources/estimation
MAT_SRCS = \
$(TOPDIR)/libmat/Matrix.hh \
$(TOPDIR)/libmat/Matrix.cc \
$(TOPDIR)/libmat/Vector.hh \
$(TOPDIR)/libmat/Vector.cc \
$(TOPDIR)/libmat/BlasBindings.hh \
$(TOPDIR)/libmat/DiscLyapFast.hh \
$(TOPDIR)/libmat/GeneralizedSchurDecomposition.cc \
$(TOPDIR)/libmat/GeneralizedSchurDecomposition.hh \
$(TOPDIR)/libmat/LapackBindings.hh \
$(TOPDIR)/libmat/LUSolver.cc \
$(TOPDIR)/libmat/LUSolver.hh \
$(TOPDIR)/libmat/QRDecomposition.cc \
$(TOPDIR)/libmat/QRDecomposition.hh \
$(TOPDIR)/libmat/VDVEigDecomposition.cc \
$(TOPDIR)/libmat/VDVEigDecomposition.hh
COMMON_SRCS = \
$(MAT_SRCS) \
$(TOPDIR)/DecisionRules.cc \
$(TOPDIR)/DecisionRules.hh \
$(TOPDIR)/DetrendData.cc \
$(TOPDIR)/DetrendData.hh \
$(TOPDIR)/EstimatedParameter.cc \
$(TOPDIR)/EstimatedParameter.hh \
$(TOPDIR)/EstimatedParametersDescription.cc \
$(TOPDIR)/EstimatedParametersDescription.hh \
$(TOPDIR)/EstimationSubsample.cc \
$(TOPDIR)/EstimationSubsample.hh \
$(TOPDIR)/InitializeKalmanFilter.cc \
$(TOPDIR)/InitializeKalmanFilter.hh \
$(TOPDIR)/KalmanFilter.cc \
$(TOPDIR)/KalmanFilter.hh \
$(TOPDIR)/LogLikelihoodSubSample.cc \
$(TOPDIR)/LogLikelihoodSubSample.hh \
$(TOPDIR)/LogLikelihoodMain.hh \
$(TOPDIR)/LogLikelihoodMain.cc \
$(TOPDIR)/LogPosteriorDensity.cc \
$(TOPDIR)/LogPosteriorDensity.hh \
$(TOPDIR)/LogPriorDensity.cc \
$(TOPDIR)/LogPriorDensity.hh \
$(TOPDIR)/ModelSolution.cc \
$(TOPDIR)/ModelSolution.hh \
$(TOPDIR)/Prior.cc \
$(TOPDIR)/Prior.hh \
$(TOPDIR)/utils/dynamic_dll.cc \
$(TOPDIR)/utils/dynamic_dll.hh
nodist_logposterior_SOURCES = \
$(COMMON_SRCS) \
$(TOPDIR)/logposterior.cc
nodist_logMHMCMCposterior_SOURCES = \
$(COMMON_SRCS) \
$(TOPDIR)/Proposal.cc \
$(TOPDIR)/Proposal.hh \
$(TOPDIR)/RandomWalkMetropolisHastings.cc \
$(TOPDIR)/RandomWalkMetropolisHastings.hh \
$(TOPDIR)/logMHMCMCposterior.cc
vpath %.cpp $(top_srcdir)/../../../dynare++/sylv/matlab
noinst_PROGRAMS = gensylv
# Can't use gensylv_CPPFLAGS, because it interacts badly with VPATH
CPPFLAGS += -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../sources
gensylv_CPPFLAGS = -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../sources
gensylv_LDADD = ../libdynare++/libdynare++.a
nodist_gensylv_SOURCES = gensylv.cpp
nodist_gensylv_SOURCES = $(top_srcdir)/../../../dynare++/sylv/matlab/gensylv.cpp
vpath %.cc $(top_srcdir)/../../sources/k_order_perturbation
noinst_PROGRAMS = k_order_perturbation
# Can't use k_order_perturbation_CPPFLAGS, because it interacts badly with VPATH
CPPFLAGS += -I$(top_srcdir)/../../../dynare++/src -I$(top_srcdir)/../../../dynare++/kord -I$(top_srcdir)/../../../dynare++/tl/cc -I$(top_srcdir)/../../../dynare++/utils/cc -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../../dynare++/integ/cc -I$(top_srcdir)/../../sources
k_order_perturbation_CPPFLAGS = -I$(top_srcdir)/../../../dynare++/src -I$(top_srcdir)/../../../dynare++/kord -I$(top_srcdir)/../../../dynare++/tl/cc -I$(top_srcdir)/../../../dynare++/utils/cc -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../../dynare++/integ/cc -I$(top_srcdir)/../../sources
CXXFLAGS += $(PTHREAD_CFLAGS)
k_order_perturbation_CXXFLAGS = $(PTHREAD_CFLAGS)
# libdynare++ must come before pthread
k_order_perturbation_LDADD = ../libdynare++/libdynare++.a $(PTHREAD_LIBS) $(LIBADD_DLOPEN)
TOPDIR = $(top_srcdir)/../../sources/k_order_perturbation
nodist_k_order_perturbation_SOURCES = \
k_order_perturbation.cc \
k_ord_dynare.cc \
k_ord_dynare.hh \
dynamic_dll.cc \
dynamic_dll.hh \
dynamic_abstract_class.cc \
dynamic_abstract_class.hh \
dynamic_m.cc \
dynamic_m.hh
$(TOPDIR)/k_order_perturbation.cc \
$(TOPDIR)/k_ord_dynare.cc \
$(TOPDIR)/k_ord_dynare.hh \
$(TOPDIR)/dynamic_dll.cc \
$(TOPDIR)/dynamic_dll.hh \
$(TOPDIR)/dynamic_abstract_class.cc \
$(TOPDIR)/dynamic_abstract_class.hh \
$(TOPDIR)/dynamic_m.cc \
$(TOPDIR)/dynamic_m.hh
vpath %.cc $(top_srcdir)/../../sources/kalman_steady_state
noinst_PROGRAMS = kalman_steady_state
kalman_steady_state_LDADD = ../libslicot/libslicot.a
kalman_steady_state_LDADD +=../libslicot/libauxslicot.a
nodist_kalman_steady_state_SOURCES = kalman_steady_state.cc
nodist_kalman_steady_state_SOURCES = $(top_srcdir)/../../sources/kalman_steady_state/kalman_steady_state.cc
vpath %.cc $(top_srcdir)/../../sources/kronecker
noinst_PROGRAMS = sparse_hessian_times_B_kronecker_C A_times_B_kronecker_C
nodist_sparse_hessian_times_B_kronecker_C_SOURCES = sparse_hessian_times_B_kronecker_C.cc
nodist_A_times_B_kronecker_C_SOURCES = A_times_B_kronecker_C.cc
nodist_sparse_hessian_times_B_kronecker_C_SOURCES = $(top_srcdir)/../../sources/kronecker/sparse_hessian_times_B_kronecker_C.cc
nodist_A_times_B_kronecker_C_SOURCES = $(top_srcdir)/../../sources/kronecker/A_times_B_kronecker_C.cc
vpath %.cpp $(top_srcdir)/../../../dynare++/sylv/cc $(top_srcdir)/../../../dynare++/tl/cc $(top_srcdir)/../../../dynare++/kord $(top_srcdir)/../../../dynare++/integ/cc $(top_srcdir)/../../../dynare++/src
noinst_LIBRARIES = libdynare++.a
# Can't use k_order_perturbation_CPPFLAGS, because it interacts badly with VPATH
CPPFLAGS += -I$(top_srcdir)/../../../dynare++/src -I$(top_srcdir)/../../../dynare++/kord -I$(top_srcdir)/../../../dynare++/tl/cc -I$(top_srcdir)/../../../dynare++/utils/cc -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../../dynare++/integ/cc -I$(top_srcdir)/../../sources
libdynare___a_CPPFLAGS = -I$(top_srcdir)/../../../dynare++/src -I$(top_srcdir)/../../../dynare++/kord -I$(top_srcdir)/../../../dynare++/tl/cc -I$(top_srcdir)/../../../dynare++/utils/cc -I$(top_srcdir)/../../../dynare++/sylv/cc -I$(top_srcdir)/../../../dynare++/integ/cc -I$(top_srcdir)/../../sources
libdynare___a_CXXFLAGS = $(PTHREAD_CFLAGS)
CXXFLAGS += $(PTHREAD_CFLAGS)
TOPDIR = $(top_srcdir)/../../../dynare++
KORD_SRCS = \
faa_di_bruno.cpp \
korder_stoch.cpp \
journal.cpp \
decision_rule.cpp \
dynamic_model.cpp \
random.cpp \
first_order.cpp \
normal_conjugate.cpp \
approximation.cpp \
global_check.cpp \
korder.cpp
$(TOPDIR)/kord/faa_di_bruno.cpp \
$(TOPDIR)/kord/korder_stoch.cpp \
$(TOPDIR)/kord/journal.cpp \
$(TOPDIR)/kord/decision_rule.cpp \
$(TOPDIR)/kord/dynamic_model.cpp \
$(TOPDIR)/kord/random.cpp \
$(TOPDIR)/kord/first_order.cpp \
$(TOPDIR)/kord/normal_conjugate.cpp \
$(TOPDIR)/kord/approximation.cpp \
$(TOPDIR)/kord/global_check.cpp \
$(TOPDIR)/kord/korder.cpp
SYLV_SRCS = \
IterativeSylvester.cpp \
QuasiTriangular.cpp \
QuasiTriangularZero.cpp \
GeneralMatrix.cpp \
GeneralSylvester.cpp \
SimilarityDecomp.cpp \
SylvException.cpp \
SchurDecompEig.cpp \
Vector.cpp \
TriangularSylvester.cpp \
SylvParams.cpp \
BlockDiagonal.cpp \
KronVector.cpp \
SylvMemory.cpp \
SymSchurDecomp.cpp \
SylvMatrix.cpp \
SchurDecomp.cpp \
KronUtils.cpp
$(TOPDIR)/sylv/cc/IterativeSylvester.cpp \
$(TOPDIR)/sylv/cc/QuasiTriangular.cpp \
$(TOPDIR)/sylv/cc/QuasiTriangularZero.cpp \
$(TOPDIR)/sylv/cc/GeneralMatrix.cpp \
$(TOPDIR)/sylv/cc/GeneralSylvester.cpp \
$(TOPDIR)/sylv/cc/SimilarityDecomp.cpp \
$(TOPDIR)/sylv/cc/SylvException.cpp \
$(TOPDIR)/sylv/cc/SchurDecompEig.cpp \
$(TOPDIR)/sylv/cc/Vector.cpp \
$(TOPDIR)/sylv/cc/TriangularSylvester.cpp \
$(TOPDIR)/sylv/cc/SylvParams.cpp \
$(TOPDIR)/sylv/cc/BlockDiagonal.cpp \
$(TOPDIR)/sylv/cc/KronVector.cpp \
$(TOPDIR)/sylv/cc/SylvMemory.cpp \
$(TOPDIR)/sylv/cc/SymSchurDecomp.cpp \
$(TOPDIR)/sylv/cc/SylvMatrix.cpp \
$(TOPDIR)/sylv/cc/SchurDecomp.cpp \
$(TOPDIR)/sylv/cc/KronUtils.cpp
TL_SRCS = \
normal_moments.cpp \
int_sequence.cpp \
tensor.cpp \
ps_tensor.cpp \
pyramid_prod2.cpp \
equivalence.cpp \
fine_container.cpp \
kron_prod.cpp \
t_polynomial.cpp \
symmetry.cpp \
stack_container.cpp \
twod_matrix.cpp \
sparse_tensor.cpp \
sthread.cpp \
gs_tensor.cpp \
pyramid_prod.cpp \
fs_tensor.cpp \
permutation.cpp \
rfs_tensor.cpp \
t_container.cpp \
tl_static.cpp
$(TOPDIR)/tl/cc/normal_moments.cpp \
$(TOPDIR)/tl/cc/int_sequence.cpp \
$(TOPDIR)/tl/cc/tensor.cpp \
$(TOPDIR)/tl/cc/ps_tensor.cpp \
$(TOPDIR)/tl/cc/pyramid_prod2.cpp \
$(TOPDIR)/tl/cc/equivalence.cpp \
$(TOPDIR)/tl/cc/fine_container.cpp \
$(TOPDIR)/tl/cc/kron_prod.cpp \
$(TOPDIR)/tl/cc/t_polynomial.cpp \
$(TOPDIR)/tl/cc/symmetry.cpp \
$(TOPDIR)/tl/cc/stack_container.cpp \
$(TOPDIR)/tl/cc/twod_matrix.cpp \
$(TOPDIR)/tl/cc/sparse_tensor.cpp \
$(TOPDIR)/tl/cc/sthread.cpp \
$(TOPDIR)/tl/cc/gs_tensor.cpp \
$(TOPDIR)/tl/cc/pyramid_prod.cpp \
$(TOPDIR)/tl/cc/fs_tensor.cpp \
$(TOPDIR)/tl/cc/permutation.cpp \
$(TOPDIR)/tl/cc/rfs_tensor.cpp \
$(TOPDIR)/tl/cc/t_container.cpp \
$(TOPDIR)/tl/cc/tl_static.cpp
INTEG_SRCS = \
product.cpp \
quadrature.cpp \
quasi_mcarlo.cpp \
smolyak.cpp \
vector_function.cpp
$(TOPDIR)/integ/cc/product.cpp \
$(TOPDIR)/integ/cc/quadrature.cpp \
$(TOPDIR)/integ/cc/quasi_mcarlo.cpp \
$(TOPDIR)/integ/cc/smolyak.cpp \
$(TOPDIR)/integ/cc/vector_function.cpp
nodist_libdynare___a_SOURCES = \
$(KORD_SRCS) \
$(TL_SRCS) \
$(SYLV_SRCS) \
$(INTEG_SRCS) \
nlsolve.cpp
$(TOPDIR)/src/nlsolve.cpp
vpath %.f $(top_srcdir)/../../sources/libslicot
noinst_LIBRARIES = libslicot.a libauxslicot.a
SLICOT_SRC = \
AB01MD.f \
AB01ND.f \
AB01OD.f \
AB04MD.f \
AB05MD.f \
AB05ND.f \
AB05OD.f \
AB05PD.f \
AB05QD.f \
AB05RD.f \
AB05SD.f \
AB07MD.f \
AB07ND.f \
AB08MD.f \
AB08MZ.f \
AB08ND.f \
AB08NX.f \
AB08NZ.f \
AB09AD.f \
AB09AX.f \
AB09BD.f \
AB09BX.f \
AB09CD.f \
AB09CX.f \
AB09DD.f \
AB09ED.f \
AB09FD.f \
AB09GD.f \
AB09HD.f \
AB09HX.f \
AB09HY.f \
AB09ID.f \
AB09IX.f \
AB09IY.f \
AB09JD.f \
AB09JV.f \
AB09JW.f \
AB09JX.f \
AB09KD.f \
AB09KX.f \
AB09MD.f \
AB09ND.f \
AB13AD.f \
AB13AX.f \
AB13BD.f \
AB13CD.f \
AB13DD.f \
AB13DX.f \
AB13ED.f \
AB13FD.f \
AB13MD.f \
AB8NXZ.f \
AG07BD.f \
AG08BD.f \
AG08BY.f \
AG08BZ.f \
AG8BYZ.f \
BB01AD.f \
BB02AD.f \
BB03AD.f \
BB04AD.f \
BD01AD.f \
BD02AD.f \
DE01OD.f \
DE01PD.f \
delctg.f \
DF01MD.f \
DG01MD.f \
DG01ND.f \
DG01NY.f \
DG01OD.f \
DK01MD.f \
FB01QD.f \
FB01RD.f \
FB01SD.f \
FB01TD.f \
FB01VD.f \
FD01AD.f \
IB01AD.f \
IB01BD.f \
IB01CD.f \
IB01MD.f \
IB01MY.f \
IB01ND.f \
IB01OD.f \
IB01OY.f \
IB01PD.f \
IB01PX.f \
IB01PY.f \
IB01QD.f \
IB01RD.f \
IB03AD.f \
IB03BD.f \
MA01AD.f \
MA02AD.f \
MA02BD.f \
MA02BZ.f \
MA02CD.f \
MA02CZ.f \
MA02DD.f \
MA02ED.f \
MA02FD.f \
MA02GD.f \
MA02HD.f \
MA02ID.f \
MA02JD.f \
MB01MD.f \
MB01ND.f \
MB01PD.f \
MB01QD.f \
MB01RD.f \
MB01RU.f \
MB01RW.f \
MB01RX.f \
MB01RY.f \
MB01SD.f \
MB01TD.f \
MB01UD.f \
MB01UW.f \
MB01UX.f \
MB01VD.f \
MB01WD.f \
MB01XD.f \
MB01XY.f \
MB01YD.f \
MB01ZD.f \
MB02CD.f \
MB02CU.f \
MB02CV.f \
MB02CX.f \
MB02CY.f \
MB02DD.f \
MB02ED.f \
MB02FD.f \
MB02GD.f \
MB02HD.f \
MB02ID.f \
MB02JD.f \
MB02JX.f \
MB02KD.f \
MB02MD.f \
MB02ND.f \
MB02NY.f \
MB02OD.f \
MB02PD.f \
MB02QD.f \
MB02QY.f \
MB02RD.f \
MB02RZ.f \
MB02SD.f \
MB02SZ.f \
MB02TD.f \
MB02TZ.f \
MB02UD.f \
MB02UU.f \
MB02UV.f \
MB02VD.f \
MB02WD.f \
MB02XD.f \
MB02YD.f \
MB03MD.f \
MB03MY.f \
MB03ND.f \
MB03NY.f \
MB03OD.f \
MB03OY.f \
MB03PD.f \
MB03PY.f \
MB03QD.f \
MB03QX.f \
MB03QY.f \
MB03RD.f \
MB03RX.f \
MB03RY.f \
MB03SD.f \
MB03TD.f \
MB03TS.f \
MB03UD.f \
MB03VD.f \
MB03VY.f \
MB03WA.f \
MB03WD.f \
MB03WX.f \
MB03XD.f \
MB03XP.f \
MB03XU.f \
MB03YA.f \
MB03YD.f \
MB03YT.f \
MB03ZA.f \
MB03ZD.f \
MB04DD.f \
MB04DI.f \
MB04DS.f \
MB04DY.f \
MB04GD.f \
MB04ID.f \
MB04IY.f \
MB04IZ.f \
MB04JD.f \
MB04KD.f \
MB04LD.f \
MB04MD.f \
MB04ND.f \
MB04NY.f \
MB04OD.f \
MB04OW.f \
MB04OX.f \
MB04OY.f \
MB04PA.f \
MB04PB.f \
MB04PU.f \
MB04PY.f \
MB04QB.f \
MB04QC.f \
MB04QF.f \
MB04QU.f \
MB04TB.f \
MB04TS.f \
MB04TT.f \
MB04TU.f \
MB04TV.f \
MB04TW.f \
MB04TX.f \
MB04TY.f \
MB04UD.f \
MB04VD.f \
MB04VX.f \
MB04WD.f \
MB04WP.f \
MB04WR.f \
MB04WU.f \
MB04XD.f \
MB04XY.f \
MB04YD.f \
MB04YW.f \
MB04ZD.f \
MB05MD.f \
MB05MY.f \
MB05ND.f \
MB05OD.f \
MB05OY.f \
MB3OYZ.f \
MB3PYZ.f \
MC01MD.f \
MC01ND.f \
MC01OD.f \
MC01PD.f \
MC01PY.f \
MC01QD.f \
MC01RD.f \
MC01SD.f \
MC01SW.f \
MC01SX.f \
MC01SY.f \
MC01TD.f \
MC01VD.f \
MC01WD.f \
MC03MD.f \
MC03ND.f \
MC03NX.f \
MC03NY.f \
MD03AD.f \
MD03BA.f \
MD03BB.f \
MD03BD.f \
MD03BF.f \
MD03BX.f \
MD03BY.f \
NF01AD.f \
NF01AY.f \
NF01BA.f \
NF01BB.f \
NF01BD.f \
NF01BE.f \
NF01BF.f \
NF01BP.f \
NF01BQ.f \
NF01BR.f \
NF01BS.f \
NF01BU.f \
NF01BV.f \
NF01BW.f \
NF01BX.f \
NF01BY.f \
SB01BD.f \
SB01BX.f \
SB01BY.f \
SB01DD.f \
SB01FY.f \
SB01MD.f \
SB02CX.f \
SB02MD.f \
SB02MR.f \
SB02MS.f \
SB02MT.f \
SB02MU.f \
SB02MV.f \
SB02MW.f \
SB02ND.f \
SB02OD.f \
SB02OU.f \
SB02OV.f \
SB02OW.f \
SB02OX.f \
SB02OY.f \
SB02PD.f \
SB02QD.f \
SB02RD.f \
SB02RU.f \