Thread (3 messages) 3 messages, 3 authors, 2021-10-28

Re: [PATCH] Documentation/Makefile: fix lint-docs mkdir dependency

From: Jeff King <hidden>
Date: 2021-10-28 17:06:19

Possibly related (same subject, not in this thread)

On Thu, Oct 28, 2021 at 09:45:14AM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
There's an in-between, I'd think, where the many "foo/bar/baz/$@"
targets have an order-dependency on "foo/bar/baz", and that single rule
uses "mkdir -p" to create all of the directories.

It doesn't buy us much simplification in this case, though, because
various rules independently depend on .build/gitlink/lint-docs/howto,
.built/gitlink/lint-docs, and .build/gitlink, etc. So we still end up
with roughly the same number of rules, though the directory rules don't
have to depend on one another.

It also means that these "mkdir -p" may race with each other, though in
general I'd hope that most "mkdir" implements could handle this.

Something like this works, I think:
Hmph, what I actually meant was to make sure that the recipe to
create the files to have "mkdir -p $(basename $@)" in front, instead
of having "we need to prepare the containing directory in order to
have a file there" in the makefile.
Yeah, I agree that's simpler, and is what Ævar showed. But it is slower,
because we run a bunch of redundant "mkdir -p" calls, one per file.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help