一个比较标准的makefile文件

INC_PATH = -I./
LIB_PATH = -L./lib
LIB = -lxlog -lpthread -liconv  -lMD5


CC = g++
CPPFLAGS = -Wall $(INC_PATH) -g


OBJS = src/spider.o src/s_hash.o src/html_store.o src/utils.o  src/global.o src/s_crawler.o src/s_url_praser.o src/html_head_praser.o src/wipscs_socket_client.o src/wiprdss_socket.o \
       adns/types.o adns/event.o adns/query.o adns/reply.o adns/general.o adns/setup.o adns/transmit.o adns/parse.o \
       adns/poll.o adns/check.o src/url_format.o src/s_dns_resolve.o src/CharsetConverter.o src/url_format.o src/priority_list.o src/priority_list_index.o
TARGET = newspider
all: $(TARGET)


newspider:$(OBJS)
$(CC) -o $@ $^ $(LIB_PATH) $(LIB)
rm -f src/*.o *.o


clean:

rm -f src/*.o *.o


在加上一个:

CC=gcc


objects = thread_pool.o tp_test.o queue.o


.PHONY: all
all: tp_test


tp_test: $(objects)
$(CC) -o tp_test -lpthread $(CFLAGS) $(objects)


$(objects): thread_pool.h queue.h


.PHONY: clean
clean:
-rm tp_test *.o 
exec:
./tp_tes

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值