1 LOCAL_PATH := $(call my-dir) 2 3 ifneq ($(BOARD_USES_GENERIC_INVENSENSE),false) 4 5 include $(CLEAR_VARS) 6 LOCAL_MODULE_TAGS := optional 7 8 LOCAL_MODULE := libmlplatform 9 #modify these to point to the mpl source installation 10 MLSDK_ROOT = . 11 MLPLATFORM_DIR = $(MLSDK_ROOT)/platform/linux 12 13 LOCAL_CFLAGS += -D_REENTRANT -DLINUX -DANDROID 14 LOCAL_CFLAGS += -DCONFIG_MPU_SENSORS_MPU3050 15 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MLSDK_ROOT)/platform/include 16 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MLSDK_ROOT)/platform/include/linux 17 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MLPLATFORM_DIR) 18 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MLPLATFORM_DIR)/kernel 19 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MLSDK_ROOT)/mllite 20 21 ML_SOURCES := \ 22 $(MLPLATFORM_DIR)/mlos_linux.c \ 23 $(MLPLATFORM_DIR)/mlsl_linux_mpu.c 24 25 LOCAL_SRC_FILES := $(ML_SOURCES) 26 27 LOCAL_SHARED_LIBRARIES := liblog libm libutils libcutils 28 LOCAL_PRELINK_MODULE := false 29 include $(BUILD_SHARED_LIBRARY) 30 31 include $(CLEAR_VARS) 32 LOCAL_MODULE := libmllite 33 LOCAL_MODULE_TAGS := optional 34 #modify these to point to the mpl source installation 35 MLSDK_ROOT = . 36 MLPLATFORM_DIR = $(MLSDK_ROOT)/platform 37 MLLITE_DIR = $(MLSDK_ROOT)/mllite 38 MPL_DIR = $(MLSDK_ROOT)/mldmp 39 40 LOCAL_CFLAGS += -DNDEBUG 41 LOCAL_CFLAGS += -D_REENTRANT -DLINUX -DANDROID 42 LOCAL_CFLAGS += -DCONFIG_MPU_SENSORS_MPU3050 43 LOCAL_CFLAGS += -DUNICODE -D_UNICODE -DSK_RELEASE 44 LOCAL_CFLAGS += -DI2CDEV=\"/dev/mpu\" 45 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MPL_DIR) -I$(LOCAL_PATH)/$(MLLITE_DIR) -I$(LOCAL_PATH)/$(MLPLATFORM_DIR)/include 46 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MLSDK_ROOT)/mlutils -I$(LOCAL_PATH)/$(MLSDK_ROOT)/mlapps/common 47 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MLSDK_ROOT)/platform/include/linux 48 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MLSDK_ROOT)/mllite/akmd 49 LOCAL_CFLAGS += -I$(LOCAL_PATH)/$(MLPLATFORM_DIR)/linux 50 51 # optionally apply the compass filter. this is set in 52 # BoardConfig.mk 53 ifeq ($(BOARD_INVENSENSE_APPLY_COMPASS_NOISE_FILTER),true) 54 LOCAL_CFLAGS += -DAPPLY_COMPASS_FILTER 55 endif 56 57 ML_SOURCES = \ 58 $(MLLITE_DIR)/accel.c \ 59 $(MLLITE_DIR)/compass.c \ 60 $(MLLITE_DIR)/pressure.c \ 61 $(MLLITE_DIR)/mldl_cfg_mpu.c \ 62 $(MLLITE_DIR)/dmpDefault.c \ 63 $(MLLITE_DIR)/ml.c \ 64 $(MLLITE_DIR)/mlarray.c \ 65 $(MLLITE_DIR)/mlarray_legacy.c \ 66 $(MLLITE_DIR)/mlFIFO.c \ 67 $(MLLITE_DIR)/mlFIFOHW.c \ 68 $(MLLITE_DIR)/mlMathFunc.c \ 69 $(MLLITE_DIR)/ml_stored_data.c \ 70 $(MLLITE_DIR)/mlcontrol.c \ 71 $(MLLITE_DIR)/mldl.c \ 72 $(MLLITE_DIR)/mldmp.c \ 73 $(MLLITE_DIR)/mlstates.c \ 74 $(MLLITE_DIR)/mlsupervisor.c \ 75 $(MLLITE_DIR)/mlBiasNoMotion.c \ 76 $(MLLITE_DIR)/mlSetGyroBias.c \ 77 \ 78 $(MLLITE_DIR)/ml_mputest.c \ 79 $(MLSDK_ROOT)/mlutils/mputest.c \ 80 $(MLSDK_ROOT)/mlutils/checksum.c 81 82 83 ifeq ($(HARDWARE),M_HW) 84 ML_SOURCES += $(MLLITE_DIR)/accel/mantis.c 85 endif 86 87 LOCAL_SRC_FILES := $(ML_SOURCES) 88 LOCAL_SHARED_LIBRARIES := libm libutils libcutils liblog libmlplatform 89 LOCAL_PRELINK_MODULE := false 90 include $(BUILD_SHARED_LIBRARY) 91 92 #This makes an .so from our .a 93 #include $(CLEAR_VARS) 94 #LOCAL_MODULE := libmpl 95 #LOCAL_MODULE_TAGS := optional 96 #LOCAL_SRC_FILES := mlsdk/mldmp/mpl/android/libmpl.a 97 #LOCAL_SHARED_LIBRARIES := libm libutils libcutils liblog libmlplatform libmllite 98 #LOCAL_WHOLE_STATIC_LIBRARIES := libmpl 99 #LOCAL_PREBUILT_LIBS := mlsdk/mldmp/mpl/android/libmpl.a 100 #LOCAL_PRELINK_MODULE := false 101 #include $(BUILD_SHARED_LIBRARY) 102 #include $(BUILD_MULTI_PREBUILT) 103 104 endif 105