Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / agl-basefiles / share / rpc_rule.mk
1 #
2 # @copyright Copyright (c) 2016-2019 TOYOTA MOTOR CORPORATION.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 #
18 # rpc rule makefile
19 #
20
21 #rpc_apidef directory path must be added
22 RPC_APIDEF := $(OECORE_NATIVE_SYSROOT)/usr/bin/rpc_apidef
23
24 RPC_API_RULES := $(RPC_API:%=.%.api.rule)
25 rpc_api := $(shell echo $(RPC_API) | tr A-Z a-z)
26 CLEAN_API_SRCS := $(rpc_api:%=%_api.h) $(rpc_api:%=%_api_stub.c) $(rpc_api:%=%_srvr.h) $(rpc_api:%=%_srvr_stub.c)
27 RPC_API_DEPS := $(rpc_api:%=%_api_stub.d) $(rpc_api:%=%_srvr_stub.d)
28
29 .%.api.rule:
30         @echo 'rpc_name:=$(shell echo $* | tr A-Z a-z)' > $@
31         @echo '$$(rpc_name)_api.h $$(rpc_name)_api_stub.c $$(rpc_name)_srvr.h $$(rpc_name)_srvr_stub.c: $*.api $$(RPC_APIDEF)' >> $@
32         @echo ' $$(RPC_APIDEF) $$(CPPFLAGS) $$(RPC_APIDEF_FLAGS) $$<' >> $@
33         @echo >> $@
34         @echo '$*.api:' >> $@
35         @echo >> $@
36
37 ifeq ($(strip $(filter clean%,$(MAKECMDGOALS))),)
38 ifneq ($(RPC_API_RULES),)
39 -include $(RPC_API_RULES) $(RPC_API_DEPS)
40 endif
41 endif
42