1 # C++ client interface generation 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 client_interface_cc_template = 21 $(1)_CLIENT = $(call interfaces_to_client_cc_h,$(1)) 22 $(1)_CLIENT_IDL = $(call interfaces_to_idl,$(1)) 23 $(1)_CLIENT_CC_ = $(IDL_BUILD_DIR)/__client_cc__$(1) 24 25 # Reference interfaces if exported. 26 27 ifdef IDL_EXPORT_DIR 28 $(1)_CLIENT_INC = $(call export_includes,$(call interfaces_to_interface_h,$(1))) 29 endif 30 31 # All generated files depend on a target file produced by a single invocation of 32 # the idl command. Where any generated files are missing, the invocation is 33 # performed again. 34 35 $$(foreach FILENAME,$$($(1)_CLIENT),$$(if $$(wildcard $$(FILENAME)),,$$(shell rm -f $$($(1)_CLIENT_CC_)))) 36 37 $$($(1)_CLIENT): $$($(1)_CLIENT_CC_) 38 @touch $$@ 39 40 $$($(1)_CLIENT_CC_): $$($(1)_CLIENT_IDL) $$($(1)_CLIENT_INC) $(IDL_PROG) 41 $(IDL_PROG) $(IDL_ARGS) -d $(IDL_BUILD_DIR) --client --headers --routines --language=c++ $$($(1)_CLIENT_IDL) 42 @touch $$@ 43 endef