Skip to content

Instantly share code, notes, and snippets.

@wknapik
Last active July 24, 2019 20:50
Show Gist options
  • Save wknapik/94582e964321af704d30c25ccbbf7320 to your computer and use it in GitHub Desktop.
Save wknapik/94582e964321af704d30c25ccbbf7320 to your computer and use it in GitHub Desktop.
A declarative, recursive find implementation in pure make.
# Example usage: $(call find,. /foo,*.bar *.baz)
find = $(foreach path,$1,$(foreach pattern,$2,$(wildcard $(path)/$(pattern)) $(foreach dir,$(wildcard $(path)/*/),$(call find,$(dir:%/=%),$(pattern)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment