I want to know why makefiles in Linux are so useful (I mean in the practical sense). Why can't we just compile all our programs in the normal way?
I want to know why makefiles in Linux are so useful (I mean in the practical sense). Why can't we just compile all our programs in the normal way?
Also because make is 2 pass where relative order of directives does not matter.
In the normal way, dependencies must be taken care manually and we should always remember the order in which each line is executed before making any changes. Contrast this with, say, CFLAGS being added to all makefiles at the end using a script. You do not need to worry about the relative order of SOURCES and CFLAGS.