[prev] [index] [next]

Makefiles

A Makefile helps to organise the compilation of modules of a C program

Example:

seqq: seqq.c
	gcc -Wall -Werror -o seqq seqq.c

The UNIX command make

  • looks for a file named Makefile in the current directory
  • and executes the gcc command

    prompt$ make
    gcc -Wall -Werror -o seqq seqq.c
    

  • or does nothing if the dependencies haven't changed since the last make

    prompt$ make
    make: `seqq' is up to date.