On Tue, 2017-05-09 at 14:06 +0200, Federico Bruni wrote:
### Makefile ###
all: doc
dependencies = $(shell find docs -type f)
doc: $(dependencies)
echo "Something has changed in the docs/ directory!"
### end ###
It looks up the files in the docs/ directory and executes the doc
target if any file is changed.
As written here, that's not what it does.
If I run 'make doc', it behaves as expected.
If I run 'make', the target is executed every time, even if no file
changed in docs/.
I can't explain the difference in behavior. In fact, the behavior of
"make" (target is executed every time) is what I expect to happen no
matter how you invoke make.
Why? Because make decides whether or not to rebuild something by
comparing _file timestamps_.
In this makefile you'll compare the timestamps of all the files under
the "docs" directory to... what?