Explicitly list component-objects in the Makefile
authorLaslo Hunhold <dev@frign.de>
Sun, 27 May 2018 20:40:00 +0000 (22:40 +0200)
committerAaron Marcher <me@drkhsh.at>
Sun, 27 May 2018 20:55:15 +0000 (22:55 +0200)
commit0efd64ffaa04715eff9c834c437562952c4531cd
tree7d176d55ac59b2ad4a0c9011f75f0a806a21a86e
parent682c0fedde04fe6713539726494ec2db67ba5d2a
Explicitly list component-objects in the Makefile

There was a long tinkering process at farbfeld about this, but the sad
truth is that it's the only way to make the Makefile truly portable.
Listing it just as

   $(COM:=.o): config.mk $(REQ:=.h)

omits the dependency on the c-file itself, which incurs that strictly
speaking the object file is not depending on the source file, which is
nonsense.

You don't see strictly Posix compliant Makefiles around very often and
most use nasty GNU-extensions everywhere. It is a good idea to go ahead
as a fitting example and show how to write them portably.
Makefile