blob: 4bc265ecb0b3ba84dc6ff20fa8eb9078a359c5d7 [file] [log] [blame]
Zane Shelleyba5dc162020-11-09 21:47:55 -06001#-------------------------------------------------------------------------------
2# Chip Data Files
3#-------------------------------------------------------------------------------
4
Zane Shelley738276a2021-05-24 12:55:34 -05005build_cdb = find_program('parse_chip_data_xml')
Zane Shelleyba5dc162020-11-09 21:47:55 -06006
7# The key for each entry in this dictionary is a subdirectory containing XML for
8# a chip model. The value for each entry contains the expected output files that
9# will be produced for each chip model. It is important to note that the script
10# will generate all output files, regardless of what is listed, when the script
11# is run. However, this list must be kept in sync with the expected output so
12# that meson will know to run the script when an output file has changed or is
13# missing.
14cdb_files = {
15 'p10' :
16 [
Zane Shelley738276a2021-05-24 12:55:34 -050017 'chip_data_p10_10.cdb',
18 'chip_data_p10_20.cdb',
Zane Shelleyba5dc162020-11-09 21:47:55 -060019 ],
20
21 'explorer' :
22 [
Zane Shelley738276a2021-05-24 12:55:34 -050023 'chip_data_explorer_11.cdb',
24 'chip_data_explorer_20.cdb',
Zane Shelleyba5dc162020-11-09 21:47:55 -060025 ],
26}
27
28foreach chip_dir, out_files : cdb_files
29
30 source_dir = meson.current_source_dir() + '/' + chip_dir
31 build_dir = meson.current_build_dir()
32
33 # Get all XML files in the chip directory. This is a bit of a workaround
34 # because meson does not allow wildcards.
35 xml_list = run_command('xml_list.sh', source_dir)
36 in_files = xml_list.stdout().strip().split('\n')
37
38 custom_target('build_cdb_' + chip_dir, build_by_default : true,
39 input : in_files, output : out_files,
Zane Shelley738276a2021-05-24 12:55:34 -050040 command : [ build_cdb, '--cdb',
41 '-i', source_dir,
42 '-o', build_dir ],
Zane Shelleyba5dc162020-11-09 21:47:55 -060043 install : true,
44 install_dir : join_paths(get_option('prefix'),
45 get_option('datadir'),
46 meson.project_name()))
47
48endforeach
49