dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Add a macro to ignore file patterns in calls to `find` in the recipies

Open peanutbutterandcrackers opened this issue 5 years ago • 0 comments

Instead of explicit -not -name "pattern1" -not -name "pattern2" -not -name "pattern3" as the $(shell find ...) calls currently stand, this change introduces a small macro findn't which will generate the -not -name "pattern" part for every pattern in the list of patterns passed to it.

make --just-print > my_changes
git checkout origin/master
make --just-print > original
diff -s original my_changes # both files are identical: i.e. this change doesn't break anything

A target-local variable find-ignore is $(eval ...)-ed in the recipe of the necessary targets that is set to a space-separated list of file patterns to ignore so as to not pollute the makefile.

Additional patterns to ignore can simply be added to the find-ignore variable, and without quotes.

P. S: If you ever get around to seeing this, then Ms. Frazelle, I greatly admire your work. And this repository has been the main influence for my own dot-files repository. Using make to mange dotfiles using symlinks is such a great idea. Thank you for making this repo public for us to see/study/learn from. You're super awesome.

peanutbutterandcrackers avatar Jul 08 '20 09:07 peanutbutterandcrackers