At 06:44 PM 5/22/2006, Paul D. Smith wrote:
    MKDIRS += $(objdir)/moc
        ...


__dummy := $(shell for d in $(MKDIRS); do [ -d $$d ] || mkdir -p $$d; done)

or whatever.

A little off topic, but a fringe benefit of using the -p flag to mkdir is that it never complains about directories which already exist. This is even guaranteed by POSIX, which says "Each dir operand that names an existing directory shall be ignored without error" when -p is used. I often use -p to avoid the loop-and-test above, even when making single-level dirs. So the above could just be

__dummy := $(shell mkdir -p $(MKDIRS))

saving both processes and keystrokes.

-David Boyce




_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to