Mail Archives: djgpp/2005/06/25/05:01:38
arizvi <ahmadwaris AT hotmail DOT com> wrote:
> I dont understand how both rules are wrong. Afaik, the top rule states
> that test_view.o depends on test_view.cpp and infoDialog.cpp. So if
> infoDialog.cpp changes, test_view.cpp will be recompiled.
And that's exactly what's wrong. That's not how a C or C++ program is
built out of multiple source files. There should never be a need to
recompile one module file just because the _implementation_ of some
other module changed, but rather only if its _interface_ changed.
> What you are
> suggesting (let me know if I am wrong) is that the rules should be
> simply
> ./test_view.o:: test_view.cpp
> ./infoDialog.o:: infoDialog.cpp,
Not necessarily. test_view.cpp may depend on the header corresponding
to infoDialog.cpp, commonly called infoDialog.h. What you've written
so far suggests it probably should.
info_Dialog.o should almost certainly depend on this infoDialog.h, too.
> and then I lose the dependency I am looking for.
My point is exactly that this dependency must not exist --- you're
looking for the wrong thing.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -