3

What is a makefile and how do I use it?

lital maatuk
  • 5,921
  • 20
  • 57
  • 79

2 Answers2

5

A make file describes the compilation process. It describes which flags, compiler tools, linkers, etc. to use with which source code files and objects

More info http://www.sis.pitt.edu/~mbsclass/tutorial/advanced/makefile/

Nick
  • 3,096
  • 3
  • 20
  • 25
  • 2
    It's used mostly for that, but is not necessary should be the compilation process - many tasks may be automated using `make` – asciz Feb 13 '11 at 18:18
3

The main purpose of a Makefile is to store every you need to build your project in one place. It contains the instructions for compiling your code, linking your compiled code, packaging the executables, extracting third party tools, and many other useful things. Pretty much any command you entire at the command line can be used in a makefile.

The advantage to using a makefile, when done correctly at least, is that anyone can easily build your entire project. It's as easy as typing make

An example of a Makefile for a windows project http://www.opussoftware.com/tutorial/TutMakefile.htm

MadcapLaugher
  • 573
  • 2
  • 8