Showing posts with label make. Show all posts
Showing posts with label make. Show all posts

Thursday, March 11, 2021

compiling

 compiling is the process of converting source code to machine code

but it actually consists of the following steps:

pre-processing

compiling

assembling

linking

(when we say compile, we are actually referring to these four steps, but we wont dwell on such low-level details)


pre-processing - looks for "#" , and then finds-and-replaces, copy-and-pastes



cs50 week 2 video 12:40

source: cs50



-lcs50 ---- argument for linking binaries

 clang -o hello hello.c -lcs50



this argument tells the compiler to link the cs50 library binaries


-lm   ....... links a math library

-lcrypt   ......... links to a cryptography or encryption library



make automates the work of manually typing in a whole bunch of command line argument when compiling



cs50 week 2 video 9:30 , 10:42


source: cs50



Tuesday, March 9, 2021

clang -o hello hello.c. (command line arguments - inputs. to the command)

 configures clang to name the resulting output file "hello" instead of a.out


source: cs50



a.out - stands for "assembly output".

 a.out is the default file name for the file obtained after compiling using  clang



source: cs50

clang - a compiler (a program that converts source code to machine code)

 



source: cs50



make -

 if you type command : "make hello"

the make program will automatically look for a file called "hello.c" to compile

and will produce a file called "hello" that you can execute



source: cs50