Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading Android.mk files in sub-dirs recursively

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 Android.mk for all sub-directories.

Thanks,
artsylar

like image 953
artsylar Avatar asked Jul 04 '11 07:07

artsylar


1 Answers

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))
like image 113
Andrey Kamaev Avatar answered Nov 03 '22 09:11

Andrey Kamaev