%% Vasu S <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>          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


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to