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 LOCAL_MODULE := sensors.$(TARGET_DEVICE)
     48 else
     49 LOCAL_MODULE := $(NANOHUB_SENSORHAL_NAME_OVERRIDE)
     50 endif
     51 
     52 LOCAL_MODULE_RELATIVE_PATH := hw
     53 LOCAL_MODULE_TAGS := optional
     54 LOCAL_MODULE_OWNER := google
     55 
     56 LOCAL_CFLAGS += $(COMMON_CFLAGS)
     57 
     58 LOCAL_C_INCLUDES += \
     59 	device/google/contexthub/firmware/inc \
     60 	device/google/contexthub/util/common
     61 
     62 LOCAL_SRC_FILES := \
     63 	sensors.cpp \
     64 	../../../../$(NANOHUB_SENSORHAL_SENSORLIST)
     65 
     66 LOCAL_SHARED_LIBRARIES := \
     67 	libcutils \
     68 	libhubconnection \
     69 	libstagefright_foundation \
     70 	libutils
     71 
     72 include $(BUILD_SHARED_LIBRARY)
     73 
     74 ################################################################################
     75 
     76 include $(CLEAR_VARS)
     77 
     78 LOCAL_MODULE := activity_recognition.$(TARGET_DEVICE)
     79 LOCAL_MODULE_RELATIVE_PATH := hw
     80 LOCAL_MODULE_TAGS := optional
     81 LOCAL_MODULE_OWNER := google
     82 
     83 LOCAL_CFLAGS += $(COMMON_CFLAGS)
     84 
     85 LOCAL_C_INCLUDES += \
     86 	device/google/contexthub/firmware/inc \
     87 	device/google/contexthub/util/common
     88 
     89 LOCAL_SRC_FILES := \
     90 	activity.cpp
     91 
     92 LOCAL_SHARED_LIBRARIES := \
     93 	libcutils \
     94 	libhubconnection \
     95 	liblog \
     96 	libstagefright_foundation \
     97 	libutils
     98 
     99 include $(BUILD_SHARED_LIBRARY)
    100 
    101 ################################################################################
    102 
    103 include $(CLEAR_VARS)
    104 
    105 LOCAL_MODULE := libhubconnection
    106 LOCAL_MODULE_TAGS := optional
    107 LOCAL_MODULE_OWNER := google
    108 
    109 LOCAL_CFLAGS += $(COMMON_CFLAGS)
    110 
    111 ifeq ($(NANOHUB_SENSORHAL_LID_STATE_ENABLED), true)
    112 LOCAL_CFLAGS += -DLID_STATE_REPORTING_ENABLED
    113 endif
    114 
    115 ifeq ($(NANOHUB_SENSORHAL_USB_MAG_BIAS_ENABLED), true)
    116 LOCAL_CFLAGS += -DUSB_MAG_BIAS_REPORTING_ENABLED
    117 endif
    118 
    119 LOCAL_C_INCLUDES += \
    120 	device/google/contexthub/firmware/inc \
    121 	device/google/contexthub/util/common
    122 
    123 LOCAL_SRC_FILES := \
    124 	hubconnection.cpp \
    125 	../util/common/file.cpp \
    126 	../util/common/JSONObject.cpp \
    127 	../util/common/ring.cpp
    128 
    129 LOCAL_SHARED_LIBRARIES := \
    130 	libcutils \
    131 	liblog \
    132 	libstagefright_foundation \
    133 	libutils
    134 
    135 include $(BUILD_SHARED_LIBRARY)
    136 
    137 ################################################################################
    138 
    139 endif
    140