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
16LOCAL_PATH := $(call my-dir)
17
18ifneq ($(TARGET_SIMULATOR),true)
19
20# InvenSense fragment of the HAL
21include $(CLEAR_VARS)
22
23LOCAL_MODULE := libinvensense_hal
24
25LOCAL_MODULE_TAGS := optional
26LOCAL_MODULE_OWNER := invensense
27
28LOCAL_CFLAGS := -DLOG_TAG=\"Sensors\"
29# Comment out for ICS. Affects Android LOG macros.
30LOCAL_CFLAGS += -DANDROID_JELLYBEAN
31
32ifeq ($(ENG_BUILD),1)
33ifeq ($(COMPILE_INVENSENSE_COMPASS_CAL),1)
34LOCAL_CFLAGS += -DINVENSENSE_COMPASS_CAL
35endif
36ifeq ($(COMPILE_THIRD_PARTY_ACCEL),1)
37LOCAL_CFLAGS += -DTHIRD_PARTY_ACCEL
38endif
39ifeq ($(COMPILE_COMPASS_YAS53x),1)
40LOCAL_CFLAGS += -DCOMPASS_YAS53x
41endif
42ifeq ($(COMPILE_COMPASS_AK8975),1)
43LOCAL_CFLAGS += -DCOMPASS_AK8975
44endif
45ifeq ($(COMPILE_COMPASS_AMI306),1)
46LOCAL_CFLAGS += -DCOMPASS_AMI306
47endif
48else # release builds, default
49LOCAL_CFLAGS += -DINVENSENSE_COMPASS_CAL
50endif
51
52LOCAL_SRC_FILES := SensorBase.cpp
53LOCAL_SRC_FILES += MPLSensor.cpp
54LOCAL_SRC_FILES += MPLSupport.cpp
55LOCAL_SRC_FILES += InputEventReader.cpp
56LOCAL_SRC_FILES += CompassSensor.IIO.9150.cpp
57
58LOCAL_C_INCLUDES += $(LOCAL_PATH)
59LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mllite
60LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mllite/linux
61LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/driver/include
62LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/driver/include/linux
63
64LOCAL_SHARED_LIBRARIES := liblog
65LOCAL_SHARED_LIBRARIES += libcutils
66LOCAL_SHARED_LIBRARIES += libutils
67LOCAL_SHARED_LIBRARIES += libdl
68LOCAL_SHARED_LIBRARIES += libmllite
69
70# Additions for SysPed
71LOCAL_SHARED_LIBRARIES += libmplmpu
72LOCAL_C_INCLUDES += $(LOCAL_PATH)/software/core/mpl
73LOCAL_CPPFLAGS += -DLINUX=1
74LOCAL_PRELINK_MODULE := false
75
76include $(BUILD_SHARED_LIBRARY)
77
78include $(CLEAR_VARS)
79LOCAL_MODULE := libmplmpu
80LOCAL_SRC_FILES := libmplmpu.so
81LOCAL_MODULE_TAGS := optional
82LOCAL_MODULE_OWNER := invensense
83LOCAL_MODULE_SUFFIX := .so
84LOCAL_MODULE_CLASS := SHARED_LIBRARIES
85LOCAL_MODULE_PATH := $(TARGET_OUT)/lib
86OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)
87include $(BUILD_PREBUILT)
88
89include $(CLEAR_VARS)
90LOCAL_MODULE := libmllite
91LOCAL_SRC_FILES := libmllite.so
92LOCAL_MODULE_TAGS := optional
93LOCAL_MODULE_OWNER := invensense
94LOCAL_MODULE_SUFFIX := .so
95LOCAL_MODULE_CLASS := SHARED_LIBRARIES
96LOCAL_MODULE_PATH := $(TARGET_OUT)/lib
97OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)
98include $(BUILD_PREBUILT)
99
100endif # !TARGET_SIMULATOR
101