我有一个用于压缩图片的生成文件:
src=$(wildcard Photos/*.jpg) $(wildcard Photos/*.JPG)
out=$(subst Photos,Compressed,$(src))
all : $(out)
clean:
@rmdir -r Compressed
Compressed:
@mkdir Compressed
Compressed/%.jpg: Photos/%.jpg Compressed
@echo "Compressing $<"
@convert "$<" -scale 20% "$@"
Compressed/%.JPG: Photos/%.JPG Compressed
@echo "Compressing $<"
@convert "$<" -scale 20% "$@"
但是,当我的图片名称中有空格时,例如Piper PA-28-236 Dakota.JPG
,我收到此错误:
make: *** No rule to make target `Compressed/Piper', needed by `all'. Stop.
我认为这是wildcard
命令中的一个问题,但我不确定要更改什么才能使其正常工作。
如何修改我的 makefile 以允许文件名中有空格?