Note that you can also use the $(shell find) for dependencies without a variable:
resources.h: $(shell find . -name 'resource*.png') ./update.py $^
So this is similar to @MadScientist's answer, but you get a list of dependencies in the $^ automatic variable. (In this case, update.py is not so easy to include depending).
What makes this powerful is that you can use templates with it, for example, if you need to compile multiple destination files ( resourcesN.h ) from several corresponding directories ( resourcesN/ ):
targets: resources1.h resources2.h %.h: $(shell find $*/ -name 'resource*.png') ./update.py $^
Here $* gets the values โโof resources1 and resources2 , and then $^ contains a list of dependencies found in the corresponding directory.
source share