Newbie needs help: Makefile Dependencies

christopher.chai_at_gmail.com
Date: 05/15/05


Date: 14 May 2005 23:46:10 -0700

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?



Relevant Pages

  • Re: [KBUILD] allow any PHONY in if_changed_dep
    ... Working on the "why did we build this target path" at the moment. ... commit f9361616df9f8fc80a5bbe8c0a67cf964a10cbf8 ... # The temporary file to save gcc -MD generated dependencies must not ... Short version is $equals quiet, otherwise full command ...
    (Linux-Kernel)
  • Newbie needs help: Makefile Dependencies
    ... TARGET: DEPENDENCIES ... "COMMAND" for the case of the makefile for the program that I am ...
    (comp.unix.shell)
  • Re: Newbie needs help: Makefile Dependencies
    ... > figure out how to update an existing makefile. ... > immediate file dependencies. ... > files that your target is dependent on. ... which includes a command language, where parts are generated using 'lex' ...
    (comp.unix.shell)
  • Re: multiple target type makefile
    ... project that has multiple target programs as well as multiple libraries ... a static debug build is created while if the command ... make clean ... and in the makefile somewhere you have something like: ...
    (comp.lang.misc)
  • Re: [SLE] Makefle: *** missing separator. Stop
    ... > After the ./configure command I tried the make command. ... A target and action in a makefile is: ... there is an erroneous action line. ...
    (SuSE)