I want to create a Makefile
rule that runs whenever anything is changed inside a directory (which contains multiple source files in different languages, and at different subdirectory levels).
As an example, take this Makefile
:
newest: src
touch newest
with a tree like:
src/
src/a
scr/subdir/
scr/subdir/c
First time I run make
, newest
is created all right. But if I now touch src/subdir/b
, make
does nothing.
Is it possible at all to create such a rule?
I think you would need to use something like FILES := $(shell find src -type f)
and a rule of newest: $(FILES)
to get the sort of behavior you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With