1 # C interface exporting rules. 2 # 3 # Copyright (C) 2020, 2022, 2023 Paul Boddie <paul@boddie.org.uk> 4 # 5 # This program is free software; you can redistribute it and/or 6 # modify it under the terms of the GNU General Public License as 7 # published by the Free Software Foundation; either version 2 of 8 # the License, or (at your option) any later version. 9 # 10 # This program is distributed in the hope that it will be useful, 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 # GNU General Public License for more details. 14 # 15 # You should have received a copy of the GNU General Public License 16 # along with this program; if not, write to the Free Software 17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 # Boston, MA 02110-1301, USA 19 20 define export_interface_c_template = 21 ifdef IDL_EXPORT_DIR 22 $(1)_INT_IDL = $(call interfaces_to_idl,$(1)) 23 $(1)_INT_INC = $(call export_includes,$(call interfaces_to_interface_h,$(1))) 24 25 $$($(1)_INT_INC): $$($(1)_INT_IDL) $(IDL_PROG) 26 -mkdir -p $(IDL_EXPORT_DIR) 27 $(IDL_PROG) $(IDL_ARGS) -d $(IDL_EXPORT_DIR) --interfaces --language=c $$($(1)_INT_IDL) 28 endif 29 endef