【问题标题】:how does the .Tpo file generate?why there is "NO Such file or directory"?.Tpo 文件是如何生成的?为什么有“没有这样的文件或目录”?
【发布时间】:2015-02-23 02:17:00
【问题描述】:

make的输出:

Making all in access/
gcc  -g -O2   -o fileOpt fileOpt.o  
Making all in executor/
gcc  -g -O2   -o executor execFilter.o execJoin.o execMain.o execNode.o execProject.o execScan.o execSort.o execUtil.o  
Making all in index/
gcc  -g -O2   -o index b_plus_tree.o  
Making all in nodes/
gcc  -g -O2   -o nodes nodes.o  
Making all in optimizer/
gcc  -g -O2   -o optimizer optimizer.o path.o  
Making all in parse/
gcc  -g -O2   -o parser analyze.o check.o gram.o parser.o scan.o  
Making all in posql/
gcc -DHAVE_CONFIG_H -D_GNU_SOURCE -I. -I.. -I /Users/YOuth/Program/posql/src/backend/include     -g -O2 -MT ../util/transfrom.o -MD -MP -MF .deps/../util/transfrom.Tpo -c -o ../util/transfrom.o ../util/transfrom.c
error: error opening '.deps/../util/transfrom.Tpo': Error opening output file '.deps/../util/transfrom.Tpo': No such file or director

我在其他文件夹(访问/索引/ ...)中找到,它在.dep文件夹中也没有.Tpo文件?为什么它只是 util 找不到?

ls util/
Makefile    Makefile.am Makefile.in transfrom.c util.c

transfrom.c:

#include "util/transfrom.h"
#include "util/datatype.h"
#include "string.h"
#include "stdlib.h"

void strToDate(Date* date , char* str){
    ....
}

我的问题是Tpo 是如何生成的?是否有任何可能甚至明显的错误?提前致谢。

【问题讨论】:

    标签: c configure autoconf automake


    【解决方案1】:

    在列出的 makefile 的其他问题中,这个参数:.deps/../util/transfrom.Tpo 不太可能是正确的。

    它说:在子目录.deps(注意.) 上一级目录(即 makefile 所在的位置),然后下一级到 util 目录。

    然后生成文件transfrom.Tpo

    嗯。也许这只是一个错字,但我怀疑transform.Tpo 是错误的,正如所呈现的路径一样。

    然而,有趣的是(通常)每个源文件都有一个依赖文件,而不仅仅是一个依赖文件。通常最好将这些依赖文件命名为与关联源文件相同的根名称,并具有唯一的扩展名,例如.d

    我建议在单独的 make 文件规则中生成依赖文件,使用 -M -MF <file name>.c

    不要使用-MP,因为这会导致gcc 为每个文件生成一个目标并且不提供任何依赖项。

    gcc 参数详情可在以下位置找到: http://tigcc.ticalc.org/doc/comopts.html#SEC3

    下面是一个make文件(实际上是一对makefile),它处理 在每个子目录和主目录中生成依赖、编译、链接。他们使用sed 而不是gcc 来生成依赖文件,但上述信息将使您能够调整该规则。

    这是顶级生成文件: 注意:allDirectories 宏是子目录的列表, 这将不得不调整您的子目录列表

    SHELL = /bin/sh
    
    
    #  note: this makefile.mak needs to be run from the ./src directory
    # of the GOT4 directory tree
    
    
    SRC := $(wildcard *.c)
    OBJ := $(SRC:.c=.o)
    DEP := $(SRC:.c=.d)
    INC := $(SRC:.c=.h)
    
    
    MAKE    :=  /usr/bin/make
    
    CC      :=  /usr/bin/gcc
    
    CP      :=  cp
    
    MV      :=  mv
    
    LDFLAGS :=  -L/usr/local/lib -L/usr/lib -L/lib
    
    DEBUG   :=  -ggdb3
    
    CCFLAGS :=  $(DEBUG) -Wall -W
    
    #CPPFLAGS += =MD
    
    LIBS    :=  -lssl -ldl -lrt -lz -lc -lm -lcrypto
    
    
    
    .PHONY: AllDirectories
    # the following statement needs to be edited as
    # subdirectories are added/deleted/re-named
    AllDirectories := \
        CommandConfiguration \
        Communication \
        MainScheduler \
        RetrieveCDSLog \
        RetrieveEventRecorderLog \
        RetrieveGPS \
        QESRouter
    
    .PHONY: all
    #all: $(OBJ) $(AllDirectories)
    #   $(foreach d,$(AllDirectories), \
    #    ( cd $d && $(MAKE) -f makefile.mak name=Tsk_$d all ); )
    
    all: $(OBJ) $(AllDirectories)
        $(foreach d,$(AllDirectories), \
        ( cd $d && $(MAKE) -f ../makefile.bot name=Tsk_$d all ); )
    
    
    
    #
    # create dependancy files
    #
    %.d: %.c
        #
        # ========= START $< TO $@ =========
        $(CC) -M $(CPPFLAGS) $< > $@.$$$$;                      \
        sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@;     \
        rm -f $@.$$$$
        # ========= END $< TO $@ =========
    
    
    
    #
    # compile the .c file into .o files using the compiler flags
    #
    %.o: %.c %.d
        #
        # ========= START $< TO $@ =========
        $(CC) $(CCFLAGS) -c $< -o $@ -I.
        # ========= END $< TO $@ =========
        #
    
    
    
    .PHONY: clean
    #clean: $(AllDirectories)
    #   # ========== start clean activities ==========
    #   rm -f *.o
    #   rm -f $(name).map
    #   rm -f $(name)
    #   rm -f *.d
    #   $(foreach d,$(AllDirectories), \
    #    ( cd $d && $(MAKE) -f makefile.mak clean ); )
    #   # ========== end clean activities ==========
    
    clean: $(AllDirectories)
        # ========== start clean activities ==========
        rm -f *.o
        rm -f $(name).map
        rm -f $(name)
        rm -f *.d
        rm -f ../bin/Tsk_*
        $(foreach d,$(AllDirectories), \
        ( cd $d && $(MAKE) -f ../makefile.bot name=Tsk_$d clean ); )
        # ========== end clean activities ==========
    
    
    
    .PHONY: install
    #install: $(AllDirectories)
    #   # ========== start install activities ==========
    #   $(foreach d,$(AllDirectories), \
    #    ( cd $d && $(MAKE) -f makefile.mak clean ); )
    #   # ========== end install activities ==========
    
    install: $(AllDirectories)
        # ========== start install activities ==========
        $(foreach d,$(AllDirectories), \
        ( cd $d && $(MAKE) -f ../makefile.bot name=Tsk_$d install ); )
        # ========== end install activities ==========
    
    
    
    # include the contents of all the .d files
    # note: the .d files contain:
    # <filename>.o:<filename>.c plus all the dependancies for that file
    # I.E. the #include'd header files
    # wrap with ifneg... so will not rebuild *.d files when goal is 'clean'
    #
    ifneq "$(MAKECMDGOALS)" "clean"
    -include $(DEP)
    endif
    

    这是每个子目录中的makefile。

    SHELL = /bin/sh
    
    
    BINDIR  :=  /home/user/bin
    
    
    .PHONY: all
    all : $(BINDIR)/$(name) ../makefile.mak ../makefile.bot
    
    
    #
    # macro of all *.c files 
    # (NOTE:
    # (the following 'wildcard' will pick up ALL .c files
    # (like FileHeader.c and FunctionHeader.c 
    # (which should not be part of the build
    # (so be sure no unwanted .c files in directory
    # (or change the extension
    #
    SRC := $(wildcard *.c)
    OBJ := $(SRC:.c=.o)
    DEP := $(SRC:.c=.d)
    INC := $(SRC:.c=.h)
    
    
    COMMON_OBJ := $(wildcard ../*.o)
    #COMMON_SRC := $(wildcard ../*.c)
    #COMMON_OBJ := $(COMMON_SRC:.c=.o)
    #COMMON_DEP := $(COMMON_SRC:.c=.d)
    #COMMON_INC := $(COMMON_SRC:.c=.h)
    
    MAKE    :=  /usr/bin/make
    
    CC      :=  /usr/bin/gcc
    
    CP      :=  cp -f
    
    MV      := mv
    
    LDFLAGS :=  -L/usr/local/lib
    
    DEBUG   :=  -ggdb3
    
    CCFLAGS :=  $(DEBUG) -Wall -W
    
    #CPPFLAGS += =MD
    
    #LIBS    :=  -lidn -lssl -ldl -lrt -lz -lc -lm
    LIBS    :=   -lssl -ldl -lrt -lz -lc -lm -lcrypto
    
    
    
    #
    # link the .o files into the executable 
    # using the linker flags
    # -- explicit rule
    #
    $(name): $(OBJ) $(COMMON_OBJ) ../makefile.mak ../makefile.bot
        #
        # ======= $(name) Link Start =========
        $(CC) $(LDFLAGS) -o $@ $(OBJ) $(COMMON_OBJ) $(LIBS)
        # ======= $(name) Link Done ==========
        #
    
    
    
    # note:
    # using MV rather than CP results in all executables being re-made everytime
    $(BINDIR)/$(name): $(name)
        #
        # ======= $(name) Copy Start =========
        $(CP) $(name) $(BINDIR)/
        # ======= $(name) Copy Done ==========
        #
    
    
    
    #
    #create dependancy files -- inference rule
    # list makefile.mak as dependancy so changing makfile forces rebuild
    #
    %.d: %.c 
        # 
        # ========= START $< TO $@ =========
        $(CC) -M $(CPPFLAGS) $< > $@.$$$$;                      \
        sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@;     \
        rm -f $@.$$$$
        # ========= END $< TO $@ =========
    
    
    
    # 
    # compile the .c file into .o files using the compiler flags
    # -- inference rule
    #
    %.o: %.c %.d 
        # 
        # ========= START $< TO $@ =========
        $(CC) $(CCFLAGS) -c $< -o $@ -I. 
        # ========= END $< TO $@ =========
        # 
    
    
    
    .PHONY: clean
    clean: 
        # ========== CLEANING UP ==========
        rm -f *.o
        rm -f $(name).map
        rm -f $(name)
        rm -f *.d
        # ========== DONE ==========
    
    
    
    .PHONY: install
    install: all
    
    # include the contents of all the .d files
    # note: the .d files contain:
    # <filename>.o:<filename>.c plus all the dependencies for that .c file 
    # I.E. the #include'd header files
    # wrap with ifneg... so will not rebuild *.d files when goal is 'clean'
    #
    ifneq "$(MAKECMDGOALS)" "clean"
    -include $(DEP)
    endif
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-02
      • 2013-02-17
      • 2013-11-23
      • 1970-01-01
      • 2021-06-24
      • 1970-01-01
      • 2021-08-29
      相关资源
      最近更新 更多