我正在计划类似的事情:
URLS=www.host.com/file1.tar.gz www.host2.com/file2.tar.gz
$(somefunc $URLS): #somefunc produces downloads/file1.tar.gz downloads/file2.tar.gz
mkdir -P downloads
wget whatever # I can't get the real url here because the targets don't contain the full url anymore
myproject: $(somefunc URLS)
#Files should already be in downloads/ here
我遇到的问题是,如果我用 somefunc 转换 URL,我会丢失 url,如果我不这样做,我就不能将它用作目标,以避免在它已经存在时被下载。
有任何想法吗?