1# Copyright (C) 2015 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# 16# Nanohub sensor HAL usage instructions: 17# 18# Add the following to your device.mk file. 19# 20# # Enable the nanohub sensor HAL 21# TARGET_USES_NANOHUB_SENSORHAL := true 22# 23# # Nanohub sensor list source file 24# NANOHUB_SENSORHAL_SENSORLIST := $(LOCAL_PATH)/sensorhal/sensorlist.cpp 25# 26# # Sensor HAL name override (optional) 27# NANOHUB_SENSORHAL_NAME_OVERRIDE := sensors.nanohub 28# 29# # Enable lid-state reporting (optional) 30# NANOHUB_SENSORHAL_LID_STATE_ENABLED := true 31# 32# # Enable mag-bias reporting (optional) 33# NANOHUB_SENSORHAL_USB_MAG_BIAS_ENABLED := true 34# 35 36LOCAL_PATH := $(call my-dir) 37 38ifeq ($(TARGET_USES_NANOHUB_SENSORHAL), true) 39 40COMMON_CFLAGS := -Wall -Werror -Wextra 41 42################################################################################ 43 44include $(CLEAR_VARS) 45 46ifeq ($(NANOHUB_SENSORHAL_NAME_OVERRIDE),) 47LOCAL_MODULE := sensors.$(TARGET_DEVICE) 48else 49LOCAL_MODULE := $(NANOHUB_SENSORHAL_NAME_OVERRIDE) 50endif 51 52LOCAL_MODULE_RELATIVE_PATH := hw 53LOCAL_MODULE_TAGS := optional 54LOCAL_MODULE_OWNER := google 55 56LOCAL_CFLAGS += $(COMMON_CFLAGS) 57 58LOCAL_C_INCLUDES += \ 59 device/google/contexthub/firmware/inc \ 60 device/google/contexthub/util/common 61 62LOCAL_SRC_FILES := \ 63 sensors.cpp \ 64 ../../../../$(NANOHUB_SENSORHAL_SENSORLIST) 65 66LOCAL_SHARED_LIBRARIES := \ 67 libcutils \ 68 libhubconnection \ 69 libstagefright_foundation \ 70 libutils 71 72include $(BUILD_SHARED_LIBRARY) 73 74################################################################################ 75 76include $(CLEAR_VARS) 77 78LOCAL_MODULE := activity_recognition.$(TARGET_DEVICE) 79LOCAL_MODULE_RELATIVE_PATH := hw 80LOCAL_MODULE_TAGS := optional 81LOCAL_MODULE_OWNER := google 82 83LOCAL_CFLAGS += $(COMMON_CFLAGS) 84 85LOCAL_C_INCLUDES += \ 86 device/google/contexthub/firmware/inc \ 87 device/google/contexthub/util/common 88 89LOCAL_SRC_FILES := \ 90 activity.cpp 91 92LOCAL_SHARED_LIBRARIES := \ 93 libcutils \ 94 libhubconnection \ 95 liblog \ 96 libstagefright_foundation \ 97 libutils 98 99include $(BUILD_SHARED_LIBRARY) 100 101################################################################################ 102 103include $(CLEAR_VARS) 104 105LOCAL_MODULE := libhubconnection 106LOCAL_MODULE_TAGS := optional 107LOCAL_MODULE_OWNER := google 108 109LOCAL_CFLAGS += $(COMMON_CFLAGS) 110 111ifeq ($(NANOHUB_SENSORHAL_LID_STATE_ENABLED), true) 112LOCAL_CFLAGS += -DLID_STATE_REPORTING_ENABLED 113endif 114 115ifeq ($(NANOHUB_SENSORHAL_USB_MAG_BIAS_ENABLED), true) 116LOCAL_CFLAGS += -DUSB_MAG_BIAS_REPORTING_ENABLED 117endif 118 119ifeq ($(NANOHUB_SENSORHAL_DOUBLE_TOUCH_ENABLED), true) 120LOCAL_CFLAGS += -DDOUBLE_TOUCH_ENABLED 121endif 122 123LOCAL_C_INCLUDES += \ 124 device/google/contexthub/firmware/inc \ 125 device/google/contexthub/util/common 126 127LOCAL_SRC_FILES := \ 128 hubconnection.cpp \ 129 ../util/common/file.cpp \ 130 ../util/common/JSONObject.cpp \ 131 ../util/common/ring.cpp 132 133LOCAL_SHARED_LIBRARIES := \ 134 libcutils \ 135 liblog \ 136 libstagefright_foundation \ 137 libutils 138 139include $(BUILD_SHARED_LIBRARY) 140 141################################################################################ 142 143endif 144