Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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-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)


I 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!


Glad 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-art...

And the hard copy version: https://nostarch.com/gnumake

PS I really like the layout of your blog.


I 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.


OK, 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/) and people should read it.

I keep wondering about doing a video series explaining GNU Make from the ground up.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: