help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: GNU make, gcc, and auto-dependencies


From: Alexander.Farber
Subject: RE: GNU make, gcc, and auto-dependencies
Date: Thu, 6 Jan 2005 10:06:34 +0100

Is it maybe because you've listed a dir as prerequisite here?

%.o : %.c $(BUILDDIR)
        $(CC) -MMD -o $(BUILDDIR)/$@ -c $(CFLAGS) $< $(LIBS)
        $(MAKEDEP)

%.o : %.cpp $(BUILDDIR)
        $(CXX) -MMD -o $(BUILDDIR)/$@ -c $(CXXFLAGS) $< $(LIBS)
        $(MAKEDEP)

Regards
Alex 

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf
> Of ext Travis Spencer
> Sent: Thursday, January 06, 2005 8:03 AM
> To: address@hidden
> Subject: GNU make, gcc, and auto-dependencies
> 
> 
> I am trying create a makefile the does the following:
> 
> * Creates an executable that is named after the current working
>   directory.
> * Builds all object files and dependency files in the subdirectory. 
> * Compiles all C or C++ files in the current directory.
> * Automatically creates dependencies for each C or C++ file.
> 
> What I've done so far:
> 
> I've read Paul Smith's excellent explanation about generating
> dependencies [1].  Using his writeup as a guide, I put together this
> makefile:
> 
> http://www.travisspencer.com/stash/tmp/makefile.txt
> 
> (I'm sure I don't have to explain the details to you all, but in case
> a little bit of explanation is desirable, it can be found in my blog
> [2].)
> 
> What the problem is:
> 
> The first time I run make, it fulfills all of my four requirements
> listed above.  However, after modifying a source file and rebuilding,
> it gets hung up by the prerequisite file (a .p file).  I'm not sure
> why it thinks it needs to build the p file.  In case it helps, here is
> a transcript of first and second run with debugging turned on:
> 
> http://www.travisspencer.com/stash/tmp/typescript.html
> 
> This dump is *really* long, so I highlighted some interesting things
> (e.g., the line where one of the source code files is modified is
> green, some of the compilation commands are yellow, make output about
> the modified file is also yellow, and the actual error is blue).  The
> specific error I'm getting is this:
> 
> pc    -c -o build/kill.o build/kill.p
> make: pc: Command not found
> make: *** [build/kill.o] Error 127
> 
> What version of software am I using:
> 
> gcc: 3.4.0
> make: 3.78.1
> OS: Solaris 9 on a Sparc
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]