One of the most under-documented
areas of Android at present is its makefile. There is of course a ton of those for reference under Android source tree, but they aren't really 'documentation'.
THIS is the only one I found that is reasonably adequate. The other day I was trying to find a way to copy an xml file into the image's /system/etc/permissions folder through Android.mk. Upon googling, I realized that many people were looking for ways to run shell commands through the makefile so that they can run copy commands. I was pretty sure that there had to be a better way, just not documented. And then I found it. The template to copy a file is this:
include $(CLEAR_VARS)
LOCAL_MODULE := my_data_file.cfg
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := /path/to/the/destination/folder
LOCAL_SRC_FILES := sources_files_to_copy
include $(BUILD_PREBUILT)
So if you want to copy an xml file to the permissions folder, you could do this:
include $(CLEAR_VARS)
LOCAL_MODULE := mydata.xml
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
# Copies mydata.xml to /system/etc/permissions
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)
The above example is from one of Android's makefiles (location service) found here. You should be able to use the above snippet and make it copy any file to any folder.