theNbomr |
06-01-2011 10:12 AM |
To compile a single file using make almost never even requires a Makefile. make has built-in knowledge of how to create object code from source code for most common compilers. If you have a C source file that can be compiled to an executable binary, you can most often use simply
In the above example, make would look in the current working directory for a source code file that it knows how to compile and link to an executable. Since you refer to using gcc, if you had the C source file helloWorld.c in the current working directory, make would try to compile and link it using its built-in rules. Assuming your source file was compilable, it would result in a runnable binary, ' helloWorld'.
--- rod.
|