On Mon, Apr 30, 2012 at 3:27 PM, John Gamboa <vaultt...@gmail.com> wrote:
> obj:
>        mkdir obj
> bin:
>        mkdir bin
...
>  When I run this make file for the first time, it works perfectly: before
> creating the bin/pseh file, it calls the "bin" rule (i.e., creates the bin
> directory); and before creating the obj/foo file, it calls the "obj" rule
> (and creates the obj directory). The problem is: when I run "make -B", make
> tries to call "obj" and "bin", and mkdir returns and error, that causes
> make to stop.

Is this a trick question?  How about having the command in the rule
only create the directory if it doesn't exist?

DIRS = obj bin
$(DIRS):
        test -d $@ || mkdir $@


Philip Guenther

_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to