diff --git a/Makefile.am b/Makefile.am
index b11a40ae90d9fafd1a1c8974a2394a4628848afa..db506f654c783d2b969695aea09e8283d479932b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,12 @@
 # $Id$
 
+SUBDIRS = m4 src test
+
 # possible options
 LDADD = $(IPOPT_LDFLAGS) $(IPOPT_LIBS)
 AM_CPPFLAGS += $(IPOPT_CPPFLAGS)
 
-noinst_PROGRAMS = rodobstacle rod3d harmonicmaps dirneucoupling neudircoupling rod-eoc
+noinst_PROGRAMS = rodobstacle rod3d harmonicmaps dirneucoupling neudircoupling rod-eoc 
 
 rodobstacle_SOURCES = rodobstacle.cc
 rod3d_SOURCES = rod3d.cc
@@ -29,3 +31,6 @@ neudircoupling_LDADD    = $(UG_LDFLAGS) $(AMIRAMESH_LDFLAGS) $(UG_LIBS) $(AMIRAM
 # don't follow the full GNU-standard
 # we need automake 1.5
 AUTOMAKE_OPTIONS = foreign 1.5
+
+include $(top_srcdir)/am/global-rules
+include $(top_srcdir)/am/top-rules
diff --git a/configure.ac b/configure.ac
index 07d41aaf41684faa6ca57ff7c3dd24c37de8d785..72665c856980315acd43409ca827bdeeaed42772 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,7 @@ AC_SUBST(AM_LDFLAGS, $DUNE_LDFLAGS)
 LIBS="$DUNE_LIBS"
 
 AC_CONFIG_FILES([Makefile
+                 src/Makefile
                  test/Makefile])
 AC_OUTPUT
 
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000000000000000000000000000000000000..da2fc0566462e5eb42f5633b38ca3adf10c98175
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,16 @@
+# $Id: Makefile.am 5716 2009-11-20 12:23:19Z dedner $
+
+SUBDIRS =
+
+AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/..
+
+srcincludedir = $(includedir)/dune/common
+srcinclude_HEADERS = averagedistanceassembler.hh localgeodesicfefunction.hh \
+                     quaternion.hh rodrefine.hh averageinterface.hh \
+                     localgeodesicfestiffness.hh riemanniantrsolver.hh rodwriter.hh \
+                     geodesicdifference.hh makestraightrod.hh rigidbodymotion.hh \
+                     rotation.hh geodesicfeassembler.hh maxnormtrustregion.hh \
+                     rodassembler.hh svd.hh harmonicenergystiffness.hh \
+                     planarrodassembler.hh  rodlocalstiffness.hh  targetspacertrsolver.hh
+
+include $(top_srcdir)/am/global-rules