2014-10-10 15:42:33 -06:00
|
|
|
.PHONY: build-greybus
|
|
|
|
|
|
|
|
$(PRODUCT_OUT)/ramdisk.img: build-greybus
|
|
|
|
|
2015-01-22 17:22:20 -07:00
|
|
|
GREYBUS_MODULE_OUT_PATH := $(PRODUCT_OUT)/root/lib/modules
|
|
|
|
|
2014-10-10 15:42:33 -06:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
GREYBUS_SRC_PATH := $(ANDROID_BUILD_TOP)/external/greybus/
|
|
|
|
LOCAL_PATH := $(GREYBUS_SRC_PATH)
|
|
|
|
LOCAL_SRC_FILES := greybus.ko
|
|
|
|
LOCAL_MODULE := $(LOCAL_SRC_FILES)
|
|
|
|
LOCAL_MODULE_CLASS := EXECUTABLES
|
2015-01-22 17:22:20 -07:00
|
|
|
LOCAL_MODULE_PATH := $(GREYBUS_MODULE_OUT_PATH)
|
2014-10-10 15:42:33 -06:00
|
|
|
$(LOCAL_PATH)/$(LOCAL_SRC_FILES): build-greybus
|
|
|
|
include $(BUILD_PREBUILT)
|
|
|
|
|
|
|
|
KDIRARG := KERNELDIR="${ANDROID_PRODUCT_OUT}/obj/kernel"
|
|
|
|
ifneq ($(ANDROID_64),)
|
|
|
|
ARCHARG := ARCH=arm64
|
|
|
|
FLAGARG := EXTRA_CFLAGS+=-fno-pic
|
|
|
|
else
|
|
|
|
ARCHARG := ARCH=arm
|
2014-10-30 16:28:18 -06:00
|
|
|
FLAGARG := EXTRA_CFLAGS+=-fno-pic
|
2014-10-10 15:42:33 -06:00
|
|
|
endif
|
|
|
|
ARGS := $(KDIRARG) $(ARCHARG) $(FLAGARG)
|
|
|
|
|
|
|
|
build-greybus: android_kernel
|
|
|
|
make clean -C $(GREYBUS_SRC_PATH)
|
|
|
|
cd $(GREYBUS_SRC_PATH) &&\
|
|
|
|
$(MAKE) -j$(MAKE_JOBS) CROSS_COMPILE=$(KERNEL_TOOLS_PREFIX) $(ARGS)
|
2015-01-22 17:22:20 -07:00
|
|
|
mkdir -p $(GREYBUS_MODULE_OUT_PATH)
|
2015-01-27 13:14:09 -07:00
|
|
|
ko=`find $(GREYBUS_SRC_PATH) -type f -name "*.ko"`;\
|
2015-01-22 17:22:47 -07:00
|
|
|
for i in $$ko; do $(KERNEL_TOOLCHAIN_PATH)strip --strip-unneeded $$i;\
|
|
|
|
mv $$i $(GREYBUS_MODULE_OUT_PATH)/; done;
|