curlmakefilezsh

Curl command executed concurrently in makefile


I am trying to download two files, A and B, using curl in a Makefile. The download of A has to be finished to download B.

When I am executing the following command in zsh, the order is respected (B is being downloaded after A):

curl -o ./A.html https://myserv.com/script.php?file=A && \
curl -o ./B.html https://myserv.com/script.php?file=B

But when I put the same command in my Makefile, B and A are being downloaded concurrently:

all:  
    curl -o ./A.html https://myserv.com/script.php?file=A && \
    curl -o ./B.html https://myserv.com/script.php?file=B

I don't understand why? Any idea?


Solution

  • As stated by @0stone0 in the comments, quoting the path and the url solves the issue.