[Mesa-dev] [PATCH 1/2] mapi: use a path prefix for sources variable

nobled nobled at dreamwidth.org
Thu Jul 19 10:59:42 PDT 2012


This makes it possible to share sources.mak with the
Android build again.
---

Still todo: sharing this with the SConscript build, which still
duplicates the list of sources.

 src/mapi/glapi/Makefile.am        |    4 +++-
 src/mapi/mapi/sources.mak         |   25 ++++++++++++++-----------
 src/mapi/shared-glapi/Makefile.am |    4 +++-
 3 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/src/mapi/glapi/Makefile.am b/src/mapi/glapi/Makefile.am
index 668d7fa..b9ef88f 100644
--- a/src/mapi/glapi/Makefile.am
+++ b/src/mapi/glapi/Makefile.am
@@ -19,9 +19,10 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.

-TOP = $(top_srcdir)
 include sources.mak
-include ../mapi/sources.mak
+
+MAPI = $(srcdir)/../mapi
+include $(MAPI)/sources.mak

 AM_CPPFLAGS = \
         $(DEFINES) \
diff --git a/src/mapi/mapi/sources.mak b/src/mapi/mapi/sources.mak
index 56f4afd..6c15170 100644
--- a/src/mapi/mapi/sources.mak
+++ b/src/mapi/mapi/sources.mak
@@ -13,24 +13,27 @@
 #
 #  - In bridge mode, mapi provides entry points calling into glapi.  To use
 #    this mode, compile MAPI_BRIDGE_FILES with MAPI_MODE_BRIDGE defined.
+#
+# The variable $(MAPI) must be defined to point to this source directory
+# before the following variables can be used.

 MAPI_UTIL_FILES = \
-	$(TOP)/src/mapi/mapi/u_current.c \
-	$(TOP)/src/mapi/mapi/u_execmem.c
+	$(MAPI)/u_current.c \
+	$(MAPI)/u_execmem.c

 MAPI_FILES = \
-	$(TOP)/src/mapi/mapi/entry.c \
-	$(TOP)/src/mapi/mapi/mapi.c \
-	$(TOP)/src/mapi/mapi/stub.c \
-	$(TOP)/src/mapi/mapi/table.c \
+	$(MAPI)/entry.c \
+	$(MAPI)/mapi.c \
+	$(MAPI)/stub.c \
+	$(MAPI)/table.c \
 	$(MAPI_UTIL_FILES)

 MAPI_GLAPI_FILES = \
-	$(TOP)/src/mapi/mapi/entry.c \
-	$(TOP)/src/mapi/mapi/mapi_glapi.c \
-	$(TOP)/src/mapi/mapi/stub.c \
-	$(TOP)/src/mapi/mapi/table.c \
+	$(MAPI)/entry.c \
+	$(MAPI)/mapi_glapi.c \
+	$(MAPI)/stub.c \
+	$(MAPI)/table.c \
 	$(MAPI_UTIL_FILES)

 MAPI_BRIDGE_FILES = \
-	$(TOP)/src/mapi/mapi/entry.c
+	$(MAPI)/entry.c
diff --git a/src/mapi/shared-glapi/Makefile.am
b/src/mapi/shared-glapi/Makefile.am
index 9485683..2cb33fc 100644
--- a/src/mapi/shared-glapi/Makefile.am
+++ b/src/mapi/shared-glapi/Makefile.am
@@ -1,8 +1,9 @@
 # Used by OpenGL ES or when --enable-shared-glapi is specified

-TOP = $(top_srcdir)
 GLAPI = $(top_srcdir)/src/mapi/glapi
-include $(top_srcdir)/src/mapi/mapi/sources.mak
+MAPI = $(top_srcdir)/src/mapi/mapi
+
+include $(MAPI)/sources.mak

 lib_LTLIBRARIES = libglapi.la
 libglapi_la_SOURCES = $(MAPI_GLAPI_FILES)
-- 
1.7.9.5


More information about the mesa-dev mailing list