1 # Copyright 2017-2018 Intel Corporation 2 3 # Permission is hereby granted, free of charge, to any person obtaining a copy 4 # of this software and associated documentation files (the "Software"), to deal 5 # in the Software without restriction, including without limitation the rights 6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 # copies of the Software, and to permit persons to whom the Software is 8 # furnished to do so, subject to the following conditions: 9 10 # The above copyright notice and this permission notice shall be included in 11 # all copies or substantial portions of the Software. 12 13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 # SOFTWARE. 20 21 gen_knobs_cpp = custom_target( 22 'gen_knobs.cpp', 23 input : ['gen_knobs.py'], 24 output : 'gen_knobs.cpp', 25 command : [prog_python2, '@INPUT0@', '--output', '@OUTPUT@', '--gen_cpp'], 26 depend_files : files( 27 'knob_defs.py', 'gen_common.py', 28 'templates/gen_knobs.cpp', 29 ), 30 ) 31 32 gen_knobs_h = custom_target( 33 'gen_knobs.h', 34 input : ['gen_knobs.py'], 35 output : 'gen_knobs.h', 36 command : [prog_python2, '@INPUT0@', '--output', '@OUTPUT@', '--gen_h'], 37 depend_files : files( 38 'knob_defs.py', 'gen_common.py', 39 'templates/gen_knobs.h', 40 ), 41 ) 42 43 44 # The generators above this are needed individually, while the below generators 45 # are all inputs to the same lib, so they don't need unique names. 46 files_swr_common += [ 47 gen_builder_hpp, gen_builder_x86_hpp, gen_knobs_h, gen_knobs_cpp 48 ] 49 50 foreach x : [[swr_context_files, 'gen_swr_context_llvm.h'], 51 [swr_state_files, 'gen_state_llvm.h']] 52 files_swr_common += custom_target( 53 x[1], 54 input : ['gen_llvm_types.py', x[0]], 55 output : x[1], 56 command : [prog_python2, '@INPUT0@', '--input', '@INPUT1@', '--output', '@OUTPUT@'], 57 depend_files : files( 58 'templates/gen_llvm.hpp', 59 'gen_common.py', 60 ), 61 ) 62 endforeach 63 64 foreach x : [['gen_ar_event.hpp', '--gen_event_hpp'], 65 ['gen_ar_event.cpp', '--gen_event_cpp'], 66 ['gen_ar_eventhandler.hpp', '--gen_eventhandler_h'], 67 ['gen_ar_eventhandlerfile.hpp', '--gen_eventhandlerfile_h']] 68 files_swr_common += custom_target( 69 x[0], 70 input : ['gen_archrast.py', swr_event_proto_files], 71 output : x[0], 72 command : [ 73 prog_python2, '@INPUT0@', '--proto', '@INPUT1@', '--output', '@OUTPUT@', 74 x[1], 75 ], 76 depend_files : files( 77 join_paths('templates', x[0]), 78 'gen_common.py', 79 ), 80 ) 81 endforeach 82 83