diff options
author | Chia-I Wu <[email protected]> | 2011-08-08 10:40:12 +0900 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2011-08-13 13:57:10 +0800 |
commit | 786e5a2fb47e39c67a342eb22d84c665d058ee10 (patch) | |
tree | 64db732a5d66190a8eae62b0e30a7b4e0f7473c4 /src/mapi/glapi | |
parent | 5076561b35b9c2c78f277ab03bf1e642094ee20e (diff) |
glapi: add glapi_gen.mk to help header generation
glapi_gen.mk is supposed to be included by glapi users to simplify
header generation. This commit also makes es1api, es2api, and
shared-glapi use it.
Reviewed-by: Brian Paul <[email protected]>
[olv: updated after reviewing to prefix all variables in glapi_gen.mk by
glapi_gen]
Diffstat (limited to 'src/mapi/glapi')
-rw-r--r-- | src/mapi/glapi/gen/glapi_gen.mk | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/mapi/glapi/gen/glapi_gen.mk b/src/mapi/glapi/gen/glapi_gen.mk new file mode 100644 index 00000000000..c7fa7c0153d --- /dev/null +++ b/src/mapi/glapi/gen/glapi_gen.mk @@ -0,0 +1,44 @@ +# Helpers for glapi header generation + +ifndef TOP +$(error TOP must be defined.) +endif + +glapi_gen_common_deps := \ + $(wildcard $(TOP)/src/mapi/glapi/gen/*.xml) \ + $(wildcard $(TOP)/src/mapi/glapi/gen/*.py) + +glapi_gen_mapi_script := $(TOP)/src/mapi/mapi/mapi_abi.py +glapi_gen_mapi_deps := \ + $(glapi_gen_mapi_script) \ + $(glapi_gen_common_deps) + +# $(1): path to an XML file +# $(2): name of the printer +define glapi_gen_mapi +@mkdir -p $(dir $@) +$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_mapi_script) \ + --mode lib --printer $(2) $(1) > $@ +endef + +glapi_gen_dispatch_script := $(TOP)/src/mapi/glapi/gen/gl_table.py +glapi_gen_dispatch_deps := $(glapi_gen_common_deps) + +# $(1): path to an XML file +# $(2): empty, es1, or es2 for entry point filtering +define glapi_gen_dispatch +@mkdir -p $(dir $@) +$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_dispatch_script) \ + -f $(1) -m remap_table $(if $(2),-c $(2),) > $@ +endef + +glapi_gen_remap_script := $(TOP)/src/mapi/glapi/gen/remap_helper.py +glapi_gen_remap_deps := $(glapi_gen_common_deps) + +# $(1): path to an XML file +# $(2): empty, es1, or es2 for entry point filtering +define glapi_gen_remap +@mkdir -p $(dir $@) +$(PYTHON2) $(PYTHON_FLAGS) $(glapi_gen_remap_script) \ + -f $(1) $(if $(2),-c $(2),) > $@ +endef |