我正在为网站编写Makefile。
我曾称为目录src/
和build/
基本上,我想要这样的文件:
src/index.html
src/blog/title1/index.html
src/blog/title2/index.html
并将它们复制到这样的build/
目录中:
build/index.html
build/blog/title1/index.html
build/blog/title2/index.html
我尝试编写一条规则,但是我不确定如何调试此规则:
src_html := src/**/*.html
build_html := $(shell find src -name '*.html' | sed 's/src/build/')
$(src_html): $(build_html)
@cp $< $@
如果已安装,则可以使用rsync。
default:
rsync -r --include '*/' --include='*.html' --exclude='*' src/ build/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句