您的位置:首页 > 其它

boa源码分析(1)--Makefile

2015-03-19 15:05 120 查看
[javascript] view
plaincopy

# 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 > $@  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  boa 源码 分析