What I'd really like to do is write a rule like this: $(objdir)/%: | $(objdir) $(objdir): ; mkdir $@
The goal here is that all build output goes into a separate directory $(objdir), and so I need to have all contents of the directory dependent on the creation of that directory. I *could* bundle up all the contents of the directory and make them explictly depend on the directory. But I'd prefer something simpler and less prone to oversight. I presume the example above doesn't work because a pattern rule must be required to have % in both the target and the prerequisite. However, in my case, I want to completely drop the stem. I believe this is the case because the following simple test case doesn't work: foo/bar: ; echo bar > foo/bar foo/%: | foo foo: ; mkdir foo But the follow *does* work: foo/bar: ; echo bar > foo/bar foo/bar: | foo foo: ; mkdir foo Can anyone help? Is it possible to do what I'd like? -- Bob _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
