

It would be time-consuming to always compile everything after you change anything, so make is designed to only compile the parts that need to be re-compiled after a change. A typical C program consists of several modules (.c) and header files (.h).

Make is useful for controlling the build process of a project. Gcc is a C compiler: it takes a C source file and creates machine code, either in the form of unlinked object files or as an actual executable program, which has been linked to all object modules and libraries.

makefile – What is the difference between make and gcc? Make gets its knowledge of how to build your program from a file called the makefile, which lists each of the non-source files and how to compute it from other files. Make is a tool which controls the generation of executables and other non-source files of a program from the programs source files. The description from GNUmake is as follows: GNUmake is one popular implementation of make. It also tracks dependencies between various source files and object files that result from compilation of sources and does only the operations on components that have changed since last build. Make is a build tool that invokes the compiler (which could be gcc) in a particular sequence to compile multiple sources and link them together. The GNU Compiler Collection (usually shortened to GCC) is a compiler system produced by the GNU Project supporting various programming languages. Wikipedia page on GCC describes it as a compiler system: It supports multiple languages, but does not knows how to combine several source files into a non-trivial, running program – you will usually need at least two invocations of gcc (compile and link) to create even the simplest of programs. This is very useful for larger projects, with hundreds or thousands of source code files, and to keep track of things like compiler options, include paths, and so on. It then interprets this file, figures out what needs to be compiled, and calls gcc for you. What make does it introduce a separate file of rules, that describes how to go from source code to finished program. You can never build a program purely using make its not a compiler.

Well … gcc is a compiler, make is a tool to help build programs. Makefile – What is the difference between make and gcc?
