diff --git a/configure.ac b/configure.ac
index 2b9aeb047361542c6f4573d413124a8018b8d3d0..effbc6d57dae978b412ae1a4ce1c2354aa276b85 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,7 @@ LIBS="$DUNE_LIBS"
 AC_CONFIG_FILES([
   Makefile
   src/Makefile
+  src/octave/Makefile
   doc/Makefile
   doc/doxygen/Makefile
   doc/doxygen/Doxyfile
diff --git a/src/Makefile.am b/src/Makefile.am
index c62a8dc9790ae829e08aa28599666ce0f395188d..1a32ffaab3115630d96680fc6f277dfa6a310e36 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS =
+SUBDIRS = octave
 
 check_PROGRAMS = \
 	test-python \
@@ -64,16 +64,3 @@ DISTCHECK_CONFIGURE_FLAGS = --with-dune-common=$(DUNE_COMMON_ROOT) --with-dune-f
 include $(top_srcdir)/am/global-rules
 
 include $(top_srcdir)/flymake.mk
-
-## Octave
-
-MKOCTFILE ?= mkoctfile
-OCTAVE    ?= octave
-
-OCTAVE_MODULES= duneminimise.oct duneevaluate.oct
-
-.PHONY: run-octave
-run-octave: $(OCTAVE_MODULES)
-	$(OCTAVE) --path $(abs_builddir) --path $(abs_srcdir)
-
-include $(srcdir)/octave.mk
diff --git a/src/octave/Makefile.am b/src/octave/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..977ad9d80c385bd62ded958fe044006af700e50b
--- /dev/null
+++ b/src/octave/Makefile.am
@@ -0,0 +1,18 @@
+SUBDIRS =
+
+AM_CPPFLAGS = \
+	$(DUNE_CPPFLAGS) \
+	-I$(top_srcdir)
+
+## Octave
+
+MKOCTFILE ?= mkoctfile
+OCTAVE    ?= octave
+
+OCTAVE_MODULES= duneminimise.oct duneevaluate.oct
+
+.PHONY: run-octave
+run-octave: $(OCTAVE_MODULES)
+	$(OCTAVE) --path $(abs_builddir) --path $(abs_srcdir)
+
+include $(srcdir)/octave.mk
diff --git a/src/curve.m b/src/octave/curve.m
similarity index 100%
rename from src/curve.m
rename to src/octave/curve.m
diff --git a/src/duneevaluate.cc b/src/octave/duneevaluate.cc
similarity index 100%
rename from src/duneevaluate.cc
rename to src/octave/duneevaluate.cc
diff --git a/src/duneminimise.cc b/src/octave/duneminimise.cc
similarity index 100%
rename from src/duneminimise.cc
rename to src/octave/duneminimise.cc
diff --git a/src/octave.mk b/src/octave/octave.mk
similarity index 100%
rename from src/octave.mk
rename to src/octave/octave.mk
diff --git a/src/zigzag.m b/src/octave/zigzag.m
similarity index 100%
rename from src/zigzag.m
rename to src/octave/zigzag.m