make utility

Hi,

Could someone tell me why make utility is mostly preferred for compilation and generating executable in UNIX rather than any user created scripts which contains commands for compilation?

Because make has the ability to build a dependency chain in the correct order just from being told what depends on what, even in parallel, and can avoid rebuilding things that already exist. This makes it very efficient and simple to use.

Note that I do not claim the same about autotools, just make.

In addition to what Corona688 states, make gives you the ability to build a description file and some general templates for command generation that allows you to create, build, maintain, package, distribute, and create status reports (and more) about a set of source files that have dependencies with other files, in a generic sense.

imake, cmake and others allow this type of activity on cross-platform 'builds'.

So, the question should be, why would you ever want to try to re-create these features with your custom scripts, unless of course, you fully understand what make and its brethren do and they simply don't meet your needs?