$(hide) touch $@
$(intermediates)/vulkan/anv_entrypoints.h:
- $(VK_ENTRYPOINTS_SCRIPT) header --xml $(MESA_TOP)/src/vulkan/registry/vk.xml > $@
+ $(VK_ENTRYPOINTS_SCRIPT) header $@ --xml $(MESA_TOP)/src/vulkan/registry/vk.xml
+
LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(intermediates)
LOCAL_GENERATED_SOURCES += $(intermediates)/vulkan/anv_entrypoints.c
$(intermediates)/vulkan/anv_entrypoints.c:
- $(VK_ENTRYPOINTS_SCRIPT) code --xml $(MESA_TOP)/src/vulkan/registry/vk.xml > $@
+ $(VK_ENTRYPOINTS_SCRIPT) code $@ --xml $(MESA_TOP)/src/vulkan/registry/vk.xml
LOCAL_SHARED_LIBRARIES := libdrm_intel
vulkan_api_xml = $(top_srcdir)/src/vulkan/registry/vk.xml
vulkan/anv_entrypoints.h : vulkan/anv_entrypoints_gen.py $(vulkan_api_xml)
- $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_entrypoints_gen.py header --xml $(vulkan_api_xml) > $@
+ $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_entrypoints_gen.py header $@ --xml $(vulkan_api_xml)
vulkan/anv_entrypoints.c : vulkan/anv_entrypoints_gen.py $(vulkan_api_xml)
- $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_entrypoints_gen.py code --xml $(vulkan_api_xml) > $@
+ $(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_entrypoints_gen.py code $@ --xml $(vulkan_api_xml)
BUILT_SOURCES += $(VULKAN_GENERATED_FILES)
CLEANFILES += \
#endif // ${guard}
% endif
% endfor
- """))
+ """), output_encoding='utf-8')
TEMPLATE_C = Template(textwrap.dedent(u"""\
/*
collisions[level] += 1
mapping[h & HASH_MASK] = num
- print TEMPLATE_C.render(entrypoints=entrypoints,
- offsets=offsets,
- collisions=collisions,
- mapping=mapping,
- hash_mask=HASH_MASK,
- prime_step=PRIME_STEP,
- prime_factor=PRIME_FACTOR,
- none=NONE,
- hash_size=HASH_SIZE,
- filename=os.path.basename(__file__))
+ return TEMPLATE_C.render(entrypoints=entrypoints,
+ offsets=offsets,
+ collisions=collisions,
+ mapping=mapping,
+ hash_mask=HASH_MASK,
+ prime_step=PRIME_STEP,
+ prime_factor=PRIME_FACTOR,
+ none=NONE,
+ hash_size=HASH_SIZE,
+ filename=os.path.basename(__file__))
def main():
parser = argparse.ArgumentParser()
parser.add_argument('target', choices=['header', 'code'],
help='Which file to generate.')
+ parser.add_argument('file', help='Where to write the file.')
parser.add_argument('--xml', help='Vulkan API XML file.')
args = parser.parse_args()
# For outputting entrypoints.h we generate a anv_EntryPoint() prototype
# per entry point.
if args.target == 'header':
- print TEMPLATE_H.render(entrypoints=entrypoints,
- filename=os.path.basename(__file__))
+ with open(args.file, 'wb') as f:
+ f.write(TEMPLATE_H.render(entrypoints=entrypoints,
+ filename=os.path.basename(__file__)))
else:
- gen_code(entrypoints)
+ with open(args.file, 'wb') as f:
+ f.write(gen_code(entrypoints))
if __name__ == '__main__':