News for hackers. Stuff that matters.
Re:A Tutorial on Portable Makefiles (2017) by matheusmoreira on Saturday August 06, 2022 @12:06PM (#32369262)
That's awesome. I didn't know about rwildcard until now. Is it part of GMSL? I searched for rwildcard on gmsl.sourceforge.io but didn't find it.

I think my function is needlessly complicated compared to rwildcard. Here's my code:

https://github.com/matheusmoreira/liblinux/blob/modular-buil...

https://github.com/matheusmoreira/liblinux/blob/modular-buil...

The file? and directory? functions were inspired by GMSL. I think I learned how to check whether a path is a directory from one of your posts.

I wrote a general recursion function. It takes a function to apply to lists and a function to compute whether an element is a base case.

The recursive file system traversal function applies a directory globbing function to the list of paths and has file? as base case. It returns all files without filtering.

The find function recursively traverses the file system while filtering out all items not matching the given predicate function. It was my intention to provide predicates like c_file? and header_file? but I stopped developing that project before that happened. Users can easily write their own predicates too.

I think rwildcard is probably simpler and more efficient! If my code helps in any way though, feel free to use it.

There are no comments on this comment yet.