3 ms·
Fun. The rwildcard function here rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $2,$d)) is very similar to one I wrote in 2011
by jgrahamc 6y ago
Fun. The rwildcard function here
rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $2,$d))
is very similar to one I wrote in 2011 (https://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-function.html https://blog.jgc.org/2011/07/gnu-make-recursive-wildcard-fun...):
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
The only difference is that I wanted to be able to use * in the pattern rather than % (hence the subst).
$(call rwildcard,,*.c)
vs.
$(call rwildcard,,%.c)
- chrismorgan 6y agoI believe it is a direct descendant of yours, which I’ve used from time to time over the years. I just didn’t feel the need to support *, % was enough for me. Thanks for all the stuff you’ve written about Make: I’ve enjoyed reading quite a lot of it!
- jgrahamc 6y agoGlad these things help people. The * for wildcard was a bit of syntatic sugar to make $(call rwildcard) closer to $(wildcard). For those who don't know, here's a list of stuff I've written over the years. https://blog.jgc.org/2013/02/updated-list-of-my-gnu-make-articles.html https://blog.jgc.org/2013/02/updated-list-of-my-gnu-make-art... And the hard copy version: https://nostarch.com/gnumake https://nostarch.com/gnumake PS I really like the layout of your blog.
- peterwwillis 6y agoI appreciate these posts for "I just need to do X..." google-search-for-my-fix problems. But I've always found it frustrating that this is what the whole www is now: a whole lot of spread out individual docs for individual problems, rather than a concise review of useful information (a "just the useful bits" database if you will). Try to learn anything in depth these days and either you're deciphering a dense yet incomplete manual, or googling until eternity. Make is a great example, as even though they have a useful manual, good luck figuring out how to apply it to your problem. Wikis don't quite cut it either. We need a different data model for knowledge sharing.
- jgrahamc 6y agoOK, but I wrote those things as "advanced" uses of make because the actual GNU Make Manual is very, very good (https://www.gnu.org/software/make/manual/ https://www.gnu.org/software/make/manual/) and people should read it. I keep wondering about doing a video series explaining GNU Make from the ground up.