Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 Makefile.inc                                           | 12 ++++++++++++
 example/Makefile.inc                                   | 12 ++++--------
 helper/Makefile.am                                     | 12 ++++--------
 helper/test/Makefile.am                                | 18 +++++-------------
 platform/Makefile.inc                                  |  2 +-
 platform/linux-generic/Makefile.am                     |  8 +-------
 platform/linux-generic/test/Makefile.inc               | 12 ++----------
 platform/linux-generic/test/ring/Makefile.am           |  2 +-
 .../test/validation/api/shmem/Makefile.am              |  4 ++--
 test/Makefile.inc                                      | 17 +++++------------
 10 files changed, 37 insertions(+), 62 deletions(-)
 create mode 100644 Makefile.inc

diff --git a/Makefile.inc b/Makefile.inc
new file mode 100644
index 000000000000..10e4041fe662
--- /dev/null
+++ b/Makefile.inc
@@ -0,0 +1,12 @@
+ODP_INCLUDES = \
+       -I$(top_builddir)/platform/@with_platform@/include \
+       -I$(top_srcdir)/platform/@with_platform@/include \
+       -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
+       -I$(top_builddir)/include \
+       -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
+       -I$(top_srcdir)/include
+
+HELPER_INCLUDES = \
+       -I$(top_srcdir)/helper/include
+
+LIB   = $(top_builddir)/lib
diff --git a/example/Makefile.inc b/example/Makefile.inc
index 1609066e64c2..498f656faa66 100644
--- a/example/Makefile.inc
+++ b/example/Makefile.inc
@@ -1,16 +1,12 @@
+include $(top_srcdir)/Makefile.inc
+
 TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
 
-LIB   = $(top_builddir)/lib
 LDADD = $(LIB)/libodp-linux.la $(LIB)/libodphelper.la $(DPDK_PMDS)
 AM_CFLAGS = \
        -I$(srcdir) \
        -I$(top_srcdir)/example \
-       -I$(top_srcdir)/platform/@with_platform@/include \
-       -I$(top_srcdir)/include/ \
-       -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-       -I$(top_srcdir)/helper/include \
-       -I$(top_builddir)/platform/@with_platform@/include \
-       -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-       -I$(top_builddir)/include
+       $(ODP_INCLUDES) \
+       $(HELPER_INCLUDES)
 
 AM_LDFLAGS = -L$(LIB) -static
diff --git a/helper/Makefile.am b/helper/Makefile.am
index ee1c17d6d0a3..2321a2d4f24c 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -1,15 +1,11 @@
+include $(top_srcdir)/Makefile.inc
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libodphelper.pc
 
-LIB   = $(top_builddir)/lib
 AM_CPPFLAGS = \
-       -I$(top_builddir)/platform/@with_platform@/include \
-       -I$(top_srcdir)/helper/include \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-       -I$(top_srcdir)/platform/@with_platform@/include \
-       -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-       -I$(top_builddir)/include
+       $(ODP_INCLUDES) \
+       $(HELPER_INCLUDES)
 
 AM_LDFLAGS = -version-number '$(ODPHELPER_LIBSO_VERSION)'
 
diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am
index 8eee643bee39..27c414aa7461 100644
--- a/helper/test/Makefile.am
+++ b/helper/test/Makefile.am
@@ -1,25 +1,17 @@
-TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
+include $(top_srcdir)/Makefile.inc
 
-LIB   = $(top_builddir)/lib
+TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
 
 #in the following line, the libs using the symbols should come before
 #the libs containing them! The includer is given a chance to add things
 #before libodp by setting PRE_LDADD before the inclusion.
 LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp-linux.la
 
-INCFLAGS = \
-       -I$(top_builddir)/platform/@with_platform@/include \
-       -I$(top_srcdir)/helper/include \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-       -I$(top_srcdir)/platform/@with_platform@/include \
-       -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-       -I$(top_builddir)/include \
-       -I$(top_srcdir)/helper
-
 ODP_PLATFORM=${with_platform}
 
-AM_CPPFLAGS = $(INCFLAGS)
+AM_CPPFLAGS = \
+       $(ODP_INCLUDES) \
+       $(HELPER_INCLUDES)
 AM_LDFLAGS = -static
 
 EXECUTABLES = chksum \
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index 0086db779897..4714de0ee805 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -1,4 +1,4 @@
-LIB   = $(top_builddir)/lib
+include $(top_srcdir)/Makefile.inc
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libodp-linux.pc
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index c5406760935e..703b12c702ea 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -3,14 +3,8 @@
 
 include $(top_srcdir)/platform/Makefile.inc
 
-AM_CPPFLAGS =  -I$(srcdir)/include
-AM_CPPFLAGS +=  -I$(top_srcdir)/include
-AM_CPPFLAGS +=  -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@
-AM_CPPFLAGS +=  -I$(top_builddir)/include
-AM_CPPFLAGS +=  -Iinclude
-AM_CPPFLAGS +=  -I$(top_srcdir)/platform/$(with_platform)/arch/$(ARCH_DIR)
+AM_CPPFLAGS = $(ODP_INCLUDES)
 AM_CPPFLAGS +=  -I$(top_srcdir)/platform/$(with_platform)/arch/default
-AM_CPPFLAGS +=  -Iinclude
 AM_CPPFLAGS +=  -DSYSCONFDIR=\"@sysconfdir@\"
 
 AM_CPPFLAGS +=  $(OPENSSL_CPPFLAGS)
diff --git a/platform/linux-generic/test/Makefile.inc 
b/platform/linux-generic/test/Makefile.inc
index dd21917ebfa7..05c89c9132cd 100644
--- a/platform/linux-generic/test/Makefile.inc
+++ b/platform/linux-generic/test/Makefile.inc
@@ -1,3 +1,5 @@
+include $(top_srcdir)/Makefile.inc
+
 # The following definitions may be used by platform tests that wish to
 # build specific ODP applications, (i.e those whose do more than validation
 # test wrapping)
@@ -7,16 +9,6 @@ AM_LDFLAGS = -static
 AM_CFLAGS = $(CUNIT_CFLAGS)
 
 LIBCUNIT_COMMON = $(top_builddir)/test/common/libcunit_common.la
-LIB   = $(top_builddir)/lib
 LIBODP = $(LIB)/libodphelper.la $(LIB)/libodp-linux.la $(DPDK_PMDS)
 
 INCCUNIT_COMMON = -I$(top_srcdir)/test/common
-INCODP =  \
-        -I$(top_builddir)/include \
-        -I$(top_builddir)/platform/@with_platform@/include \
-        -I$(top_srcdir)/helper/include \
-        -I$(top_srcdir)/include \
-        -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-        -I$(top_srcdir)/platform/@with_platform@/arch/$(ARCH_DIR) \
-        -I$(top_srcdir)/platform/@with_platform@/include \
-        -I$(top_srcdir)/test
diff --git a/platform/linux-generic/test/ring/Makefile.am 
b/platform/linux-generic/test/ring/Makefile.am
index 376047559cc7..c08959d04f53 100644
--- a/platform/linux-generic/test/ring/Makefile.am
+++ b/platform/linux-generic/test/ring/Makefile.am
@@ -7,5 +7,5 @@ ring_main_SOURCES = \
                    ring_basic.c ring_stress.c
 
 ring_main_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)/include \
-                    $(INCCUNIT_COMMON) $(INCODP)
+                    $(INCCUNIT_COMMON) $(ODP_INCLUDES) $(HELPER_INCLUDES)
 ring_main_LDADD = $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/platform/linux-generic/test/validation/api/shmem/Makefile.am 
b/platform/linux-generic/test/validation/api/shmem/Makefile.am
index 131a511be73b..8753331e0dd2 100644
--- a/platform/linux-generic/test/validation/api/shmem/Makefile.am
+++ b/platform/linux-generic/test/validation/api/shmem/Makefile.am
@@ -12,11 +12,11 @@ shmem_linux_LDFLAGS = $(AM_LDFLAGS) -lrt
 shmem_odp1_SOURCES = shmem_odp1.c shmem_odp1.h shmem_common.h
 shmem_odp1_CFLAGS = $(AM_CFLAGS) \
                   $(INCCUNIT_COMMON) \
-                  $(INCODP)
+                  $(ODP_INCLUDES)
 shmem_odp1_LDADD = $(LIBCUNIT_COMMON) $(LIBODP)
 
 shmem_odp2_SOURCES = shmem_odp2.c shmem_odp2.h shmem_common.h
 shmem_odp2_CFLAGS = $(AM_CFLAGS) \
                   $(INCCUNIT_COMMON) \
-                  $(INCODP)
+                  $(ODP_INCLUDES)
 shmem_odp2_LDADD = $(LIBCUNIT_COMMON) $(LIBODP)
diff --git a/test/Makefile.inc b/test/Makefile.inc
index f7c0da21496c..26e188e7d969 100644
--- a/test/Makefile.inc
+++ b/test/Makefile.inc
@@ -1,21 +1,14 @@
-LIB   = $(top_builddir)/lib
+include $(top_srcdir)/Makefile.inc
 
 #in the following line, the libs using the symbols should come before
 #the libs containing them! The includer is given a chance to add things
 #before libodp by setting PRE_LDADD before the inclusion.
 LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp-linux.la $(DPDK_PMDS)
 
-INCFLAGS = \
-       -I$(top_builddir)/platform/@with_platform@/include \
-       -I$(top_srcdir)/helper/include \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-       -I$(top_srcdir)/platform/@with_platform@/include \
-       -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-       -I$(top_srcdir)/test/common \
-       -I$(top_builddir)/include
-
-AM_CPPFLAGS = $(INCFLAGS)
+AM_CPPFLAGS = \
+       $(ODP_INCLUDES) \
+       $(HELPER_INCLUDES) \
+       -I$(top_srcdir)/test/common
 AM_CFLAGS = $(CUNIT_CFLAGS)
 
 AM_LDFLAGS = -L$(LIB) -static
-- 
2.14.2

Reply via email to