在看Linux/UNIX系统编程手册第8章,书中的源代码作者都写好了makefile,所以更改代码后直接make,就会编译,显示相应的命令.但是ugid_functions.c文件确没有写在makefile里面,因此不知道怎么编译。
例如我打开一个.c文件,在空白处增加一个回车,然后make会编译,看到执行的相应命令如下.
cc -std=c99 -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE -g -I../lib -pedantic -Wall -W -Wmissing-prototypes -Wno-sign-compare -Wno-unused-parameter t_getpwent.c ../libtlpi.a -lm -o t_getpwent
我将t_getpwent和t_getpwent.c换成我要编译的代码ugid_functions.c文件,执行报错,代码目录及调用形式及makefile文件如下: