diff --git a/mex/build/A_times_B_kronecker_C.am b/mex/build/A_times_B_kronecker_C.am
new file mode 100644
index 0000000000000000000000000000000000000000..ef160ad41b10036f373bfd761d831d8d5ca14ace
--- /dev/null
+++ b/mex/build/A_times_B_kronecker_C.am
@@ -0,0 +1,16 @@
+# NB: build directories are separated for the two kronecker MEX, because one requires
+# OpenMP while the other doesn’t. Building both in the same directory does not play well
+# with automake (which will in particular be confused around Fortran modules, because of object
+# renaming that takes place when setting per-object compilation flags).
+
+mex_PROGRAMS = A_times_B_kronecker_C
+
+nodist_A_times_B_kronecker_C_SOURCES = A_times_B_kronecker_C.f08 matlab_mex.F08 blas_lapack.F08
+
+BUILT_SOURCES = $(nodist_A_times_B_kronecker_C_SOURCES)
+CLEANFILES = $(nodist_A_times_B_kronecker_C_SOURCES)
+
+A_times_B_kronecker_C.o : matlab_mex.mod lapack.mod
+
+%.f08: $(top_srcdir)/../../sources/kronecker/%.f08
+	$(LN_S) -f $< $@
diff --git a/mex/build/kronecker.am b/mex/build/kronecker.am
deleted file mode 100644
index 236d18625b78cb2f7111e088d213a0d8433a5f55..0000000000000000000000000000000000000000
--- a/mex/build/kronecker.am
+++ /dev/null
@@ -1,20 +0,0 @@
-mex_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.f08 matlab_mex.F08
-nodist_A_times_B_kronecker_C_SOURCES = A_times_B_kronecker_C.f08 matlab_mex.F08 blas_lapack.F08
-
-# Technically, only the sparse version needs OpenMP compilation flags.
-# However, using per-object compilation flags triggers object renaming in Automake,
-# with many problems (notably with Fortran modules, whose .o will be renamed, but
-# not their .mod).
-AM_FCFLAGS += -fopenmp
-AM_LDFLAGS += $(OPENMP_LDFLAGS)
-
-BUILT_SOURCES = $(nodist_sparse_hessian_times_B_kronecker_C_SOURCES) $(nodist_A_times_B_kronecker_C_SOURCES)
-CLEANFILES = $(nodist_sparse_hessian_times_B_kronecker_C_SOURCES) $(nodist_A_times_B_kronecker_C_SOURCES)
-
-sparse_hessian_times_B_kronecker_C.o : matlab_mex.mod
-A_times_B_kronecker_C.o : matlab_mex.mod lapack.mod
-
-%.f08: $(top_srcdir)/../../sources/kronecker/%.f08
-	$(LN_S) -f $< $@
diff --git a/mex/build/matlab/A_times_B_kronecker_C/Makefile.am b/mex/build/matlab/A_times_B_kronecker_C/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..fa5673270dbaae810bae272a3872f65c907020c8
--- /dev/null
+++ b/mex/build/matlab/A_times_B_kronecker_C/Makefile.am
@@ -0,0 +1,2 @@
+include ../mex.am
+include ../../A_times_B_kronecker_C.am
diff --git a/mex/build/matlab/Makefile.am b/mex/build/matlab/Makefile.am
index e84baee6ed388fe01510b7a2d7a63d0e045b98b4..a80713a157437d0e67c750f9737eceaddce7f425 100644
--- a/mex/build/matlab/Makefile.am
+++ b/mex/build/matlab/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I ../../../m4
 
-SUBDIRS = mjdgges kronecker bytecode block_kalman_filter sobol perfect_foresight_problem num_procs block_trust_region disclyap_fast
+SUBDIRS = mjdgges sparse_hessian_times_B_kronecker_C A_times_B_kronecker_C bytecode block_kalman_filter sobol perfect_foresight_problem num_procs block_trust_region disclyap_fast
 
 # libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
 if ENABLE_MEX_DYNAREPLUSPLUS
diff --git a/mex/build/matlab/configure.ac b/mex/build/matlab/configure.ac
index b6ab2178e64ce458483f95005c1e02b9b714fa06..7a0504f658f6e2458ce501bf0b2ae63242c09319 100644
--- a/mex/build/matlab/configure.ac
+++ b/mex/build/matlab/configure.ac
@@ -149,7 +149,8 @@ Binaries (with "make"):
 
 AC_CONFIG_FILES([Makefile
                  mjdgges/Makefile
-                 kronecker/Makefile
+                 sparse_hessian_times_B_kronecker_C/Makefile
+                 A_times_B_kronecker_C/Makefile
                  bytecode/Makefile
                  libdynare++/Makefile
                  gensylv/Makefile
diff --git a/mex/build/matlab/kronecker/Makefile.am b/mex/build/matlab/kronecker/Makefile.am
deleted file mode 100644
index 41a9064aba19fe3eb95382c18c266b01eec725a9..0000000000000000000000000000000000000000
--- a/mex/build/matlab/kronecker/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-include ../mex.am
-include ../../kronecker.am
diff --git a/mex/build/matlab/sparse_hessian_times_B_kronecker_C/Makefile.am b/mex/build/matlab/sparse_hessian_times_B_kronecker_C/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..fc2af45c765094d48d9eeb97dd7d887701f4b366
--- /dev/null
+++ b/mex/build/matlab/sparse_hessian_times_B_kronecker_C/Makefile.am
@@ -0,0 +1,2 @@
+include ../mex.am
+include ../../sparse_hessian_times_B_kronecker_C.am
diff --git a/mex/build/octave/A_times_B_kronecker_C/Makefile.am b/mex/build/octave/A_times_B_kronecker_C/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..9de2509b4072b460ef46ea664c65be4fa70721ed
--- /dev/null
+++ b/mex/build/octave/A_times_B_kronecker_C/Makefile.am
@@ -0,0 +1,3 @@
+EXEEXT = .mex
+include ../mex.am
+include ../../A_times_B_kronecker_C.am
diff --git a/mex/build/octave/Makefile.am b/mex/build/octave/Makefile.am
index 6726be71e928d36dc9cac5cb8deebed59ebf1b60..3b591a45c993ec2ecde52ad33ab8a6d9ed14cb9e 100644
--- a/mex/build/octave/Makefile.am
+++ b/mex/build/octave/Makefile.am
@@ -1,6 +1,6 @@
 ACLOCAL_AMFLAGS = -I ../../../m4
 
-SUBDIRS = mjdgges kronecker bytecode block_kalman_filter sobol perfect_foresight_problem num_procs block_trust_region disclyap_fast
+SUBDIRS = mjdgges sparse_hessian_times_B_kronecker_C A_times_B_kronecker_C bytecode block_kalman_filter sobol perfect_foresight_problem num_procs block_trust_region disclyap_fast
 
 # libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
 if ENABLE_MEX_DYNAREPLUSPLUS
diff --git a/mex/build/octave/configure.ac b/mex/build/octave/configure.ac
index 7df4785c35c60a99f98c11f7cd930adc7fc957c5..62a4061d2e8532403adf312251870bf6f546fb00 100644
--- a/mex/build/octave/configure.ac
+++ b/mex/build/octave/configure.ac
@@ -131,7 +131,8 @@ Binaries (with "make"):
 
 AC_CONFIG_FILES([Makefile
                  mjdgges/Makefile
-                 kronecker/Makefile
+                 sparse_hessian_times_B_kronecker_C/Makefile
+                 A_times_B_kronecker_C/Makefile
                  bytecode/Makefile
                  libdynare++/Makefile
                  gensylv/Makefile
diff --git a/mex/build/octave/kronecker/Makefile.am b/mex/build/octave/kronecker/Makefile.am
deleted file mode 100644
index 26b50e81c2027a2e57aca459dab0c793d49a5ea2..0000000000000000000000000000000000000000
--- a/mex/build/octave/kronecker/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-EXEEXT = .mex
-include ../mex.am
-include ../../kronecker.am
diff --git a/mex/build/octave/sparse_hessian_times_B_kronecker_C/Makefile.am b/mex/build/octave/sparse_hessian_times_B_kronecker_C/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..ff85cd6b14530231fba48286e5dc74695024f0ad
--- /dev/null
+++ b/mex/build/octave/sparse_hessian_times_B_kronecker_C/Makefile.am
@@ -0,0 +1,3 @@
+EXEEXT = .mex
+include ../mex.am
+include ../../sparse_hessian_times_B_kronecker_C.am
diff --git a/mex/build/sparse_hessian_times_B_kronecker_C.am b/mex/build/sparse_hessian_times_B_kronecker_C.am
new file mode 100644
index 0000000000000000000000000000000000000000..ab8537b6173b1d96d8bc0f91bf78a1371fa55ff8
--- /dev/null
+++ b/mex/build/sparse_hessian_times_B_kronecker_C.am
@@ -0,0 +1,19 @@
+# NB: build directories are separated for the two kronecker MEX, because one requires
+# OpenMP while the other doesn’t. Building both in the same directory does not play well
+# with automake (which will in particular be confused around Fortran modules, because of object
+# renaming that takes place when setting per-object compilation flags).
+
+mex_PROGRAMS = sparse_hessian_times_B_kronecker_C
+
+nodist_sparse_hessian_times_B_kronecker_C_SOURCES = sparse_hessian_times_B_kronecker_C.f08 matlab_mex.F08
+
+AM_FCFLAGS += -fopenmp
+AM_LDFLAGS += $(OPENMP_LDFLAGS)
+
+BUILT_SOURCES = $(nodist_sparse_hessian_times_B_kronecker_C_SOURCES)
+CLEANFILES = $(nodist_sparse_hessian_times_B_kronecker_C_SOURCES)
+
+sparse_hessian_times_B_kronecker_C.o : matlab_mex.mod
+
+%.f08: $(top_srcdir)/../../sources/kronecker/%.f08
+	$(LN_S) -f $< $@