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

该方法是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并依据须要组合复制路径

上一篇:css 初始化


下一篇:suse安装svn服务端和客户端的使用