Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Nov 2004 13:32:42 -0600
From:      "Conrad J. Sabatier" <conrads@cox.net>
To:        Gert Cuykens <gert.cuykens@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Make Depend
Message-ID:  <20041127133242.52ca4bd1@dolphin.local.net>
In-Reply-To: <ef60af0904112700432d7d2db@mail.gmail.com>
References:  <ef60af0904112700432d7d2db@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 27 Nov 2004 09:43:17 +0100, Gert Cuykens
<gert.cuykens@gmail.com> wrote:

> "A Makefile rule that typically scans all C/C++ source files in a
> directory, and generates rules that indicate that an object file
> depends on certain header files, and must be recompiled if they are
> recompiled."
> 
> i dont understand this. how can a object depend on something that is
> not compiled yet? Would the freebsd world not be a happier place if
> make did the dependancy thingies what ever they are automatically ?

Yes, it certainly would be a happier place.  :-)  And it would be great,
too, if I could interface with my computer purely by voice control and
synthesized speech feedback, and have it do what I *mean* and not what I
say.  :-)

But alas, computers are not *that* smart yet.  They still need a little
help from us humans (actually, a *lot* of help).  :-)

Re: dependencies, it should be simple to understand if you give it a
moment's thought.  Let's say you have a file "main.c" that calls
functions in "foo.c".  In order for main.c to compile and link properly
to create a complete, executable program, it's absolutely essential that
foo.c be compiled and linked in as well.

What Makefile dependencies are about is ensuring that, if a change is
made to foo.c, it will be recompiled and relinked with main.c to
guarantee that the final executable is up to date in all respects.

Does that help?  :-)

-- 
Conrad J. Sabatier <conrads@cox.net> -- "In Unix veritas"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041127133242.52ca4bd1>