Make is a program which can help for compiling a project which has complicated structure. Make also can help the case where you edit some parts from the project, Make can compile only edited parts, resulting in reduced compile time. ====================================================================== When you have a small program, all sentences and functions can be written into a single file. But when you have large program, you should write many lines, you should have multiple components, you should have more than one programmers who write source files. ====================================================================== It will be too difficult to grasp the source code, if you write all lines into the single file. And compile time will spend much time, because whenever you edit small parts, you should compile the entire project. Multiple programmers can't edit one source file at the same time. In conclusin, dividing components is desired. You divide projects into multiple files. ====================================================================== Header file contains prototypes of functions. Source file contains definitions of functions. ====================================================================== Mozilla is a project which is composed of Firefox (web browser), Thunderbird (email client), etc ====================================================================== Mozilla project has 2500 subdirectories, 26000 files ====================================================================== Complicated relationships between files ====================================================================== When you have multiple source files, and when compile them, typing names of all files on GCC is difficult. And to compile only edited files, you should track and know what files had been changed. But those tracking and knowing manually every edited parts are difficult. Files have dependencies to each other. Managing dependencies is difficult. ====================================================================== Above difficulties can be resolved by Make program. ====================================================================== Make program interprets and executes Makefile or makefile Makefile is a script file which contains commands about how to automatically compile and link your project. ====================================================================== How Make works? - First, Make configures most-top-target. Target is sort of a program which you want to create. To create targets, you can need sub files and other files. Make compiles entire project recursively. Targets will be only built when targets are older than the current files which targets depend on. ====================================================================== ====================================================================== touch Makefile # sum is most-top-taget or final-ultimate-target which you want to create # sum target depends on main.o sum.o sum:main.o sum.o # How to create (recipe) sum from main.o sum.o # Link object files main.o and sum.o # to create an object file sum gcc -o sum main.o sum.o main.o:main.c sum.h gcc -c main.c sum.o:sum.c sum.h gcc -c sum.c