make update makefile

I have a big misunderstanding about make. I thought if I run “make” or “make -f Makefile”, make will check the first target in the makefile and possibly update targets in the dependency chain of the first target. But today, when I ran the make command, I found a missing file was always generated despite the fact that it is not in the dependency chain of the first target, why?

I use the command “mingw32-make –debug” to debug the makefile. I find the following messages when make begins to run:

Reading makefiles…
Updating makefiles….

It indicates make may update the makefile before updating the first target. In fact, if your makefile contains a Makefile target(even not the first target), make will check the dependency chain for the Makefile target to possibly update Makefile. Only after the Makefile is updated does make check the first target. The missing file is in the dependency chain of the Makefile so it gets auto generated every time I run make.

 

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply