help-make
[Top][All Lists]
Advanced

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

Re: Target's & Prerequisite's order


From: Paul D. Smith
Subject: Re: Target's & Prerequisite's order
Date: Tue, 10 Jun 2003 10:05:53 -0400

%% "S kris" <address@hidden> writes:

  sk> B: D
  sk> #some commands for target B
  sk> .........

  sk> A: B C
  sk> #some commands for target A

  sk> When I try the above makefile with make command, only target B is
  sk> obtained but not target A. I know that I would get target A when
  sk> A: B C is put before B: D statement. But I would like to get
  sk> target A maintaining the same order as shown above. How to get
  sk> this?

When you run "make", make will always update the first target found in
the makefile, and _only_ that target.

If you want to update a different target, you can give that target on
the command line, like "make A".


If you don't want to do that and you want "A" to be built by default,
you'll have to mention "A" as the first target.  There's no other way.

Of course, you don't have to define a _rule_ to build "A" then, it just
has to be mentioned as the first target.  You could do this:


  A:

  B: D
        #some commands for target B

  A: B C
        #some commands for target A

and that would work.

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