3 ms·
Concerning creating directories: out/foo: > mkdir -p $(@D) > … I prefer to use this pattern, which lets you have many fewer `mkdir -p …` lines in the ma
by chrismorgan 7y ago
Concerning creating directories:
out/foo:
> mkdir -p $(@D)
> …
I prefer to use this pattern, which lets you have many fewer `mkdir -p …` lines in the make output when you use it a bunch of times:
out/foo: | out
> …
out:
> mkdir "$@"
(Here using the > recipe prefix from the article, though you won’t find me doing that in real life—I like my tabs.)
- jgrahamc 7y agoMy take on making directories: https://www.cmcrossroads.com/article/making-directories-gnu-make https://www.cmcrossroads.com/article/making-directories-gnu-...
- chrismorgan 7y agoThat looks to be a good article, explaining the reasoning behind the different alternatives. What I wrote matches your Solution 4—that pipe is indeed a subtle beast! I’ve definitely combined this with fancier patterns and second expansion as well.