You compile a Linux program with the 'make' command. Most of the time, Linux programs come with a makefile, which is a list of instructions that 'make' can use to build the program. You would just type 'make', or 'make target'. (But you've got to study this, and read the makefile.)
In the simplest case, without 'make', you can compile and link the hello.c program with the 'cc -o hello hello.c' command or, if 'make' is installed, you can use default rules by using the 'make hello.c' command.
Chat with our AI personalities
Compiling is the process of parsing source code as input to the compiler and outputting one or more object modules. In true compilers, this is usually not sufficient to produce an executable program. After compiling, the object modules must be linked with a linker to store the object modules referenced by the source code's prototype declarations into the binary. After all this is done, assuming there are no error aborts, an executable binary should be produced.
This explanation is somewhat over simplified, but it should provide you a general idea.
On Linux, the programs that may be involved could be 'gcc' and 'ld' at a minimum, though 'yacc', 'bison' and 'lex' may also be used, among many others. 'gcc' is the actual compiler, 'ld' is the linker, 'yacc' is the compiler compiler, 'lex' is the lexical analyzer generator and so forth.