|
Home > Archive > Unix Programming > May 2005 > Newbie needs help: Makefile Dependencies
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Newbie needs help: Makefile Dependencies
|
|
| christopher.chai@gmail.com 2005-05-15, 8:35 am |
| 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
format:
TARGET: DEPENDENCIES
<TAB> COMMAND
"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!
Chives
P.S. Would it be easier if I posted up the makefile that I'm looking at?
| |
| T.M. Sommers 2005-05-15, 5:49 pm |
| christopher.chai@gmail.com wrote:
>
> ...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.
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 -- tms@nj.net -- AB2SB
|
|
|
|
|