My first Makefile

First, the source  file is:

 

 

There are three files:p631.c, csapp.h, csapp.c, the file csapp.h is both included by p631.c and csapp.c

 The dependence relationship is as follows:

 the executable file  depends on two object file;

 the object file depends on the source file and the files it includes;

 the -o p631.o in the rules can be omited because of the -c option,and become "gcc -c p631.c"

 Note: when generate the executable file p631 ,the option -pthread is necessary,or there will be some mistakes likes"undefined reference to `pthread_create'"


yohoro. 09.2.14

valentine's day!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章