answersLogoWhite

0

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.

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
ReneRene
Change my mind. I dare you.
Chat with Rene
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
More answers

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.

User Avatar

Wiki User

11y ago
User Avatar

Add your answer:

Earn +20 pts
Q: How do you compile programs in Linux?
Write your answer...
Submit
Still have questions?
magnify glass
imp