Skip to content

Instantly share code, notes, and snippets.

@darkdukey
Last active December 10, 2022 14:31
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save darkdukey/9402013c953ff57c73ba to your computer and use it in GitHub Desktop.
Save darkdukey/9402013c953ff57c73ba to your computer and use it in GitHub Desktop.
NDK build include all the files under a directory
#traverse all the directory and subdirectory
define walk
$(wildcard $(1)) $(foreach e, $(wildcard $(1)/*), $(call walk, $(e)))
endef
#find all the file recursively under jni/
ALLFILES = $(call walk, $(LOCAL_PATH))
FILE_LIST := $(filter %.cpp, $(ALLFILES))
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
@MoVoDesign
Copy link

Awesome little piece of code... Saved me from having to concatenate 95 .cpp files!
THANKS!

@vovan4ik123
Copy link

Awesome little piece of code... Saved me from having to concatenate 95 .cpp files!
THANKS!

you can use: folder_name/*.cpp for include all .......cpp files in folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment