code generation - How to write a Makefile rule to download a file only if it is missing? -


I am trying to write a makefile which should be downloaded to some source, if and only if they are missing.

Something like this:

  Hello: Hello. Hello GCC-O Hello. Hello.c: wget -O hello.c http://example.org/hello.c  

but for this reason, hello.c The bar is run to run the command. I would like to do this to download only Hello C to be downloaded by the makefile. Is it possible to create a GNU and how to do it?

My guess is that wget does not update the timestamp on Hello.c, but retains the remote timestamp is. This causes the build to assume hello.c is outdated and tries to download it again.

  hello.c: wget ... touch $ @  

edit: wget to download wget to -n option remotes anything by wget The file will stop (but it will still check the timestamp of the remote file.)


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -