我正在尝试编写一个Makefile,如果缺少某些源文件,则应下载它们。
类似如下内容:
类似如下内容:
hello: hello.c
gcc -o hello hello.c
hello.c:
wget -O hello.c http://example.org/hello.c
当然这会导致每次运行make命令时都会下载hello.c
。我希望只有在hello.c
不存在时,该Makefile才会下载hello.c
。使用GNU make是否可能实现,如果可能的话该如何实现?
hello.c:
不会被重新制作(且文件未被下载)。 第二个原因是使用-O选项时,文件的时间戳始终与下载时间重合。 - P Shved