Newbie needs help: Makefile Dependencies

Newbie needs help: Makefile Dependencies

Post by christophe » Mon, 16 May 2005 15:46:10

Greetings all,
I am fairly new to Unix (I'm running Fedora Core 3, on an AMD Athlon
2800+), knowing only the basic rudiments of how to navigate around (ls,
cp, pwd, mkdir, ... the basic commands). Currently, I am trying to
figure out how to update an existing makefile. I understand the general
format of
makefiles, ie for each file you want to compile you have the following


"COMMAND" for the case of the makefile for the program that I am
working with is usually $(CC) $(LFLAGS) DEPENDENCIES -lm -o TARGET. I
understand this command tells the system to look for the compiler and
flags referenced by the make variables CC and LFLAGS, respectively, -lm
is for math libraries, and -o refers to making this an executable file.
Also, I know how to use the command (cc -MM <file> ) to find out the
immediate file dependencies.
However, what I do not understand is how you determine what other
files that your target is dependent on. ...the confusing thing of the
makefile that I am looking at is that the targets list dependencies
that aren't found by the "cc -MM <file>" command. If you could show me
how to figure out all of the dependencies for a target, I would be
extremely grateful.

Thank you in advance!

P.S. Would it be easier if I posted up the makefile that I'm looking at?

Newbie needs help: Makefile Dependencies

Post by T.M. Somme » Tue, 17 May 2005 02:56:07

Are the dependencies in the makefile accurate? That is, are they
really dependencies, or did the author of the makefile make some
mistakes? Also note that -MM does not list system headers.

Thomas M. Sommers -- XXXX@XXXXX.COM -- AB2SB