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
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息