Makefile 实现工程的本地部署

DEPLOY_PATH?=$(deploy_path)/output
GITIGNORE_RSC=$(shell [ -f .gitignore ] && sed ':a;N;s/\n/|/;ta' .gitignore)
DEPLOY_RSC=$(shell ls | sed 's/ /\n/g' | grep -vE "$(GITIGNORE_RSC)")git

deploy:
    install -d $(DEPLOY_PATH)
    for FN in $(DEPLOY_RSC);do cp -r $$FN $(DEPLOY_PATH);doneshell

说明:该伪目标实现的是将工程中除了 .gitignore 文件中指定的忽略的文件或目录,复制到部署目录。ui

.gitignore 文件内容为部署

Debugit

*.osed

*.sobug

outputgrep

.libs
文件

部署:make

make deploy DEPLOY_PATH=$suit_yourself_path

相关文章
相关标签/搜索