1# Copyright (C) 2022 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16LOCAL_DIR := $(GET_LOCAL_DIR)
17
18MODULE := $(LOCAL_DIR)
19
20# If we are inside the Android source tree, use the plugin binary from
21# the build output. Otherwise, run the source script directly.
22PROTOC_PLUGIN_SOURCE := \
23	trusty/host/common/scripts/metrics_atoms_protoc_plugin/metrics_atoms_protoc_plugin.py
24PROTOC_PLUGIN_BINARY ?= \
25	out/host/linux-x86/bin/trusty_metrics_atoms_protoc_plugin
26MODULE_PROTOC_PLUGIN := \
27	$(if $(wildcard $(PROTOC_PLUGIN_BINARY)),$(PROTOC_PLUGIN_BINARY),$(PROTOC_PLUGIN_SOURCE))
28
29MODULE_PROTO_PACKAGE := android/frameworks/stats
30
31MODULE_PROTOS := \
32	$(LOCAL_DIR)/$(MODULE_PROTO_PACKAGE)/atoms.proto
33
34MODULE_LIBRARY_DEPS += \
35	trusty/kernel/lib/shared/ibinder \
36	trusty/user/base/lib/stats \
37
38include make/protoc_plugin.mk
39