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