[Mesa-dev] [PATCH 16/17] dispatch: Code generate api_exec.c.
Paul Berry
stereotype441 at gmail.com
Thu Nov 1 15:19:22 PDT 2012
This patch adjusts makefiles to cause src/mesa/main/api_exec.c to be
generated using src/mapi/glapi/gen/gl_genexec.py. There should be no
functional change.
---
src/mapi/glapi/gen/Makefile.am | 4 +
src/mesa/Android.gen.mk | 7 +
src/mesa/SConscript | 8 +
src/mesa/main/.gitignore | 1 +
src/mesa/main/api_exec.c | 934 -----------------------------------------
src/mesa/sources.mak | 2 +-
6 files changed, 21 insertions(+), 935 deletions(-)
delete mode 100644 src/mesa/main/api_exec.c
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index 14bb2df..13943e8 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -55,6 +55,7 @@ MESA_OUTPUTS = \
$(MESA_GLAPI_OUTPUTS) \
$(MESA_GLAPI_ASM_OUTPUTS) \
$(MESA_DIR)/main/enums.c \
+ $(MESA_DIR)/main/api_exec.c \
$(MESA_DIR)/main/dispatch.h \
$(MESA_DIR)/main/remap_helper.h \
$(MESA_GLX_DIR)/indirect.c \
@@ -215,6 +216,9 @@ $(MESA_GLAPI_DIR)/glapi_sparc.S: gl_SPARC_asm.py $(COMMON)
$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON)
$(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
+$(MESA_DIR)/main/api_exec.c: gl_genexec.py $(COMMON)
+ $(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml > $@
+
$(MESA_DIR)/main/dispatch.h: gl_table.py $(COMMON)
$(PYTHON_GEN) $< -f $(srcdir)/gl_and_es_API.xml -m remap_table > $@
diff --git a/src/mesa/Android.gen.mk b/src/mesa/Android.gen.mk
index ffa36db..ce6d65b 100644
--- a/src/mesa/Android.gen.mk
+++ b/src/mesa/Android.gen.mk
@@ -32,6 +32,7 @@ intermediates := $(call local-intermediates-dir)
# This is the list of auto-generated files: sources and headers
sources := \
main/enums.c \
+ main/api_exec.c \
program/program_parse.tab.c \
program/lex.yy.c \
main/dispatch.h \
@@ -123,6 +124,12 @@ $(intermediates)/main/enums.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
$(intermediates)/main/enums.c: $(dispatch_deps)
$(call es-gen)
+$(intermediates)/main/api_exec.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(glapi)/gl_genexec.py
+$(intermediates)/main/api_exec.c: PRIVATE_XML := -f $(glapi)/gl_and_es_API.xml
+
+$(intermediates)/main/api_exec.c: $(dispatch_deps)
+ $(call es-gen)
+
GET_HASH_GEN := $(LOCAL_PATH)/main/get_hash_generator.py
GET_HASH_GEN_FLAGS := $(patsubst %,-a %,$(MESA_ENABLED_APIS))
diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index 53e5ee8..11e034f 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -441,6 +441,14 @@ env.CodeGenerate(
command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
)
+# The api_exec.c file is generated from the GL/ES API.xml file
+env.CodeGenerate(
+ target = 'main/api_exec.c',
+ script = GLAPI + 'gen/gl_genexec.py',
+ source = GLAPI + 'gen/gl_and_es_API.xml',
+ command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
+ )
+
# We also depend on the auto-generated GL API headers
env.Depends(mesa_sources, glapi_headers)
diff --git a/src/mesa/main/.gitignore b/src/mesa/main/.gitignore
index 4115a9b..837f490 100644
--- a/src/mesa/main/.gitignore
+++ b/src/mesa/main/.gitignore
@@ -1,3 +1,4 @@
+api_exec.c
dispatch.h
enums.c
get_es1.c
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c
deleted file mode 100644
index da98c26..0000000
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index b4b58db..cfb24f3 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -9,7 +9,7 @@ MAIN_ES_FILES = \
MAIN_FILES = \
$(SRCDIR)main/api_arrayelt.c \
- $(SRCDIR)main/api_exec.c \
+ $(BUILDDIR)main/api_exec.c \
$(SRCDIR)main/api_loopback.c \
$(SRCDIR)main/api_validate.c \
$(SRCDIR)main/accum.c \
--
1.8.0
More information about the mesa-dev
mailing list