Makefile

 
一些选项的解释:
CC=gcc
CFLAGS= -Iinclude -Wall  -g -DDEBUG
LDFLAGS=-L./lib -Wl,-rpath=./lib -Wl,-rpath=/usr/local/lib

ttorrent: main.o parse_metafile.o tracker.o bitfield.o sha1.o message.o peer.o data.o policy.o torrent.o bterror.o log.o signal_hander.o
$(CC) -o $@ $(LDFLAGS) $^ -ldl

clean:
rm -rf *.o ttorrent

 


1.第二句的那个-DDEBUG是什么意思,干么用的.
2.第三句的-Wl和,- rpath是什么意思,干么的?
3.第6句的-ldl是什么意思,干么的.


|html

一、-DDEBUG 定义宏 DEBUG,相似于在 .c 或 .h 中 #define DEBUG
二、-Wl 将后面跟的参数传递给链接器 ld;- rpath 添加运行时库的搜索路径 三、-ldl 链接库 libdl.so 或 libdl.a
相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息