From 7fd77a87dd738b6e0cd70d77572f0888b3504383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Mon, 8 Nov 2010 13:08:15 +0100 Subject: [PATCH] Added M2HTML to the build system --- .gitignore | 2 ++ mex/build/matlab/Makefile.am | 13 +++++++++++++ mex/build/matlab/configure.ac | 11 +++++++++++ 3 files changed, 26 insertions(+) diff --git a/.gitignore b/.gitignore index 903c28be3..085ac3946 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,8 @@ ylwrap !/doc/parallel/quest_*.pdf !/doc/parallel/RWMH_quest1_*.pdf !/doc/parallel/waitbars*.pdf +doc/m2html +mex/build/matlab/run_m2html.m # Preprocessor /preprocessor/dynare_m diff --git a/mex/build/matlab/Makefile.am b/mex/build/matlab/Makefile.am index bfb2c6094..3a4bd041f 100644 --- a/mex/build/matlab/Makefile.am +++ b/mex/build/matlab/Makefile.am @@ -6,6 +6,19 @@ SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dy if HAVE_GSL SUBDIRS += swz endif + +if HAVE_M2HTML +html-local: + echo "addpath ${M2HTML}" > run_m2html.m + echo "cd ../../.." >> run_m2html.m + echo "m2html('mFiles', 'matlab', 'htmlDir', 'doc/m2html', 'recursive', 'on', 'globalHypertextLinks', 'on')" >> run_m2html.m + echo "quit" >> run_m2html.m + $(MATLAB)/bin/matlab -r run_m2html # Not using the -nodisplay option, because with m2html it confuses the terminal (need to do a "reset") + +clean-local: + rm -f run_m2html.m + rm -rf ../../../doc/m2html +endif endif EXTRA_DIST = mex.def mexFunction-MacOSX.map diff --git a/mex/build/matlab/configure.ac b/mex/build/matlab/configure.ac index 2545b6ce2..2008a8d08 100644 --- a/mex/build/matlab/configure.ac +++ b/mex/build/matlab/configure.ac @@ -99,6 +99,16 @@ AC_ARG_ENABLE([openmp], AS_HELP_STRING([--enable-openmp], [use OpenMP for parall fi ]) +AC_ARG_WITH([m2html], AS_HELP_STRING([--with-m2html=DIR], [specify installation directory of M2HTML]), [ +M2HTML=$withval +BUILD_M2HTML=yes +], [ +M2HTML= +BUILD_M2HTML=no +]) +AC_SUBST([M2HTML]) +AM_CONDITIONAL([HAVE_M2HTML], [test "x$M2HTML" != "x"]) + AC_MSG_NOTICE([ Dynare is now configured for building the following components... @@ -106,6 +116,7 @@ Dynare is now configured for building the following components... Binaries (with "make"): MEX files for MATLAB (except SWZ): $BUILD_MEX_MATLAB SWZ MEX files for MATLAB: $BUILD_SWZ_MEX_MATLAB + M2HTML documentation: $BUILD_M2HTML ])