0

We can do call all-subdir-java-files in a Android.mk file to link all java files recursively. How can we link all c and c++ files using similar way like call all-subdir-cc-files? Can I define a function all-subdir-cc-files on my own and call it in Android.mk files?

dove9
  • 3
  • 3

1 Answers1

0

Yes, you can add your functions to Android.mk. It's a makefile, nothing more. You should only remember that Android.mk may be included more than once, of you build for different ABIs.

A example of a function that returns a list of files under given directory can be found here.

As for the all-subdir-java-files, note that it belongs to AOSP build engine, not to NDK.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • Thanks for your reply! I need to traverse all the sub-directories and get all .c and .cpp files. How can I do it? – dove9 Nov 14 '18 at 08:33
  • See https://stackoverflow.com/questions/2483182/recursive-wildcards-in-gnu-make/18258352#18258352 – Alex Cohn Nov 14 '18 at 09:55