help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with two makefiles


From: Paul D. Smith
Subject: Re: problem with two makefiles
Date: Tue, 13 Sep 2005 09:27:33 -0400

%% Vasu S <address@hidden> writes:

  vs> (Makefile)

  vs> TARGET: $(DEST)/lib.a
  vs>       $MAKE -f Makefile.bld LIB

You have $(MAKE) here, not $MAKE, I'm sure.  Please be accurate when
posting questions as even small differences in syntax can make a huge
difference in the results.

This says to make: "If the file $(DEST)/lib.a is newer than the file
TARGET, run the $(MAKE) command."

  vs> (Makefile.bld)

  vs> LIB:
  vs>       $INSTALL -f lib.a

Again, you probably have $(INSTALL) here, not $INSTALL.

This says to make: "If the file LIB does not exist, then run the
$(INSTALL) command".

  vs> If I do make, INSTALL command is getting executed even though the
  vs> lib.a is upto date.

Maybe the above helps you understand why: as long as the file TARGET
does not exist, $(DEST)/lib.a will ALWAYS be newer, so the $(MAKE)
command will ALWAYS run.

Ditto for the other: as long as the file LIB does not exist, $(INSTALL)
will ALWAYS be run.

  vs> If I write the Makefile like:

  vs> (Makefile)

  vs> TARGET: $(DEST)/lib.a
  vs>           $INSTALL -f lib.a 

  vs> then INSTALL command is getting executed only if lib.a is rebuilt.

I don't think that's true, based on what you've written here.  If it
true is then you've paraphrased the actual makefiles you're using so
much that the information we need to understand your problem has been
lost, and we can't help.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]