Makefile Problem

This is a discussion on Makefile Problem within the C++ Programming forums, part of the General Programming Boards category; I am migrating old C++ OpenGL code from an old (circa Fedora 4) install to a new Dell workstation running ...

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    5

    Makefile Problem

    I am migrating old C++ OpenGL code from an old (circa Fedora 4) install to a new Dell workstation running Red Hat Enterprise 5. (I get the same error in Fedora 10).

    When I "make" the code I get:

    make: *** No rule to make target `Makefile.dependencies', needed by `depend'. Stop.

    Any help I can get with the original Makefile is appreciated:

    Code:
    CC = g++
    
    CFLAGS = -g -Wall -D__USE_FIXED_PROTOTYPES__ -w
    
    LDFLAGS = -lGL -lGLU -lglut -lm -lX11 
    
    LIBDIR = -L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib
    
    INCDIR = -I/usr/include -I/usr/X11R6/include
    
    SRCS = flightdetail20.cc landdetail55.cc comm001.cc texture.cc constants.cc comm_variables.cc flight_variables.cc 3ds.cc
    
    OBJS = $(SRCS:.cc=.o) 
    PROGS = teapotdetail
    
    default : $(PROGS) 
    
    $(PROGS) :  depend $(OBJS)
    	$(CC) -o $@ $(OBJS) $(LIBDIR) $(LDFLAGS) /usr/lib/lib3ds.a
    
    depend:: Makefile.dependencies $(SRCS) $(HDRS)
    
    Makefile.dependencies:: $(SRCS) $(HDRS)
    	$(CC) $(CFLAGS) $(INCDIR) -MM $(SRCS) > Makefile.dependencies
    
    -include Makefile.dependencies
    
    clean : 
    	/bin/rm -f *.o a.out core $(PROGS) Makefile.dependencies *~ #*
    
    TAGS : $(SRCS) $(HDRS)
    	etags -t $(SRC8iS) $(HDRS)
    Last edited by jerryyyyy; 11-27-2008 at 11:46 AM. Reason: show code

  2. #2
    Registered User
    Join Date
    Aug 2008
    Posts
    188
    Code:
    make: *** No rule to make target `Makefile.dependencies', needed by `depend'. Stop.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    5
    Quote Originally Posted by bling View Post
    Code:
    make: *** No rule to make target `Makefile.dependencies', needed by `depend'. Stop.
    Thanks for the reply. I fixed the code into the right format. What you have here is the error I get when I try to run the Makefile.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Code:
    Makefile.dependencies:: $(SRCS) $(HDRS)
    $(CC) $(CFLAGS) $(INCDIR) -MM $(SRCS) > Makefile.dependencies
    That looks like a rule to me, so I expect it is some subtle thing somewhere that is causing a problem. Maybe some tabs have be replaced by spaces, for example - there should be a TAB on the line with $(CC) above - and I expect there is, but since there is no code tags around the makefile, I can't see whether there is or not.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Nov 2008
    Posts
    5
    Quote Originally Posted by matsp View Post
    Code:
    Makefile.dependencies:: $(SRCS) $(HDRS)
    $(CC) $(CFLAGS) $(INCDIR) -MM $(SRCS) > Makefile.dependencies
    That looks like a rule to me, so I expect it is some subtle thing somewhere that is causing a problem. Maybe some tabs have be replaced by spaces, for example - there should be a TAB on the line with $(CC) above - and I expect there is, but since there is no code tags around the makefile, I can't see whether there is or not.

    --
    Mats
    Thnaks, I re-edited the Makefile above to show the code and yes there is a tab on the line with $(CC).

    This Makefile was written probably 5 years ago and my suspicion is that something has changed in the compiler etc. which makes the grammar subtly screwed up... since I get the same error in Fedora and Red Hat. Maybe I should just try rewriting the Makefile from scratch...

    One problem seems to be that the script does not output the Makefile.dependencies file... which it seems designed to do. I checked the permissions on the folder and they are OK (777). So there is no Makefile.dependencies file in the folder. If I type "make Makefile.dependencies" I get the same error. Something with this line.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Completely wild guess: Change the :: into : - I have no idea if that helps or not, but I don't see anything else that is even remotely suspicious.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Registered User
    Join Date
    Nov 2008
    Posts
    5
    Quote Originally Posted by matsp View Post
    Completely wild guess: Change the :: into : - I have no idea if that helps or not, but I don't see anything else that is even remotely suspicious.

    --
    Mats
    Thanks, tried that already and did not help. I better try from scratch because as I comment out the "depend" files the errors just seem to lead back right to the start. This was created without much thought many years ago off some model that may just be dead_on_arrival in 2008. I wonder if I really need to create that "Makefile.dependencies" file.

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by jerryyyyy View Post
    Thanks, tried that already and did not help. I better try from scratch because as I comment out the "depend" files the errors just seem to lead back right to the start. This was created without much thought many years ago off some model that may just be dead_on_arrival in 2008. I wonder if I really need to create that "Makefile.dependencies" file.
    I'm pretty sure there's something else going on here. "make" has existed since 20 years back. It has had some extensions added, but not in such a way that it should break old makefiles.

    When I try it on my machine (I just created empty files for your source files) it tries to do the right thing - it obviously fails when the source files are empty.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #9
    Registered User
    Join Date
    Nov 2008
    Posts
    5
    Looks like the libraries are empty.... For sure -lglut is not there. I just installed the latest NVIDIA drivers, but they do not include -lglut (thought they did). I have a Dell M90 portable workstation (for in home Thanksgiving work) and the mothership at the lab, which runs the Red Hat. The M90 is running Fedora 10.

    I will get all the libraries loaded right and see what happens.

    You would think I would get an error on the libraries.

    Thanks for the Help.
    Last edited by jerryyyyy; 11-27-2008 at 06:22 PM. Reason: spelling

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. problem with Makefile separator
    By luca in forum Tech Board
    Replies: 6
    Last Post: 01-15-2007, 09:20 AM
  3. Problem with makefile, how to use the -lm oh this?
    By Nazgulled in forum C Programming
    Replies: 1
    Last Post: 04-07-2006, 01:29 PM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM
  5. Replies: 5
    Last Post: 11-07-2005, 10:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21