1# Use bash for additional echo fancyness 2SHELL = /bin/bash 3 4#################################################################################################### 5## defines 6 7# Build for Jellybean 8BUILD_ANDROID_JELLYBEAN = $(shell test -d $(ANDROID_ROOT)/frameworks/native && echo 1) 9 10## libraries ## 11LIB_PREFIX = lib 12 13STATIC_LIB_EXT = a 14SHARED_LIB_EXT = so 15 16# normally, overridden from outside 17# ?= assignment sets it only if not already defined 18TARGET ?= android 19 20MLLITE_LIB_NAME ?= mllite 21MPL_LIB_NAME ?= mplmpu 22 23## applications ## 24SHARED_APP_SUFFIX = -shared 25STATIC_APP_SUFFIX = -static 26 27#################################################################################################### 28## compile, includes, and linker 29 30ifeq ($(BUILD_ANDROID_JELLYBEAN),1) 31ANDROID_COMPILE = -DANDROID_JELLYBEAN=1 32endif 33 34ANDROID_LINK = -nostdlib 35ANDROID_LINK += -fpic 36ANDROID_LINK += -Wl,--gc-sections 37ANDROID_LINK += -Wl,--no-whole-archive 38ANDROID_LINK += -L$(ANDROID_ROOT)/out/target/product/$(PRODUCT)/obj/lib 39ANDROID_LINK += -L$(ANDROID_ROOT)/out/target/product/$(PRODUCT)/system/lib 40 41ANDROID_LINK_EXECUTABLE = $(ANDROID_LINK) 42ANDROID_LINK_EXECUTABLE += -Wl,-dynamic-linker,/system/bin/linker 43ifneq ($(BUILD_ANDROID_JELLYBEAN),1) 44ANDROID_LINK_EXECUTABLE += -Wl,-T,$(ANDROID_ROOT)/build/core/armelf.x 45endif 46ANDROID_LINK_EXECUTABLE += $(ANDROID_ROOT)/out/target/product/$(PRODUCT)/obj/lib/crtbegin_dynamic.o 47ANDROID_LINK_EXECUTABLE += $(ANDROID_ROOT)/out/target/product/$(PRODUCT)/obj/lib/crtend_android.o 48 49ANDROID_INCLUDES = -I$(ANDROID_ROOT)/system/core/include 50ANDROID_INCLUDES += -I$(ANDROID_ROOT)/hardware/libhardware/include 51ANDROID_INCLUDES += -I$(ANDROID_ROOT)/hardware/ril/include 52ANDROID_INCLUDES += -I$(ANDROID_ROOT)/dalvik/libnativehelper/include 53ANDROID_INCLUDES += -I$(ANDROID_ROOT)/frameworks/base/include # ICS 54ANDROID_INCLUDES += -I$(ANDROID_ROOT)/frameworks/native/include # Jellybean 55ANDROID_INCLUDES += -I$(ANDROID_ROOT)/external/skia/include 56ANDROID_INCLUDES += -I$(ANDROID_ROOT)/out/target/product/generic/obj/include 57ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libc/arch-arm/include 58ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libc/include 59ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libstdc++/include 60ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libc/kernel/common 61ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libc/kernel/arch-arm 62ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libm/include 63ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libm/include/arch/arm 64ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libthread_db/include 65ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libm/arm 66ANDROID_INCLUDES += -I$(ANDROID_ROOT)/bionic/libm 67ANDROID_INCLUDES += -I$(ANDROID_ROOT)/out/target/product/generic/obj/SHARED_LIBRARIES/libm_intermediates 68 69KERNEL_INCLUDES = -I$(KERNEL_ROOT)/include 70 71INV_INCLUDES = -I$(INV_ROOT)/software/core/driver/include 72INV_INCLUDES += -I$(MLLITE_DIR) 73INV_INCLUDES += -I$(MLLITE_DIR)/linux 74 75INV_DEFINES += -DINV_CACHE_DMP=1 76 77#################################################################################################### 78## macros 79 80ifndef echo_in_colors 81define echo_in_colors 82 echo -ne "\e[1;32m"$(1)"\e[0m" 83endef 84endif 85 86 87 88