2023-03-31 15:42:08 +02:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/../../sources
|
2009-10-02 19:22:19 +02:00
|
|
|
|
|
|
|
DEFS += -DOCTAVE_MEX_FILE
|
2012-01-09 12:37:55 +01:00
|
|
|
DEFS += -DMEXEXT=\".mex\"
|
2009-10-02 19:22:19 +02:00
|
|
|
|
2022-06-07 17:46:16 +02:00
|
|
|
AM_CFLAGS = $(shell $(MKOCTFILE) -p CPICFLAG) -Wall -Wno-parentheses # TODO: use same warnings as C++
|
2021-06-04 10:49:46 +02:00
|
|
|
AM_FCFLAGS = $(shell $(MKOCTFILE) -p FPICFLAG) -Wall -Wimplicit-interface
|
2023-04-11 14:46:04 +02:00
|
|
|
AM_CXXFLAGS = -std=gnu++20 $(shell $(MKOCTFILE) -p CXXPICFLAG) -Wall -Wextra -Wold-style-cast
|
2021-09-21 17:58:05 +02:00
|
|
|
AM_LDFLAGS = $(shell $(MKOCTFILE) -p DL_LDFLAGS)
|
|
|
|
|
2021-10-25 18:02:46 +02:00
|
|
|
# See the comments in configure.ac
|
|
|
|
if LINK_OCTAVE_LIBS
|
2021-09-21 17:58:05 +02:00
|
|
|
AM_LDFLAGS += -L"$(shell $(MKOCTFILE) -p OCTLIBDIR)"
|
|
|
|
LIBS += $(shell $(MKOCTFILE) -p OCTAVE_LIBS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Unconditionally link against BLAS/LAPACK, since we tend to use them in
|
|
|
|
# many MEX files
|
|
|
|
LIBS += $(shell $(MKOCTFILE) -p BLAS_LIBS)
|
|
|
|
LIBS += $(shell $(MKOCTFILE) -p LAPACK_LIBS)
|
2009-10-02 19:22:19 +02:00
|
|
|
|
2014-07-18 12:15:36 +02:00
|
|
|
mexdir = $(libdir)/dynare/mex/octave
|
2014-07-16 16:18:06 +02:00
|
|
|
|
2016-12-01 23:25:01 +01:00
|
|
|
all-local: $(PROGRAMS)
|
2019-09-04 11:38:44 +02:00
|
|
|
## Create symlinks in mex/octave/, but only if the build is not
|
|
|
|
## out-of-tree (because of the Windows installer)
|
|
|
|
if [ "$(abs_srcdir)" = "$(abs_builddir)" ]; then \
|
|
|
|
$(MKDIR_P) $(top_srcdir)/../../octave && \
|
|
|
|
cd $(top_srcdir)/../../octave && \
|
|
|
|
for p in $(PROGRAMS); do \
|
|
|
|
$(LN_S) -f $(abs_builddir)/$$p $$p; \
|
|
|
|
done; \
|
|
|
|
fi
|
2009-10-02 19:22:19 +02:00
|
|
|
|
|
|
|
clean-local:
|
2019-12-03 16:17:00 +01:00
|
|
|
rm -f *.mod # Fortran modules
|
2010-02-01 10:50:29 +01:00
|
|
|
if test -d $(top_srcdir)/../../octave; then \
|
|
|
|
cd $(top_srcdir)/../../octave && rm -f $(PROGRAMS); \
|
|
|
|
fi
|
2019-12-03 16:17:00 +01:00
|
|
|
|
2022-01-04 11:31:02 +01:00
|
|
|
# Rules for the Fortran 2008 interface to MEX, BLAS/LAPACK and pthread functions
|
2019-12-03 16:17:08 +01:00
|
|
|
matlab_mat.mod: matlab_mex.o
|
|
|
|
matlab_mex.mod: matlab_mex.o
|
|
|
|
|
|
|
|
matlab_mex.F08: $(top_srcdir)/../../sources/matlab_mex.F08
|
|
|
|
$(LN_S) -f $< $@
|
2019-12-03 16:17:12 +01:00
|
|
|
|
|
|
|
blas.mod: blas_lapack.o
|
|
|
|
lapack.mod: blas_lapack.o
|
|
|
|
|
|
|
|
blas_lapack.F08: $(top_srcdir)/../../sources/blas_lapack.F08
|
|
|
|
$(LN_S) -f $< $@
|
2022-01-04 11:31:02 +01:00
|
|
|
|
|
|
|
pthread.mod: pthread.o
|
|
|
|
|
|
|
|
pthread.F08: $(top_srcdir)/../../sources/pthread.F08
|
|
|
|
$(LN_S) -f $< $@
|