From 838cd58e24a18102b8a140df9fa993fe65706828 Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Fri, 12 Nov 2010 11:41:55 +0000 Subject: [PATCH] build: add common.mk Rather than specifying common makefile variables move them all to a common.mk. Signed-off-by: Spencer Oliver --- common.mk | 5 +++++ src/Makefile.am | 8 ++------ src/flash/Makefile.am | 6 ++---- src/flash/nand/Makefile.am | 4 +--- src/flash/nor/Makefile.am | 4 +--- src/helper/Makefile.am | 5 +---- src/jtag/Makefile.am | 4 +--- src/jtag/drivers/Makefile.am | 4 +--- src/pld/Makefile.am | 4 +--- src/server/Makefile.am | 5 +---- src/svf/Makefile.am | 4 +--- src/target/Makefile.am | 5 +---- src/xsvf/Makefile.am | 4 +--- 13 files changed, 19 insertions(+), 43 deletions(-) create mode 100644 common.mk diff --git a/common.mk b/common.mk new file mode 100644 index 0000000000..d2273d7882 --- /dev/null +++ b/common.mk @@ -0,0 +1,5 @@ + +# common flags used in openocd build +AM_CPPFLAGS = -I$(top_srcdir)/src \ + -I$(top_builddir)/src \ + -DPKGDATADIR=\"$(pkgdatadir)\" diff --git a/src/Makefile.am b/src/Makefile.am index 19a0ba96c3..c2d37c1010 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,5 @@ +include $(top_srcdir)/common.mk + SUBDIRS = \ jtag \ helper \ @@ -29,12 +31,6 @@ noinst_HEADERS = \ hello.h \ openocd.h - -# set the include path found by configure -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src - libopenocd_la_CPPFLAGS = -DPKGBLDDATE=\"`date +%F-%R`\" # banner output includes RELSTR appended to $VERSION from the configure script diff --git a/src/flash/Makefile.am b/src/flash/Makefile.am index 9d983a8d9e..ece4018370 100644 --- a/src/flash/Makefile.am +++ b/src/flash/Makefile.am @@ -1,11 +1,9 @@ +include $(top_srcdir)/common.mk + SUBDIRS = \ nor \ nand -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src - METASOURCES = AUTO noinst_LTLIBRARIES = libflash.la libflash_la_SOURCES = \ diff --git a/src/flash/nand/Makefile.am b/src/flash/nand/Makefile.am index 8ea7b362dd..9aa0e69f16 100644 --- a/src/flash/nand/Makefile.am +++ b/src/flash/nand/Makefile.am @@ -1,6 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src +include $(top_srcdir)/common.mk noinst_LTLIBRARIES = libocdflashnand.la diff --git a/src/flash/nor/Makefile.am b/src/flash/nor/Makefile.am index 852c0a3797..e281c22bf3 100644 --- a/src/flash/nor/Makefile.am +++ b/src/flash/nor/Makefile.am @@ -1,6 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src +include $(top_srcdir)/common.mk noinst_LTLIBRARIES = libocdflashnor.la libocdflashnor_la_SOURCES = \ diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am index c721881915..25585a4896 100644 --- a/src/helper/Makefile.am +++ b/src/helper/Makefile.am @@ -1,7 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ - -DPKGDATADIR=\"$(pkgdatadir)\" +include $(top_srcdir)/common.mk METASOURCES = AUTO noinst_LTLIBRARIES = libhelper.la diff --git a/src/jtag/Makefile.am b/src/jtag/Makefile.am index 59cd8ffffd..fa964a352c 100644 --- a/src/jtag/Makefile.am +++ b/src/jtag/Makefile.am @@ -1,6 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src +include $(top_srcdir)/common.mk METASOURCES = AUTO noinst_LTLIBRARIES = libjtag.la diff --git a/src/jtag/drivers/Makefile.am b/src/jtag/drivers/Makefile.am index 0588126545..f3d5ab0524 100644 --- a/src/jtag/drivers/Makefile.am +++ b/src/jtag/drivers/Makefile.am @@ -1,6 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src +include $(top_srcdir)/common.mk noinst_LTLIBRARIES = libocdjtagdrivers.la diff --git a/src/pld/Makefile.am b/src/pld/Makefile.am index 3993622e6c..93b79f4a16 100644 --- a/src/pld/Makefile.am +++ b/src/pld/Makefile.am @@ -1,6 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src +include $(top_srcdir)/common.mk METASOURCES = AUTO noinst_LTLIBRARIES = libpld.la diff --git a/src/server/Makefile.am b/src/server/Makefile.am index ac24ebb559..a7c318ce69 100644 --- a/src/server/Makefile.am +++ b/src/server/Makefile.am @@ -1,7 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ - -DPKGDATADIR=\"$(pkgdatadir)\" +include $(top_srcdir)/common.mk METASOURCES = AUTO noinst_LTLIBRARIES = libserver.la diff --git a/src/svf/Makefile.am b/src/svf/Makefile.am index 398f9676d6..3a14d2087a 100644 --- a/src/svf/Makefile.am +++ b/src/svf/Makefile.am @@ -1,6 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src +include $(top_srcdir)/common.mk METASOURCES = AUTO noinst_LTLIBRARIES = libsvf.la diff --git a/src/target/Makefile.am b/src/target/Makefile.am index 1e29ae7d5c..537c8c3175 100644 --- a/src/target/Makefile.am +++ b/src/target/Makefile.am @@ -1,3 +1,4 @@ +include $(top_srcdir)/common.mk if OOCD_TRACE OOCD_TRACE_FILES = oocd_trace.c @@ -5,10 +6,6 @@ else OOCD_TRACE_FILES = endif -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src - BIN2C = $(top_builddir)/src/helper/bin2char$(EXEEXT_FOR_BUILD) DEBUG_HANDLER = $(srcdir)/xscale/debug_handler.bin diff --git a/src/xsvf/Makefile.am b/src/xsvf/Makefile.am index f96331cd56..1b9cfab00e 100644 --- a/src/xsvf/Makefile.am +++ b/src/xsvf/Makefile.am @@ -1,6 +1,4 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src +include $(top_srcdir)/common.mk METASOURCES = AUTO noinst_LTLIBRARIES = libxsvf.la -- 2.30.2