1 # Copyright (C) 2014 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 # Modified 2011 by InvenSense, Inc 15 16 LOCAL_PATH := $(call my-dir) 17 18 #ifneq ($(TARGET_SIMULATOR),true) 19 20 # InvenSense fragment of the HAL 21 include $(CLEAR_VARS) 22 23 LOCAL_MODULE := libinvensense_hal 24 LOCAL_MODULE_TAGS := optional 25 LOCAL_MODULE_OWNER := invensense 26 27 LOCAL_CFLAGS := -DLOG_TAG=\"Sensors\" 28 29 LOCAL_CFLAGS += -DANDROID_KITKAT 30 31 ifneq (,$(filter $(TARGET_BUILD_VARIANT),eng userdebug user)) 32 ifneq ($(COMPILE_INVENSENSE_COMPASS_CAL),0) 33 LOCAL_CFLAGS += -DINVENSENSE_COMPASS_CAL 34 endif 35 ifeq ($(COMPILE_THIRD_PARTY_ACCEL),1) 36 LOCAL_CFLAGS += -DTHIRD_PARTY_ACCEL 37 endif 38 else # release builds, default 39 LOCAL_CFLAGS += -DINVENSENSE_COMPASS_CAL 40 endif 41 42 LOCAL_SRC_FILES += SensorBase.cpp 43 LOCAL_SRC_FILES += MPLSensor.cpp 44 LOCAL_SRC_FILES += MPLSupport.cpp 45 LOCAL_SRC_FILES += InputEventReader.cpp 46 LOCAL_SRC_FILES += PressureSensor.IIO.secondary.cpp 47 48 ifneq (,$(filter $(TARGET_BUILD_VARIANT),eng userdebug user)) 49 ifeq ($(COMPILE_INVENSENSE_COMPASS_CAL),0) 50 LOCAL_SRC_FILES += AkmSensor.cpp 51 LOCAL_SRC_FILES += CompassSensor.AKM.cpp 52 else ifeq ($(COMPILE_INVENSENSE_SENSOR_ON_PRIMARY_BUS), 1) 53 LOCAL_SRC_FILES += CompassSensor.IIO.primary.cpp 54 LOCAL_CFLAGS += -DSENSOR_ON_PRIMARY_BUS 55 else 56 LOCAL_SRC_FILES += CompassSensor.IIO.9150.cpp 57 endif 58 else # release builds, default 59 LOCAL_SRC_FILES += CompassSensor.IIO.9150.cpp 60 endif # eng, userdebug & user builds 61 62 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mllite 63 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mllite/linux 64 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/driver/include 65 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/driver/include/linux 66 67 LOCAL_SHARED_LIBRARIES := liblog 68 LOCAL_SHARED_LIBRARIES += libcutils 69 LOCAL_SHARED_LIBRARIES += libutils 70 LOCAL_SHARED_LIBRARIES += libdl 71 LOCAL_SHARED_LIBRARIES += libmllite 72 73 # Additions for SysPed 74 LOCAL_SHARED_LIBRARIES += libmplmpu 75 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mpl 76 LOCAL_CPPFLAGS += -DLINUX=1 77 LOCAL_PRELINK_MODULE := false 78 79 LOCAL_SHARED_LIBRARIES += libmllite 80 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mllite 81 LOCAL_CPPFLAGS += -DLINUX=1 82 LOCAL_PRELINK_MODULE := false 83 84 include $(BUILD_SHARED_LIBRARY) 85 86 #endif # !TARGET_SIMULATOR 87 88 # Build a temporary HAL that links the InvenSense .so 89 include $(CLEAR_VARS) 90 ifeq ($(filter eng, userdebug, user, $(TARGET_BUILD_VARIANT)),) 91 ifneq ($(filter manta full_grouper tilapia, $(TARGET_PRODUCT)),) 92 LOCAL_MODULE := sensors.full_grouper 93 LOCAL_MODULE_OWNER := invensense 94 else 95 ifneq ($(filter aosp_hammerhead, $(TARGET_PRODUCT)),) 96 LOCAL_MODULE := sensors.hammerhead 97 LOCAL_MODULE_OWNER := invensense 98 endif 99 ifneq ($(filter dory guppy, $(TARGET_DEVICE)),) 100 LOCAL_MODULE := sensors.invensense 101 LOCAL_MODULE_OWNER := invensense 102 endif 103 endif 104 else # eng, user, & userdebug builds 105 LOCAL_MODULE := sensors.invensense 106 endif # eng, user & userdebug builds 107 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw 108 109 LOCAL_SHARED_LIBRARIES += libmplmpu 110 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mllite 111 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mllite/linux 112 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mpl 113 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/driver/include 114 LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/driver/include/linux 115 116 LOCAL_PRELINK_MODULE := false 117 LOCAL_MODULE_TAGS := optional 118 LOCAL_CFLAGS := -DLOG_TAG=\"Sensors\" 119 120 LOCAL_CFLAGS += -DANDROID_KITKAT 121 122 ifneq (,$(filter $(TARGET_BUILD_VARIANT),eng userdebug user)) 123 ifneq ($(COMPILE_INVENSENSE_COMPASS_CAL),0) 124 LOCAL_CFLAGS += -DINVENSENSE_COMPASS_CAL 125 endif 126 ifeq ($(COMPILE_THIRD_PARTY_ACCEL),1) 127 LOCAL_CFLAGS += -DTHIRD_PARTY_ACCEL 128 endif 129 ifeq ($(COMPILE_INVENSENSE_SENSOR_ON_PRIMARY_BUS), 1) 130 LOCAL_SRC_FILES += CompassSensor.IIO.primary.cpp 131 LOCAL_CFLAGS += -DSENSOR_ON_PRIMARY_BUS 132 else 133 LOCAL_SRC_FILES += CompassSensor.IIO.9150.cpp 134 endif 135 else # release builds, default 136 LOCAL_SRC_FILES += CompassSensor.IIO.9150.cpp 137 endif # eng, userdebug & user 138 139 ifeq (,$(filter $(TARGET_BUILD_VARIANT),eng userdebug user)) 140 ifneq ($(filter manta grouper tilapia, $(TARGET_DEVICE)),) 141 # it's already defined in some other Makefile for production builds 142 #LOCAL_SRC_FILES := sensors_mpl.cpp 143 else 144 LOCAL_SRC_FILES := sensors_mpl.cpp 145 endif 146 else # eng, userdebug & user builds 147 LOCAL_SRC_FILES := sensors_mpl.cpp 148 endif # eng, userdebug & user builds 149 150 LOCAL_SHARED_LIBRARIES := libinvensense_hal 151 LOCAL_SHARED_LIBRARIES += libcutils 152 LOCAL_SHARED_LIBRARIES += libutils 153 LOCAL_SHARED_LIBRARIES += libdl 154 LOCAL_SHARED_LIBRARIES += liblog 155 LOCAL_SHARED_LIBRARIES += libmllite 156 LOCAL_SHARED_LIBRARIES += libhardware_legacy 157 include $(BUILD_SHARED_LIBRARY) 158 159 include $(CLEAR_VARS) 160 LOCAL_MODULE := libmplmpu 161 LOCAL_SRC_FILES := libmplmpu.so 162 LOCAL_MODULE_TAGS := optional 163 LOCAL_MODULE_OWNER := invensense 164 LOCAL_MODULE_SUFFIX := .so 165 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 166 LOCAL_MODULE_PATH := $(TARGET_OUT)/lib 167 OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES) 168 LOCAL_STRIP_MODULE := true 169 include $(BUILD_PREBUILT) 170 171 include $(CLEAR_VARS) 172 LOCAL_MODULE := libmllite 173 LOCAL_SRC_FILES := libmllite.so 174 LOCAL_MODULE_TAGS := optional 175 LOCAL_MODULE_OWNER := invensense 176 LOCAL_MODULE_SUFFIX := .so 177 LOCAL_MODULE_CLASS := SHARED_LIBRARIES 178 LOCAL_MODULE_PATH := $(TARGET_OUT)/lib 179 OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES) 180 LOCAL_STRIP_MODULE := true 181 include $(BUILD_PREBUILT) 182 183