Issue
I need to copy a directory tree with XML files recursively to the out directory using Android.mk file
The directory structure is like this: parent directory has three sub-directories each with an XML file. The parent directory also includes an Android.mk file.
The Android.mk file in parent has the following rules:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := file.xml
LOCAL_MODULE_TAGS := optional debug
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
LOCAL_SRC_FILES := file.xml
include $(BUILD_PREBUILT)
I need to define LOCAL_SRC_FILES and LOCAL_MODULE_PATH as the source and target directories.
Could someone please let me know how to do it?
Solution
Basically the issue here is the "LOCAL_MODULE" needs to be defined for each file in this case. And it needs to be unique. If we try to have the same name for all three subdirectories, make fails with an 'already defined' error.
As a workaround, I defined LOCAL_MODULE for each of the three files with unique filenames. I don't think there is any other option of resolving this.
As an aside, I ought to mention that it is possible to copy files by running cp command directly from make. Please see Copy multiple txt files in /system using Android.mk
However, please note that running shell commands directly from within Android.mk files is deprecated starting from Android N.
Answered By - user2970477
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.