CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2009
    Location
    Boston
    Posts
    375

    [RESOLVED] No rule to make target error I can't track down

    Hello,

    I am having an annoying issue building some code.

    I am getting the following error,
    Code:
    make: *** No rule to make target `ListObjects/gcc44/x86_64/list_tools.o', needed by `bld_CentOS-7.7_3.10.x86_64_gpp-4.8.5_gfortran-4.8.5/ListApp'.  Stop.
    This is on CentOS 7.7 AMD64 with gcc/g++/gfortran 4.8.5.

    The compile rule for list_tools.o is,

    Code:
    CC++ = g++
    CFLAGS = $(OPTIMIZE) -DLINVGCC4 -DDATESTR=$(DATESTR2) $(DEFRELS) -I src -Wall
    VFLAGS = -DVERNUM=$(VERNUM)
    SOURCELOC = ./src
    
    INCS = $(SOURCELOC)/utils/struct_def.h \
           $(SOURCELOC)/utils/list_tools.h
    
    # compile list_tools.o
    $(BDIR)/ListObjects/gcc44/x86_64/list_tools.o: ${SOURCELOC}/utils/list_tools.cpp $(INCS)
        $(CC++) $(CFLAGS) $(VFLAGS) -c -o $@ $<
    The object is supposed to land in ./ListObjects/gcc44/x86_64/ and this directory exists

    I have built this quite a few times over the last week and not had any issues. There is a leading tab on the second line of the compile rule and all of the files are in the locations where make should be looking for them. I have printed out all of the information in the rule above from make right before the compile rule, so it seems like make it getting to the right place.

    How do I determine what is going wrong here?

    Thanks,

    LMHmedchem
    Last edited by LMHmedchem; September 24th, 2024 at 11:22 AM.

  2. #2
    Join Date
    May 2009
    Location
    Boston
    Posts
    375

    Re: No rule to make target error I can't track down

    Found it.

    Code:
    $(BDIR)/ListObjects/gcc44/x86_64/list_tools.o
    actually doesn't exist. The trunk directory has many directories.

    /trunk/
    /trunk/src
    /trunk/ListObjects
    /trunk/bld_CentOS-7.7_3.10.x86_64_gpp-4.8.5_gfortran-4.8.5

    where bld_CentOS-7.7_3.10.x86_64_gpp-4.8.5_gfortran-4.8.5 is where most of the compiled objects go and bld_CentOS-7.7_3.10.x86_64_gpp-4.8.5_gfortran-4.8.5 is the value of $(BDIR).

    The compiled list_tools.o object actually goes in /trunk/ListObjects so the leading $(BDIR) in the compile rule is wrong. Make was looking for the directory

    /trunk/bld_CentOS-7.7_3.10.x86_64_gpp-4.8.5_gfortran-4.8.5/ListObjects/etc

    which doesn't exist. The correct rule is just,

    Code:
    ./ListObjects/gcc44/x86_64/list_tools.o: ${SOURCELOC}/utils/list_tools.cpp $(INCS)
         $(CC++) $(CFLAGS) $(VFLAGS) -c -o $@ $<
    Thanks for the help, really, I am surprised how often making a post helps me figure out the answer.

    LMHmedchem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured