Note: The Lib library can only be placed where kernel is compiled, as follows:
alps/kernel/
alps/mediatek/custom/common/kernel/
alps/mediatek/custom/$platform/kernel/
alps/mediatek/custom/$proj/kernel/
alps/mediatek/kernel/
alps/mediatek/platform/$platform/kernel/core/
alps/mediatek/platform/$platform/kernel/drivers/
Assume that the 3rd party library name is TEST.A
(1). If the stored directory exists makefile, simply add it at the end of the makefile:
Obj-y + = Test.a
Then copy the Test.a file to the directory,
Renamed to Test.a_shipped to prevent the clean kernel stage from removing the library!
Recompile kernel.
(2). If the stored directory does not exist makefile, such as in the alps/mediatek/custom/directory kernel directory is not makefile, then you need to add a makefile, the content and the 1th method is similar:
Obj-y: = XXX.O yyy.o test.a
The above means compiling xxx.c/yyy.c and test.a to kernel
Then copy the Test.a file to the directory and rename it to test.a_shipped
Recompile kernel.
Note: Files in the alps/mediatek/custom/common/kernel/touchpanel/xxx directory and alps/mediatek/custom/common/kernel/touchpanel/ src directory Merge, obj-y to add all of the two directories of obj to the line, or the compilation fails. You can also use the following makefile, automatically add all obj Obj-y, save trouble. Other directories are treated as if they were in a similar situation.
Add makefile (change all *.c to *.O and join Obj-y):
Include $ (mtk_path_build)/common.mk
Path: = $ (if $ (filter yes,$ (Kbuild_output_support)), $ (srctree)/$ (obj), $ (obj))
Obj-y: = $ (Patsubst%.c,%.o,$ (subst $ (path)/,,$ (call wildcard2,$ (path)/*.c))
Obj-y + = Test.a
Description: For kernel makefile Write rule description, can go to the network search related material reference, such as obj-y means to compile to kernel, and obj-m to compile to module,obj-n or obj-means not to compile
How Android adds 3rd party Lib libraries to kernel