Index: Singular/Makefile.am
===================================================================
--- Singular/Makefile.am	(revision ee668eff445bb4cf7e96d94673c39f627a30d232)
+++ Singular/Makefile.am	(revision b7d64b3fc45a85f34ae6f34e9c227eed2796c70f)
@@ -14,5 +14,5 @@
 CXXTEMPLFLAGS = --no-exceptions ## -fno-implicit-templates
 
-INCLUDES = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/numeric -I${top_builddir}/numeric -I${top_srcdir}/kernel -I${top_builddir}/kernel -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(GMP_CFLAGS) $(FACTORY_CFLAGS) $(NTL_CFLAGS)
+INCLUDES = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/numeric -I${top_builddir}/numeric -I${top_srcdir}/kernel -I${top_builddir}/kernel -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(GMP_CFLAGS) -I${top_srcdir}/factory/include -I${top_builddir}/factory/include $(FACTORY_CFLAGS) $(NTL_CFLAGS)
 
 ########################### libSingular* #########################
Index: factory/Makefile.am
===================================================================
--- factory/Makefile.am	(revision ee668eff445bb4cf7e96d94673c39f627a30d232)
+++ factory/Makefile.am	(revision b7d64b3fc45a85f34ae6f34e9c227eed2796c70f)
@@ -5,5 +5,5 @@
 CXXTEMPLFLAGS      =  --no-exceptions ## -fno-implicit-templates
 
-AM_CPPFLAGS = -Iinclude -I${srcdir}/include ${GMP_CFLAGS} ${NTL_CFLAGS}
+AM_CPPFLAGS = -I${builddir}/include -I${srcdir}/include ${GMP_CFLAGS} ${NTL_CFLAGS}
 
 lib_LTLIBRARIES = libfactory.la libfactory_g.la
@@ -303,5 +303,5 @@
 BUILT_SOURCES = cplusplus.h factory.h factoryconf.h
 
-CLEANFILES = $(BUILT_SOURCES)
+CLEANFILES = $(BUILT_SOURCES) include/factory/factory.h include/factory/factoryconf.h include/factory/cplusplus.h
 
 
Index: factory/include/factory/Makefile.am
===================================================================
--- factory/include/factory/Makefile.am	(revision ee668eff445bb4cf7e96d94673c39f627a30d232)
+++ factory/include/factory/Makefile.am	(revision b7d64b3fc45a85f34ae6f34e9c227eed2796c70f)
@@ -9,3 +9,3 @@
 
 nobase_libfactory_include_HEADERS = \
-    cf_gmp.h $(templateincl)
+              cf_gmp.h ${templateincl}
Index: kernel/Makefile.am
===================================================================
--- kernel/Makefile.am	(revision ee668eff445bb4cf7e96d94673c39f627a30d232)
+++ kernel/Makefile.am	(revision b7d64b3fc45a85f34ae6f34e9c227eed2796c70f)
@@ -26,5 +26,5 @@
 libkernel_g_la_CPPFLAGS = -DHAVE_CONFIG_H 
 
-INCLUDES = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(GMP_CFLAGS) $(FACTORY_CFLAGS) $(NTL_CFLAGS)
+INCLUDES = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(GMP_CFLAGS) -I${top_srcdir}/factory/include -I${top_builddir}/factory/include $(FACTORY_CFLAGS) $(NTL_CFLAGS)
 
 SOURCES = polys.cc febase.cc feread.cc \
Index: libpolys/coeffs/Makefile.am
===================================================================
--- libpolys/coeffs/Makefile.am	(revision ee668eff445bb4cf7e96d94673c39f627a30d232)
+++ libpolys/coeffs/Makefile.am	(revision b7d64b3fc45a85f34ae6f34e9c227eed2796c70f)
@@ -21,5 +21,6 @@
 #	mpr_complex.h mpr_global.h
 
-INCLUDES = -I${top_srcdir} -I${top_srcdir}/.. -I${top_builddir} -I${top_builddir}/.. -I${srcdir} ${FACTORY_CFLAGS} ${GMP_CFLAGS} ${NTL_CFLAGS}
+
+INCLUDES = -I${top_srcdir} -I${top_srcdir}/.. -I${top_builddir} -I${top_builddir}/.. -I${srcdir} -I${top_srcdir}/../factory/include -I${top_builddir}/../factory/include ${FACTORY_CFLAGS} ${GMP_CFLAGS} ${NTL_CFLAGS}
 
 SOURCES = \
Index: libpolys/polys/Makefile.am
===================================================================
--- libpolys/polys/Makefile.am	(revision ee668eff445bb4cf7e96d94673c39f627a30d232)
+++ libpolys/polys/Makefile.am	(revision b7d64b3fc45a85f34ae6f34e9c227eed2796c70f)
@@ -10,5 +10,5 @@
 AM_CXXFLAGS	= ${PIPE} ${CXXTEMPLFLAGS}
 
-INCLUDES	= -I${abs_top_srcdir} -I${abs_top_srcdir}/.. -I${abs_top_builddir} -I${abs_top_builddir}/.. -I${srcdir} -I${includedir} ${GMP_CFLAGS}
+INCLUDES	= -I${top_srcdir} -I${top_srcdir}/.. -I${top_builddir} -I${top_builddir}/.. -I${srcdir} -I${includedir} -I${top_srcdir}/../factory/include -I${top_builddir}/../factory/include ${FACTORY_CFLAGS} ${GMP_CFLAGS}
 AM_LDFLAGS	= -L${abs_top_builddir}/coeffs -L${abs_top_builddir}/reporter -L${abs_top_builddir}/resources -L${abs_top_builddir}/../omalloc -L${abs_builddir}
 
Index: libpolys/tests/Makefile.am
===================================================================
--- libpolys/tests/Makefile.am	(revision ee668eff445bb4cf7e96d94673c39f627a30d232)
+++ libpolys/tests/Makefile.am	(revision b7d64b3fc45a85f34ae6f34e9c227eed2796c70f)
@@ -9,5 +9,5 @@
 
 
-INCLUDES = -I${top_srcdir} -I${top_srcdir}/.. -I${top_builddir} -I${top_builddir}/.. -I${srcdir} ${FACTORY_CFLAGS} ${GMP_CFLAGS} ${NTL_CFLAGS} 
+INCLUDES = -I${top_srcdir} -I${top_srcdir}/.. -I${top_builddir} -I${top_builddir}/.. -I${srcdir} -I${top_srcdir}/../factory/include -I${top_builddir}/../factory/include ${FACTORY_CFLAGS} ${GMP_CFLAGS} ${NTL_CFLAGS} 
 
 TESTS = simple_test \
Index: numeric/Makefile.am
===================================================================
--- numeric/Makefile.am	(revision ee668eff445bb4cf7e96d94673c39f627a30d232)
+++ numeric/Makefile.am	(revision b7d64b3fc45a85f34ae6f34e9c227eed2796c70f)
@@ -14,5 +14,5 @@
 libnumeric_g_la_CPPFLAGS = -DHAVE_CONFIG_H 
 
-INCLUDES = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/libpolys -I${top_builddir}/libpolys ${GMP_CFLAGS} ${FACTORY_CFLAGS} ${NTL_CFLAGS}
+INCLUDES = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/libpolys -I${top_builddir}/libpolys ${GMP_CFLAGS} -I${top_srcdir}/factory/include -I${top_builddir}/factory/include ${FACTORY_CFLAGS} ${NTL_CFLAGS}
 
 SOURCES  = mpr_base.cc mpr_inout.cc mpr_numeric.cc
