Skip to content
Advertisement

If not exists, create a folder – Error in makefile

I searched over the internet for a command to create a folder if it doesn’t exist. I found it and put in my makefile

JavaScript

When the folder doesn’t exist it’s created correctly. But I get an error if the folder already exists.

JavaScript

I don’t get why the command would give an error if the condition [ ! -d "myfolder" ] is before the mkdir and it shouldn’t even execute the second command.

How can I solve it?

Advertisement

Answer

this is what make is for.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement