Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between semicolon and double ampersand in makefile

Tags:

makefile

I have a question about makefile (not talking about Linux shell or bash here). What is the difference between semicolon and double ampersand in a make file?

On the first computer, the following works:

cd code; ant clean compile jar run

On the second computer, the above doesn't work while the below works:

cd code && ant clean compile jar run

The above code is inside the file called "makefile". I want to know the difference between '&&' and ';'.

Thanks

Note: My error message for semicolon on second computer is

cd code; ant clean compile jar run
The system cannot find the path specified.
make: *** [runant] Error 1
like image 409
Henry Avatar asked Oct 15 '25 20:10

Henry


1 Answers

see https://serverfault.com/a/373053/85018 for a good explanation:

The ; just separates one command from another. The && says only run the following command if the previous was successful

like image 127
arved Avatar answered Oct 18 '25 23:10

arved



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!