help-gnu-utils
[Top][All Lists]
Advanced

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

Re: Makefile target selection


From: Jens . Toerring
Subject: Re: Makefile target selection
Date: 11 Jul 2004 14:28:30 GMT
User-agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.4.16 (i686))

In comp.unix.programmer zuheyr alsalihi <zuheyr@skynet.be> wrote:
> Is there any way to know in a Makefile which target is wanted to build?
> E.g. if I have targets all, A and B, how can I use conditionals in the
> Makefile depening on the target?

The MAKECMDGOALS variable is automatically set to the list of
goals (i.e. targets) you specified on the command line. So you
can do something like

ifeq($MAKECMDGOALS,all)
   do something
endif

Take care, it seems to be GNU make specific.

                                  Regards, Jens
-- 
  \   Jens Thoms Toerring  ___  Jens.Toerring@physik.fu-berlin.de
   \__________________________  http://www.toerring.de


reply via email to

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