1. 程式人生 > >android makefile文件批量拷貝文件的方法

android makefile文件批量拷貝文件的方法

-m 批量 mod font ring div 復制 -s packages

該方法是shell 和makefile組合使用

wallpapers := $(shell ls packages/apps/hyst_apps/NewBingoLauncher_C/default_wallpaper_config/)


PRODUCT_COPY_FILES += $(foreach wallpaper,$(wallpapers), $(if $(findstring customized_config,$(wallpaper)), \
packages/apps/hyst_apps/NewBingoLauncher_C/default_wallpaper_config/$(wallpaper):system/$(wallpaper), \
packages/apps/hyst_apps/NewBingoLauncher_C/default_wallpaper_config/$(wallpaper):system/wallpaper/$(wallpaper)))

第一句是用shell 列出目錄packages/apps/hyst_apps/NewBingoLauncher_C/default_wallpaper_config/下全部文件存放到wallpapers中

第二句是makefile foreach函數循環展開wallpapers並依據須要組合復制路徑

android makefile文件批量拷貝文件的方法