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并根据需要组合复制路径

你可能感兴趣的:(android开发)