开发者

Reading Android.mk files in sub-dirs recursively

开发者 https://www.devze.com 2023-03-17 06:22 出处:网络
I would just like to ask what should be written in the Android.mk file to also call the mk files in the sub-directories of the current directory.

I would just like to ask what should be written in the Android.mk file to also call the mk files in the sub-directories of the current directory.

Example:

/packages/Android.mk

/package/groupA/Android.mk

/packages/groupA/AppA/Android.mk

/packages/groupA/AppB/Android.mk

I know that by using include $(call all-subdir-makefiles), the Android.mk file in the immediate sub-directory will be read (example: /package/groupA/Android.mk). However, /packages/groupA/AppA/Android.mk and /packages/groupA/AppB/Android.mk will not be read.

I wonder if there is other macro that do the recursive reading of the开发者_StackOverflow社区 Android.mk for all sub-directories.

Thanks,

artsylar


The most convenient solution is putting include $(call all-subdir-makefiles) command also inside /package/groupA/Android.mk file.

However, if you want only third-level mk files then you can use the following command:

include $(wildcard $(call my-dir)/*/*/Android.mk)

And here is a fully recursive solution, but it relies on find command from the shell:

include $(filter-out $(call my-dir)/Android.mk,$(shell find $(call my-dir)/ -type f -name Android.mk))
0

精彩评论

暂无评论...
验证码 换一张
取 消