Home | History | Annotate | Download | only in sensorhal
      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 
     36 LOCAL_PATH := $(call my-dir)
     37 
     38 ifeq ($(TARGET_USES_NANOHUB_SENSORHAL), true)
     39 
     40 COMMON_CFLAGS := -Wall -Werror -Wextra
     41 
     42 ################################################################################
     43 
     44 include $(CLEAR_VARS)
     45 
     46 ifeq ($(NANOHUB_SENSORHAL_NAME_OVERRIDE),)
     47 ifeq ($(TARGET_DEVICE),angler_treble)
     48 LOCAL_MODULE := sensors.angler
     49 else
     50 ifeq ($(TARGET_DEVICE),bullhead_treble)
     51 LOCAL_MODULE := sensors.bullhead
     52 else
     53 LOCAL_MODULE := sensors.$(TARGET_DEVICE)
     54 endif
     55 endif
     56 else
     57 LOCAL_MODULE := $(NANOHUB_SENSORHAL_NAME_OVERRIDE)
     58 endif
     59 
     60 LOCAL_MODULE_RELATIVE_PATH := hw
     61 LOCAL_MODULE_TAGS := optional
     62 LOCAL_MODULE_OWNER := google
     63 LOCAL_PROPRIETARY_MODULE := true
     64 
     65 LOCAL_CFLAGS += $(COMMON_CFLAGS)
     66 
     67 LOCAL_C_INCLUDES += \
     68 	device/google/contexthub/firmware/os/inc \
     69 	device/google/contexthub/util/common
     70 
     71 LOCAL_SRC_FILES := \
     72 	sensors.cpp \
     73 	../../../../$(NANOHUB_SENSORHAL_SENSORLIST)
     74 
     75 LOCAL_SHARED_LIBRARIES := \
     76 	liblog \
     77 	libcutils \
     78 	libhubconnection \
     79 	libstagefright_foundation \
     80 	libutils
     81 
     82 ifeq ($(NANOHUB_SENSORHAL_DIRECT_REPORT_ENABLED), true)
     83 LOCAL_CFLAGS += -DDIRECT_REPORT_ENABLED
     84 endif
     85 
     86 ifeq ($(NANOHUB_SENSORHAL_DYNAMIC_SENSOR_EXT_ENABLED), true)
     87 LOCAL_CFLAGS += -DDYNAMIC_SENSOR_EXT_ENABLED
     88 LOCAL_SHARED_LIBRARIES += libdynamic_sensor_ext
     89 endif
     90 
     91 include $(BUILD_SHARED_LIBRARY)
     92 
     93 ################################################################################
     94 
     95 include $(CLEAR_VARS)
     96 
     97 LOCAL_MODULE := activity_recognition.$(TARGET_DEVICE)
     98 LOCAL_MODULE_RELATIVE_PATH := hw
     99 LOCAL_MODULE_TAGS := optional
    100 LOCAL_MODULE_OWNER := google
    101 LOCAL_PROPRIETARY_MODULE := true
    102 
    103 LOCAL_CFLAGS += $(COMMON_CFLAGS)
    104 
    105 LOCAL_C_INCLUDES += \
    106 	device/google/contexthub/firmware/os/inc \
    107 	device/google/contexthub/util/common
    108 
    109 LOCAL_SRC_FILES := \
    110 	activity.cpp
    111 
    112 LOCAL_SHARED_LIBRARIES := \
    113 	libcutils \
    114 	libhubconnection \
    115 	liblog \
    116 	libstagefright_foundation \
    117 	libutils
    118 
    119 include $(BUILD_SHARED_LIBRARY)
    120 
    121 ################################################################################
    122 
    123 include $(CLEAR_VARS)
    124 
    125 LOCAL_MODULE := libhubconnection
    126 LOCAL_MODULE_TAGS := optional
    127 LOCAL_MODULE_OWNER := google
    128 LOCAL_PROPRIETARY_MODULE := true
    129 
    130 LOCAL_CFLAGS += $(COMMON_CFLAGS)
    131 ifeq ($(PRODUCT_FULL_TREBLE),true)
    132 LOCAL_CFLAGS += -DUSE_SENSORSERVICE_TO_GET_FIFO
    133 endif
    134 
    135 ifeq ($(NANOHUB_SENSORHAL_LID_STATE_ENABLED), true)
    136 LOCAL_CFLAGS += -DLID_STATE_REPORTING_ENABLED
    137 endif
    138 
    139 ifeq ($(NANOHUB_SENSORHAL_USB_MAG_BIAS_ENABLED), true)
    140 LOCAL_CFLAGS += -DUSB_MAG_BIAS_REPORTING_ENABLED
    141 endif
    142 
    143 ifeq ($(NANOHUB_SENSORHAL_DOUBLE_TOUCH_ENABLED), true)
    144 LOCAL_CFLAGS += -DDOUBLE_TOUCH_ENABLED
    145 endif
    146 
    147 ifeq ($(NANOHUB_SENSORHAL_DIRECT_REPORT_ENABLED), true)
    148 LOCAL_CFLAGS += -DDIRECT_REPORT_ENABLED
    149 endif
    150 
    151 LOCAL_C_INCLUDES += \
    152     device/google/contexthub/firmware/os/inc
    153 
    154 LOCAL_SRC_FILES := \
    155     hubconnection.cpp \
    156     directchannel.cpp
    157 
    158 LOCAL_STATIC_LIBRARIES := \
    159     libhubutilcommon
    160 
    161 LOCAL_SHARED_LIBRARIES := \
    162     android.frameworks.schedulerservice (a] 1.0 \
    163     libcutils \
    164     libhardware \
    165     libhardware_legacy \
    166     libhidlbase \
    167     libhidltransport \
    168     liblog \
    169     libstagefright_foundation \
    170     libutils \
    171 
    172 include $(BUILD_SHARED_LIBRARY)
    173 
    174 ################################################################################
    175 
    176 endif
    177