<p>I need to generate a directory in my makefile and I would like to not get the "directory already exists error" over and over even though I can easily ignore it.</p>

<p>I mainly use mingw/msys but would like something that works across other shells/systems  too.</p>

<p>I tried this but it didn't work, any ideas?</p>

<pre><code>ifeq (,$(findstring $(OBJDIR),$(wildcard $(OBJDIR) )))
-mkdir $(OBJDIR)
endif
</code></pre>

If having the directory already exist is not a problem for you, you could just redirect stderr for that command, getting rid of the error message:
```
```
-mkdir $(OBJDIR) 2>/dev/null
```
```