To reproduce:
- make src/bitcoind
- touch src/checkpoints.cpp
- make src/bitcoind # notice it doesn't rebuild anything
To reproduce:
Just that you have a hammer (woohoo! non-recursive makefiles!) doesn't mean that everything is a nail.
As this involves two files in the same directory it should be perfectly possible to get this right with the current build system.
So.. what is the way forwards with this? If I can get a better idea I can at least know where I need to extend my knowledge for helping to find a solution. If it's not non-recursive Makefiles, then what is it?
Perhaps dumb, but why isn't a simple hash of a source file used and if that differs we trigger a clean and a normal make for example?
I see I was wrong above: I didn't notice the src/ before the targets passed to make. This is building an executable in another directory.
The following make rule is triggered: https://github.com/bitcoin/bitcoin/blob/master/Makefile.am#L56
Notice that there are no dependencies specified. If the executables exist at all, make will assume rule is satisfied.
Specifying them as phony targets may be one solution here: https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html .