Make is a build tool. Let me give you some examples of where it might be used:
• If you're making an executable program, there is often a quite complex series of instructions to follow to convert your source files into the final executable file (your ultimate target).
• Similarly, if you're installing software from a distribution there is often a complex series of steps to move from that distribution to a fully installed and deployed installation.
• Another task which is similarly structured is the production of a test report from a series of test, which run on a system of some sort.
In writing your
makefile - your instructions to
make - you break down the operations you want to perform (your build) into a series of stages, each of which has some
dependencies (the starting files) and a
target (the output file), and
rules describing how to get from dependencies to target. When you run the make tool, it looks at the relative time stamps on each of the files, and which targets are missing too, and works out which rules need to be run and in which order, so that only the rules that need to be run are run.
Make supports a wide variety of facilities to help the author of the makefile write a short and maintainable makefile which doesn't repeat things time and time again, and allows the author the ability to generate multiple output files and to "nest" make within make for greater flexibility. Other facilities allow the author to provide feedback and error handling during the running of make so that the user who is building or installing a product or running a series of tests through make is kept informed of its progress. But these powerful facilities come at the cost of a certain bewilderment for the newcomer, who can take a look at the make manual and wonder where to start. It's really not that hard with a bit of instruction and some hands on training and exercises.
I first trained on
make as long ago as the early 1990s, having been a user of extensive makefiles for building, testing and installing our
Designer I software package over the previous decade - a full-featured Computer Aided Design system written in C, Fortran and Assembler. Make was used for builds, for testing, and for installation across multiple platforms with our own preprocessors for system compatibility controlled from within make to allow us to easily maintain common source across a number of operating systems. And I still use make, most notably for C and C++ courses, where we include a short section within some of our public courses. I can also provide private training on make - a good introduction in half a day, or a full and quite deep course taking a day.
These days, we're very happy for delegates to use their own computers on most of our private training courses, and we only provide laptops ourselves where they're required (we remain very happy to do so). With make, though, we'll
always provide systems, as there's going to be a wide variety of source data / material to use during the course, and the course covers installation of software as the administrator / root, and on delegate's own systems this would mean substantial downloading prior to the course, and could mean security concerns as to just what was installed during the make process - especially if in the learning process the student made errors that (for example) cleaned up (a.k.a. deleted) parts of the system. Better to do the early learning and experimentation on our machines which can be rebuilt than on your own.
(written 2012-03-02, updated 2012-03-10)
20fe
Associated topics are indexed under
A168 - Web Application Deployment - Compiler and development tools [4013] Web Frameworks - nested templates - (2013-02-22)
[3666] Makefile variables - defined internally, from the command line and from the environment - (2012-03-22)
[3658] Using Make for a distribution - (2012-03-17)
[3652] A Complete makefile example - (2012-03-14)
[3651] Makefile - some basics, and a demonstration - (2012-03-13)
[3053] Make - automating the commands for building and installing - (2010-11-16)
[2674] Make and makefiles - a commented example to help you learn - (2010-03-12)
[1671] Compiling C programs with gcc - an overview - (2008-06-10)
[694] Ant and Make - (2006-04-22)
A191 - Web Application Deployment - Installing Linux [1292] DHCP automatic IP address v Static IP - (2007-08-06)
[1288] Linux run states, shell special commands, and directory structures - (2007-08-03)
[705] Disc Partitioning - (2006-04-30)
Some other Articles
Best tenner I ever spent?Parse error: parse error, unexpected T_STRING on brand new web site - why?Defining database relations in your Django modelNesting Templates in DjangoWhat is Make?Getting around Dublin by public transport - some observationsSerialsing and unserialising data for storage and transfer in PerlSharing lots of values in Tcl without having lots of global declarationsHistoric Drawings from near MelkshamMeeting Report - Tuesday 21st Feb - to Melksham Chamber of Commerce from Shadow Community Operations Board