matrix_bin_gen = generator(
    map_matrix_py,
    arguments: [ '@INPUT@', '@OUTPUT@', ],
    output: '@BASENAME@.bin'
)

matrix_data_srcs = files(
    'map_matrix_000.json',
    'map_matrix_001.json',
    'map_matrix_002.json',
    'map_matrix_003.json',
    'map_matrix_004.json',
    'map_matrix_005.json',
    'map_matrix_006.json',
    'map_matrix_007.json',
    'map_matrix_008.json',
    'map_matrix_009.json',
    'map_matrix_010.json',
    'map_matrix_011.json',
    'map_matrix_012.json',
    'map_matrix_013.json',
    'map_matrix_014.json',
    'map_matrix_015.json',
    'map_matrix_016.json',
    'map_matrix_017.json',
    'map_matrix_018.json',
    'map_matrix_019.json',
    'map_matrix_020.json',
    'map_matrix_021.json',
    'map_matrix_022.json',
    'map_matrix_023.json',
    'map_matrix_024.json',
    'map_matrix_025.json',
    'map_matrix_026.json',
    'map_matrix_027.json',
    'map_matrix_028.json',
    'map_matrix_029.json',
    'map_matrix_030.json',
    'map_matrix_031.json',
    'map_matrix_032.json',
    'map_matrix_033.json',
    'map_matrix_034.json',
    'map_matrix_035.json',
    'map_matrix_036.json',
    'map_matrix_037.json',
    'map_matrix_038.json',
    'map_matrix_039.json',
    'map_matrix_040.json',
    'map_matrix_041.json',
    'map_matrix_042.json',
    'map_matrix_043.json',
    'map_matrix_044.json',
    'map_matrix_045.json',
    'map_matrix_046.json',
    'map_matrix_047.json',
    'map_matrix_048.json',
    'map_matrix_049.json',
    'map_matrix_050.json',
    'map_matrix_051.json',
    'map_matrix_052.json',
    'map_matrix_053.json',
    'map_matrix_054.json',
    'map_matrix_055.json',
    'map_matrix_056.json',
    'map_matrix_057.json',
    'map_matrix_058.json',
    'map_matrix_059.json',
    'map_matrix_060.json',
    'map_matrix_061.json',
    'map_matrix_062.json',
    'map_matrix_063.json',
    'map_matrix_064.json',
    'map_matrix_065.json',
    'map_matrix_066.json',
    'map_matrix_067.json',
    'map_matrix_068.json',
    'map_matrix_069.json',
    'map_matrix_070.json',
    'map_matrix_071.json',
    'map_matrix_072.json',
    'map_matrix_073.json',
    'map_matrix_074.json',
    'map_matrix_075.json',
    'map_matrix_076.json',
    'map_matrix_077.json',
    'map_matrix_078.json',
    'map_matrix_079.json',
    'map_matrix_080.json',
    'map_matrix_081.json',
    'map_matrix_082.json',
    'map_matrix_083.json',
    'map_matrix_084.json',
    'map_matrix_085.json',
    'map_matrix_086.json',
    'map_matrix_087.json',
    'map_matrix_088.json',
    'map_matrix_089.json',
    'map_matrix_090.json',
    'map_matrix_091.json',
    'map_matrix_092.json',
    'map_matrix_093.json',
    'map_matrix_094.json',
    'map_matrix_095.json',
    'map_matrix_096.json',
    'map_matrix_097.json',
    'map_matrix_098.json',
    'map_matrix_099.json',
    'map_matrix_100.json',
    'map_matrix_101.json',
    'map_matrix_102.json',
    'map_matrix_103.json',
    'map_matrix_104.json',
    'map_matrix_105.json',
    'map_matrix_106.json',
    'map_matrix_107.json',
    'map_matrix_108.json',
    'map_matrix_109.json',
    'map_matrix_110.json',
    'map_matrix_111.json',
    'map_matrix_112.json',
    'map_matrix_113.json',
    'map_matrix_114.json',
    'map_matrix_115.json',
    'map_matrix_116.json',
    'map_matrix_117.json',
    'map_matrix_118.json',
    'map_matrix_119.json',
    'map_matrix_120.json',
    'map_matrix_121.json',
    'map_matrix_122.json',
    'map_matrix_123.json',
    'map_matrix_124.json',
    'map_matrix_125.json',
    'map_matrix_126.json',
    'map_matrix_127.json',
    'map_matrix_128.json',
    'map_matrix_129.json',
    'map_matrix_130.json',
    'map_matrix_131.json',
    'map_matrix_132.json',
    'map_matrix_133.json',
    'map_matrix_134.json',
    'map_matrix_135.json',
    'map_matrix_136.json',
    'map_matrix_137.json',
    'map_matrix_138.json',
    'map_matrix_139.json',
    'map_matrix_140.json',
    'map_matrix_141.json',
    'map_matrix_142.json',
    'map_matrix_143.json',
    'map_matrix_144.json',
    'map_matrix_145.json',
    'map_matrix_146.json',
    'map_matrix_147.json',
    'map_matrix_148.json',
    'map_matrix_149.json',
    'map_matrix_150.json',
    'map_matrix_151.json',
    'map_matrix_152.json',
    'map_matrix_153.json',
    'map_matrix_154.json',
    'map_matrix_155.json',
    'map_matrix_156.json',
    'map_matrix_157.json',
    'map_matrix_158.json',
    'map_matrix_159.json',
    'map_matrix_160.json',
    'map_matrix_161.json',
    'map_matrix_162.json',
    'map_matrix_163.json',
    'map_matrix_164.json',
    'map_matrix_165.json',
    'map_matrix_166.json',
    'map_matrix_167.json',
    'map_matrix_168.json',
    'map_matrix_169.json',
    'map_matrix_170.json',
    'map_matrix_171.json',
    'map_matrix_172.json',
    'map_matrix_173.json',
    'map_matrix_174.json',
    'map_matrix_175.json',
    'map_matrix_176.json',
    'map_matrix_177.json',
    'map_matrix_178.json',
    'map_matrix_179.json',
    'map_matrix_180.json',
    'map_matrix_181.json',
    'map_matrix_182.json',
    'map_matrix_183.json',
    'map_matrix_184.json',
    'map_matrix_185.json',
    'map_matrix_186.json',
    'map_matrix_187.json',
    'map_matrix_188.json',
    'map_matrix_189.json',
    'map_matrix_190.json',
    'map_matrix_191.json',
    'map_matrix_192.json',
    'map_matrix_193.json',
    'map_matrix_194.json',
    'map_matrix_195.json',
    'map_matrix_196.json',
    'map_matrix_197.json',
    'map_matrix_198.json',
    'map_matrix_199.json',
    'map_matrix_200.json',
    'map_matrix_201.json',
    'map_matrix_202.json',
    'map_matrix_203.json',
    'map_matrix_204.json',
    'map_matrix_205.json',
    'map_matrix_206.json',
    'map_matrix_207.json',
    'map_matrix_208.json',
    'map_matrix_209.json',
    'map_matrix_210.json',
    'map_matrix_211.json',
    'map_matrix_212.json',
    'map_matrix_213.json',
    'map_matrix_214.json',
    'map_matrix_215.json',
    'map_matrix_216.json',
    'map_matrix_217.json',
    'map_matrix_218.json',
    'map_matrix_219.json',
    'map_matrix_220.json',
    'map_matrix_221.json',
    'map_matrix_222.json',
    'map_matrix_223.json',
    'map_matrix_224.json',
    'map_matrix_225.json',
    'map_matrix_226.json',
    'map_matrix_227.json',
    'map_matrix_228.json',
    'map_matrix_229.json',
    'map_matrix_230.json',
    'map_matrix_231.json',
    'map_matrix_232.json',
    'map_matrix_233.json',
    'map_matrix_234.json',
    'map_matrix_235.json',
    'map_matrix_236.json',
    'map_matrix_237.json',
    'map_matrix_238.json',
    'map_matrix_239.json',
    'map_matrix_240.json',
    'map_matrix_241.json',
    'map_matrix_242.json',
    'map_matrix_243.json',
    'map_matrix_244.json',
    'map_matrix_245.json',
    'map_matrix_246.json',
    'map_matrix_247.json',
    'map_matrix_248.json',
    'map_matrix_249.json',
    'map_matrix_250.json',
    'map_matrix_251.json',
    'map_matrix_252.json',
    'map_matrix_253.json',
    'map_matrix_254.json',
    'map_matrix_255.json',
    'map_matrix_256.json',
    'map_matrix_257.json',
    'map_matrix_258.json',
    'map_matrix_259.json',
    'map_matrix_260.json',
    'map_matrix_261.json',
    'map_matrix_262.json',
    'map_matrix_263.json',
    'map_matrix_264.json',
    'map_matrix_265.json',
    'map_matrix_266.json',
    'map_matrix_267.json',
    'map_matrix_268.json',
    'map_matrix_269.json',
    'map_matrix_270.json',
    'map_matrix_271.json',
    'map_matrix_272.json',
    'map_matrix_273.json',
    'map_matrix_274.json',
    'map_matrix_275.json',
    'map_matrix_276.json',
    'map_matrix_277.json',
    'map_matrix_278.json',
    'map_matrix_279.json',
    'map_matrix_280.json',
    'map_matrix_281.json',
    'map_matrix_282.json',
    'map_matrix_283.json',
    'map_matrix_284.json',
    'map_matrix_285.json',
    'map_matrix_286.json',
    'map_matrix_287.json',
    'map_matrix_288.json'
)

matrix_data_order = files('map_matrices.order')

map_matrix_narc = custom_target('map_matrix.narc',
    output: 'map_matrix.narc',
    input: [
        matrix_bin_gen.process(matrix_data_srcs, env: json2bin_env),
        matrix_data_order
    ],
    depends: [ py_consts_generators ],
    command: [
        narc_exe, 'create',
        '--order', matrix_data_order,
        '--output', '@OUTPUT@',
        '@PRIVATE_DIR@',
    ]
)

nitrofs_files += map_matrix_narc