101e04c3fSmrg# Copyright © 2017 Intel Corporation
201e04c3fSmrg
301e04c3fSmrg# Permission is hereby granted, free of charge, to any person obtaining a copy
401e04c3fSmrg# of this software and associated documentation files (the "Software"), to deal
501e04c3fSmrg# in the Software without restriction, including without limitation the rights
601e04c3fSmrg# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
701e04c3fSmrg# copies of the Software, and to permit persons to whom the Software is
801e04c3fSmrg# furnished to do so, subject to the following conditions:
901e04c3fSmrg
1001e04c3fSmrg# The above copyright notice and this permission notice shall be included in
1101e04c3fSmrg# all copies or substantial portions of the Software.
1201e04c3fSmrg
1301e04c3fSmrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1401e04c3fSmrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1501e04c3fSmrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1601e04c3fSmrg# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1701e04c3fSmrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1801e04c3fSmrg# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1901e04c3fSmrg# SOFTWARE.
2001e04c3fSmrg
2101e04c3fSmrggen_xml_files = [
2201e04c3fSmrg  'gen4.xml',
2301e04c3fSmrg  'gen45.xml',
2401e04c3fSmrg  'gen5.xml',
2501e04c3fSmrg  'gen6.xml',
2601e04c3fSmrg  'gen7.xml',
2701e04c3fSmrg  'gen75.xml',
2801e04c3fSmrg  'gen8.xml',
2901e04c3fSmrg  'gen9.xml',
3001e04c3fSmrg  'gen11.xml',
317ec681f3Smrg  'gen12.xml',
327ec681f3Smrg  'gen125.xml',
3301e04c3fSmrg]
3401e04c3fSmrg
3501e04c3fSmrggenX_xml_h = custom_target(
3601e04c3fSmrg  'genX_xml.h',
3701e04c3fSmrg  input : ['gen_zipped_file.py', gen_xml_files],
3801e04c3fSmrg  output : 'genX_xml.h',
3901e04c3fSmrg  command : [prog_python, '@INPUT@'],
4001e04c3fSmrg  capture : true,
4101e04c3fSmrg)
4201e04c3fSmrg
4301e04c3fSmrggenX_bits_h = custom_target(
4401e04c3fSmrg  'genX_bits.h',
4501e04c3fSmrg  input : ['gen_bits_header.py', gen_xml_files],
4601e04c3fSmrg  output : 'genX_bits.h',
4701e04c3fSmrg  command : [prog_python, '@INPUT@', '-o', '@OUTPUT@'],
4801e04c3fSmrg)
4901e04c3fSmrg
5001e04c3fSmrggen_xml_pack = []
517ec681f3Smrgforeach f : gen_xml_files + ['gen_rt.xml']
5201e04c3fSmrg  _name = '@0@_pack.h'.format(f.split('.')[0])
5301e04c3fSmrg  gen_xml_pack += custom_target(
5401e04c3fSmrg    _name,
5501e04c3fSmrg    input : ['gen_pack_header.py', f],
5601e04c3fSmrg    output : _name,
5701e04c3fSmrg    command : [prog_python, '@INPUT@'],
5801e04c3fSmrg    capture : true,
5901e04c3fSmrg  )
6001e04c3fSmrgendforeach
619f464c52Smaya
627ec681f3Smrggen_pack_header_py = files('gen_pack_header.py')
637ec681f3Smrg
649f464c52Smayaidep_genxml = declare_dependency(sources : [gen_xml_pack, genX_bits_h, genX_xml_h])
65