Makefile

From Wikiid
Revision as of 15:43, 30 July 2010 by SteveBaker (Talk | contribs) (Created page with 'The UNIX 'make' tool is one of the oldest ways to make things (executable programs mostly) under UNIX, Linux and even CygWin/Windows. The GNU version of the tool is free OpenSou…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The UNIX 'make' tool is one of the oldest ways to make things (executable programs mostly) under UNIX, Linux and even CygWin/Windows. The GNU version of the tool is free OpenSourced - and can be found almost everywhere.

Make is told how to make things using a 'Makefile'. Makefiles can have any name or extension - but overwhelmingly often they have just one name: 'Makefile' (with a capital 'M'). When you have to call them something else, the '.mk' extension is the most common choice. Running 'make' is easy:

   make

...providing you called your Makefile by the usual name. Otherwise (if you really must), use:

   make -f mymakefile.mk

At it's most basic, a Makefile contains some number of 'rules':