From: Pengguang Zhu Date: Fri, 27 Nov 2020 03:02:01 +0000 (+0800) Subject: optee_driver: support standalone build for R [5/6] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1cdb9077ce78a7bcfd164b24a19e409ff8ee5c84;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_optee.git optee_driver: support standalone build for R [5/6] PD#SWPL-36509 Problem: need to support modules standalone build Solution: support modules standalone build Verify: Android Q/R + AH212 Change-Id: I37217f5c83cf88409443cbbb36c6e0dba7a957e5 Signed-off-by: Pengguang Zhu --- diff --git a/Makefile b/Makefile index 304db42..548e54c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,4 @@ ccflags-y+=-Werror -ccflags-y+=-I$(M)/include/linux -ccflags-y+=-I$(M)/include -ccflags-y+=-I$(M) obj-m += optee.o obj-y += optee/ @@ -9,3 +6,24 @@ obj-y += optee/ optee-objs := tee_core.o \ tee_shm.o \ tee_shm_pool.o + +LOCAL_INCLUDES += -I$(KERNEL_SRC)/$(M)/include \ + -I$(KERNEL_SRC)/$(M)/include/linux + +ccflags-y+=$(LOCAL_INCLUDES) +EXTRA_CFLAGS += $(LOCAL_INCLUDES) + +$(warning EXTRAL_FLAGS=$(EXTRAL_FLAGS)) +all: + @$(MAKE) -C $(KERNEL_SRC) M=$(M) modules + #@$(MAKE) -C $(KERNEL_SRC) M=$(M)/optee --trace modules + +modules_install: + @echo "$(MAKE) INSTALL_MOD_STRIP=1 M=$(M) -C $(KERNEL_SRC) modules_install" + @$(MAKE) INSTALL_MOD_STRIP=1 M=$(M) -C $(KERNEL_SRC) modules_install + mkdir -p ${OUT_DIR}/../vendor_lib + cd ${OUT_DIR}/$(M)/; find -name "*.ko" -exec cp {} ${OUT_DIR}/../vendor_lib/ \; + + +clean: + $(MAKE) -C $(KERNEL_SRC) M=$(M) clean diff --git a/optee/Makefile b/optee/Makefile index c563dfa..12f9445 100644 --- a/optee/Makefile +++ b/optee/Makefile @@ -1,6 +1,10 @@ +LOCAL_INCLUDES += -I$(KERNEL_SRC)/$(M)/../include \ + -I$(KERNEL_SRC)/$(M)/../include/linux \ + -I$(KERNEL_SRC)/$(M)/include \ + -I$(KERNEL_SRC)/$(M)/include/linux + ccflags-y+=-Werror -ccflags-y+=-I$(M)/include/linux -ccflags-y+=-I$(M)/include +ccflags-y+=$(LOCAL_INCLUDES) obj-m += optee_armtz.o