optee_driver: support standalone build for R [5/6]
authorPengguang Zhu <pengguang.zhu@amlogic.com>
Fri, 27 Nov 2020 03:02:01 +0000 (11:02 +0800)
committerPengguang Zhu <pengguang.zhu@amlogic.com>
Tue, 1 Dec 2020 06:26:38 +0000 (14:26 +0800)
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 <pengguang.zhu@amlogic.com>
Makefile
optee/Makefile

index 304db428d859e40d5fb446ee0c31cc822c647c1a..548e54c47708a9bbca3dbcb3fce9686016aefa5d 100644 (file)
--- 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
index c563dfafa05d6697b687bc81c7163df8afb5efd8..12f9445cff113f3bdabe7c54a72dd92bb6871186 100644 (file)
@@ -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