Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / mesa / src / mapi / glapi / gen-es / Makefile
blobbf66ec037cffd07580f824cae97e589eec1621b2
1 TOP = ../../../..
2 MAPI = $(TOP)/src/mapi/mapi
3 GLAPI = ../gen
4 include $(TOP)/configs/current
6 OUTPUTS := \
7 glapi_mapi_tmp.h \
8 main/dispatch.h \
9 main/remap_helper.h
11 COMMON = gl_and_es_API.xml gl_XML.py glX_XML.py license.py typeexpr.py
12 COMMON := $(addprefix $(GLAPI)/, $(COMMON))
14 ES1_APIXML := es1_API.xml
15 ES2_APIXML := es2_API.xml
16 ES1_OUTPUT_DIR := $(TOP)/src/mapi/es1api
17 ES2_OUTPUT_DIR := $(TOP)/src/mapi/es2api
19 ES1_DEPS = $(ES1_APIXML) base1_API.xml es1_EXT.xml es_EXT.xml \
20 es1_COMPAT.xml es_COMPAT.xml
21 ES2_DEPS = $(ES2_APIXML) base2_API.xml es2_EXT.xml es_EXT.xml \
22 es2_COMPAT.xml es_COMPAT.xml
24 ES1_OUTPUTS := $(addprefix $(ES1_OUTPUT_DIR)/, $(OUTPUTS))
25 ES2_OUTPUTS := $(addprefix $(ES2_OUTPUT_DIR)/, $(OUTPUTS))
27 SHARED_GLAPI_APIXML := $(GLAPI)/gl_and_es_API.xml
28 SHARED_GLAPI_OUTPUT_DIR := $(TOP)/src/mapi/shared-glapi
29 SHARED_GLAPI_DEPS := $(SHARED_GLAPI_APIXML)
30 SHARED_GLAPI_OUTPUTS = $(SHARED_GLAPI_OUTPUT_DIR)/glapi_mapi_tmp.h
32 all: es1 es2 shared-glapi
34 es1: $(ES1_OUTPUTS)
35 es2: $(ES2_OUTPUTS)
36 shared-glapi: $(SHARED_GLAPI_OUTPUTS)
38 $(ES1_OUTPUTS): APIXML := $(ES1_APIXML)
39 $(ES1_OUTPUTS): PRINTER := es1api
40 $(ES1_OUTPUTS): $(ES1_DEPS)
42 $(ES2_OUTPUTS): APIXML := $(ES2_APIXML)
43 $(ES2_OUTPUTS): PRINTER := es2api
44 $(ES2_OUTPUTS): $(ES2_DEPS)
46 $(SHARED_GLAPI_OUTPUTS): APIXML := $(SHARED_GLAPI_APIXML)
47 $(SHARED_GLAPI_OUTPUTS): PRINTER := shared-glapi
48 $(SHARED_GLAPI_OUTPUTS): $(SHARED_GLAPI_DEPS)
50 define gen-glapi
51 @mkdir -p $(dir $@)
52 $(PYTHON2) $(PYTHON_FLAGS) $< -f $(APIXML) $(1) > $@
53 endef
55 %/glapi_mapi_tmp.h: $(MAPI)/mapi_abi.py $(COMMON)
56 @mkdir -p $(dir $@)
57 $(PYTHON2) $(PYTHON_FLAGS) $< \
58 --printer $(PRINTER) --mode lib $(GLAPI)/gl_and_es_API.xml > $@
60 %/main/dispatch.h: $(GLAPI)/gl_table.py $(COMMON)
61 $(call gen-glapi,-c -m remap_table)
63 %/main/remap_helper.h: $(GLAPI)/remap_helper.py $(COMMON)
64 $(call gen-glapi)
66 verify_xml:
67 @if [ ! -f gl.h ]; then \
68 echo "Please copy gl.h and gl2.h to this directory"; \
69 exit 1; \
71 @echo "Verifying that es1_API.xml covers OpenGL ES 1.1..."
72 @$(PYTHON2) $(PYTHON_FLAGS) gl_parse_header.py gl.h > tmp.xml
73 @$(PYTHON2) $(PYTHON_FLAGS) gl_compare.py difference tmp.xml es1_API.xml
74 @echo "Verifying that es2_API.xml covers OpenGL ES 2.0..."
75 @$(PYTHON2) $(PYTHON_FLAGS) gl_parse_header.py gl2.h > tmp.xml
76 @$(PYTHON2) $(PYTHON_FLAGS) gl_compare.py difference tmp.xml es2_API.xml
77 @rm -f tmp.xml
79 clean-es1:
80 -rm -f $(ES1_OUTPUTS)
81 -rm -rf $(ES1_OUTPUT_DIR)/main
83 clean-es2:
84 -rm -f $(ES2_OUTPUTS)
85 -rm -rf $(ES2_OUTPUT_DIR)/main
87 clean-shared-glapi:
88 -rm -f $(SHARED_GLAPI_OUTPUTS)
90 clean: clean-es1 clean-es2 clean-shared-glapi
91 -rm -f *~ *.pyc *.pyo