boa源码分析(1)--Makefile

# Generated automatically from Makefile.in by configure.
# $Id: Makefile.in,v 1.59 2002/03/24 22:20:19 jnelson Exp $
//本makefile 由autotools生成
.SUFFIXES:
.SUFFIXES: .o .c //去掉原后缀,添加新后缀
.PHONY: clean mrclean distclean depend all dist //伪目标

GCC_FLAGS = -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wcast-qual\
  -Wtraditional\
  -Wshadow\
  -Wconversion\
  -Waggregate-return\
  -Wmissing-prototypes\
  -Wnested-externs\
  -Wall \
  -Wundef -Wwrite-strings -Wredundant-decls -Winline


srcdir = .
VPATH = .:./../extras	//如果依赖文件或目标文件在当前目录下没找到的话,就到这两个目录来找(这两个目录由冒号分隔)
#LDFLAGS =  -g
LIBS =  
CFLAGS += -pipe -Wall -I.

# Change these if necessary

YACC = bison -y //yacc是个语法分析器	生成的文件后缀为.Y
LEX = flex //词法分析器,生成的文件后缀为.L
#CC = arm-linux-gcc 
#CPP = arm-linux-gcc -E

SOURCES = alias.c boa.c buffer.c cgi.c cgi_header.c config.c escape.c \
	get.c hash.c ip.c log.c mmap_cache.c pipe.c queue.c read.c \
	request.c response.c select.c signals.c util.c sublog.c

OBJS = y.tab.o lex.yy.o $(SOURCES:.c=.o) timestamp.o //$(SOURCES:.c=.o)用了替换,将SOURCES中的.c替换成了.o 
//all是伪目标,默认目标 
all:	boa boa_indexer
	rm -rf $(OBJS)
	chmod +x boa
	@echo "build boa finish."

boa:	$(OBJS)
	$(CC) -o $@  $^ $(LDFLAGS) $(LIBS) //$@ $^	$?	$<	$*都是自动化变量
	
boa_indexer:	index_dir.o escape.o   
	$(CC) -o $@  $^ $(LDFLAGS) $(LIBS)

clean:
	rm -f $(OBJS) boa core lex.yy.c y.tab.c y.tab.h *~ boa_indexer index_dir.o *.d  
	
distclean:	mrclean

mrclean:	clean
	rm -f config.status config.cache config.h Makefile config.log

# parser dependencies

y.tab.c y.tab.h:	boa_grammar.y
	$(YACC) -d $^

lex.yy.c:	boa_lexer.l
	$(LEX) $^

# timestamp

timestamp.o:	$(SOURCES) boa_grammar.y boa_lexer.l
// 用gcc -MM可以生成源文件的依赖关系,.depend文件原来都有了,可以make depend重新制作 
# depend stuff
.depend:
	$(CPP) -MM $(SOURCES) > .depend	// ">"重定向
        
depend:
	-rm -f .depend
	$(MAKE) .depend
        
include .depend

# tags
tags:	$(SOURCES)	//更新所有的目标,以备完整地重编译使用。
	ctags -o tags $^ *.h

# dist
dist:
	$(MAKE) clean
	./makedist.sh
        
# object dump
boa.objdump:    boa	
	objdump --disassemble-all --source boa > $@


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值