1# Copyright (C) 2017 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
15LOCAL_PATH := $(call my-dir)
16COMMON_CFLAGS := -Wall -Werror -Wextra
17
18hidparser_src := \
19    HidGlobal.cpp \
20    HidItem.cpp \
21    HidLocal.cpp \
22    HidParser.cpp \
23    HidReport.cpp \
24    HidTree.cpp
25
26include $(CLEAR_VARS)
27LOCAL_MODULE := libhidparser
28LOCAL_MODULE_TAGS := optional
29# indended to be used by hal components, thus propietary
30LOCAL_PROPRIETARY_MODULE := true
31
32LOCAL_CFLAGS += $(COMMON_CFLAGS) -DLOG_TAG=\"HidUtil\"
33LOCAL_SRC_FILES := $(hidparser_src)
34LOCAL_SHARED_LIBRARIES := libbase
35LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
36include $(BUILD_SHARED_LIBRARY)
37
38#
39# host side shared library (for host test, example, etc)
40#
41include $(CLEAR_VARS)
42LOCAL_MODULE := libhidparser_host
43LOCAL_MODULE_TAGS := optional
44
45LOCAL_CFLAGS += $(COMMON_CFLAGS)
46
47LOCAL_SRC_FILES := $(hidparser_src)
48
49LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
50include $(BUILD_HOST_SHARED_LIBRARY)
51
52#
53# Example of HidParser
54#
55include $(CLEAR_VARS)
56LOCAL_MODULE := hidparser_example
57LOCAL_MODULE_TAGS := optional
58
59LOCAL_CFLAGS += $(COMMON_CFLAGS)
60LOCAL_SRC_FILES := \
61    $(hidparser_src) \
62    test/HidParserExample.cpp \
63    test/TestHidDescriptor.cpp
64
65LOCAL_C_INCLUDES += $(LOCAL_PATH)/test
66include $(BUILD_HOST_EXECUTABLE)
67
68#
69# Another example of HidParser
70#
71include $(CLEAR_VARS)
72LOCAL_MODULE := hidparser_example2
73LOCAL_MODULE_TAGS := optional
74
75LOCAL_CFLAGS += $(COMMON_CFLAGS)
76LOCAL_SRC_FILES := \
77    $(hidparser_src) \
78    test/HidParserExample2.cpp \
79    test/TestHidDescriptor.cpp
80
81LOCAL_C_INCLUDES += $(LOCAL_PATH)/test
82include $(BUILD_HOST_EXECUTABLE)
83
84#
85# Test for TriState template
86#
87include $(CLEAR_VARS)
88LOCAL_MODULE := tristate_test
89LOCAL_MODULE_TAGS := optional
90
91LOCAL_CFLAGS += $(COMMON_CFLAGS)
92LOCAL_SRC_FILES := test/TriStateTest.cpp
93
94LOCAL_STATIC_LIBRARIES := \
95     libgtest \
96     libgtest_main
97
98LOCAL_C_INCLUDES += $(LOCAL_PATH)/test
99include $(BUILD_HOST_NATIVE_TEST)
100