728x90
myexe:hello.o
gcc hello.o -o myexe
hello.o:hello.c
gcc -c hello.c
this makefile. by executing command "gcc hello.o -o myexe" hello.o will be myexe. and same for second line.
by looking at modify time make command can tell whether it need to compile it or not
if hello.c 's modify time is yonger than hello.o make command will compile.
notice it only compile that is not up to date.
you can execute clean command by "make clean" , other commands are same.
included d1/makefile , which mean it will also execute d1/makefile too when we type make command.
we can also use macro to simplify modification whe we need.
other macro that can be use in makefile.
728x90
'Operating System > System Programming(Arif Butt)' 카테고리의 다른 글
Lec 6, 7) Versioning Systems git-1,2 (0) | 2021.06.15 |
---|---|
Lec05) GNU autotools and cmake (0) | 2021.06.13 |
Lec03) Working of Linkers: Creating your own Libraries (0) | 2021.06.11 |
Lec02) C Compilation: A System Programmer Perspective (0) | 2021.06.09 |
Lec1) Introduction to System Programming (0) | 2021.06.08 |