help-make
[Top][All Lists]
Advanced

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

GNU make, gcc, and auto-dependencies


From: Travis Spencer
Subject: GNU make, gcc, and auto-dependencies
Date: Wed, 5 Jan 2005 23:02:43 -0800
User-agent: All mail clients sucks. This one just sucks less.

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

-- 

Regards,

Travis Spencer

[1] http://make.paulandlesley.org/autodep.html
[2] 
http://www.travisspencer.com/blog/2005/01/03/index.thtml#%C3%9Cber%20Makefile




reply via email to

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