Reading Android.mk files in sub-dir recursively

I just would like to ask what should be written in the Android.mk file in order to also call the mk files in subdirectories 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 using include $(call all-subdir-makefiles) , the Android.mk file in the immediate subdirectory 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 another macro that does recursive reading of Android.mk for all subdirectories.

Thanks,
artsylar

+7
source share
1 answer

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

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

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

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

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

All Articles