######################################################################
-$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON)
- $(PYTHON2) $(PYTHON_FLAGS) $< > $@
+$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON) $(ES_API)
+ $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_API.xml \
+ -f $(MESA_DIR)/es/glapi/es1_API.xml \
+ -f $(MESA_DIR)/es/glapi/es2_API.xml > $@
$(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON)
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
return
- def printBody(self, api):
- self.process_enums( api )
+ def printBody(self, api_list):
+ self.enum_table = {}
+ for api in api_list:
+ self.process_enums( api )
keys = self.enum_table.keys()
keys.sort()
def process_enums(self, api):
- self.enum_table = {}
-
for obj in api.enumIterateByName():
if obj.value not in self.enum_table:
self.enum_table[ obj.value ] = []
+ enum = self.enum_table[ obj.value ]
name = "GL_" + obj.name
priority = obj.priority()
- self.enum_table[ obj.value ].append( [name, priority] )
+ already_in = False;
+ for n, p in enum:
+ if n == name:
+ already_in = True
+ if not already_in:
+ enum.append( [name, priority] )
def show_usage():
sys.exit(1)
if __name__ == '__main__':
- file_name = "gl_API.xml"
-
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
except Exception,e:
show_usage()
+ api_list = []
for (arg,val) in args:
if arg == "-f":
- file_name = val
-
- api = gl_XML.parse_GL_API( file_name )
+ api = gl_XML.parse_GL_API( val )
+ api_list.append(api);
printer = PrintGlEnums()
- printer.Print( api )
+ printer.Print( api_list )