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