help-make
[Top][All Lists]
Advanced

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

Re: weird error(?) in "-f" option ????


From: Paul D. Smith
Subject: Re: weird error(?) in "-f" option ????
Date: Mon, 15 Dec 2003 22:19:33 -0500

%% "Robert P. J. Day" <address@hidden> writes:

  rpjd> ok, i've just run across something that is confusing the heck
  rpjd> out of me.  in testing the snippet in the make manual for
  rpjd> overriding part of another makefile, i wrote the following
  rpjd> makefile:

  rpjd> $ cat mk1
  rpjd> foo:
  rpjd>         @echo building foo in mk1.
  rpjd>         @touch foo
  rpjd> %: force
  rpjd>         @echo Invoking makefile mk2 for target address@hidden
  rpjd>         @${MAKE} -f mk2 $@
  rpjd> force: ;


  rpjd> i also have a trivial "mk2" file, but what's baffling is what happens
  rpjd> when i run the following command:

  rpjd> $ make -f mk1 foo
  rpjd> Invoking makefile mk2 for target mk1.        ????  what the ... ????

  rpjd> how is it that the value of the "-f" option is being picked up
  rpjd> as a *target* to be processed in that first makefile mk1?  i'm
  rpjd> confused.  am i doing something thoroughly stupid here?  i have
  rpjd> no idea how to interpret this output.

Check the GNU make manual section "How Makefiles Are Remade" in the
chapter on "Writing Makefiles".

-- 
-------------------------------------------------------------------------------
 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]