help-make
[Top][All Lists]
Advanced

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

Re: how does .default work ?


From: Paul D. Smith
Subject: Re: how does .default work ?
Date: Mon, 31 Mar 2003 12:35:52 -0500

%% Matthias Odisio <address@hidden> writes:

  mo> After immerging myself in the manual and checking the archive, I'm still 
  mo> unable to get the following makefile works as I'd want :

  mo> .DEFAULT: all

The GNU make manual says:

  `.DEFAULT'
       The commands specified for `.DEFAULT' are used for any target for
       which no rules are found (either explicit rules or implicit rules).
       *Note Last Resort::.  If `.DEFAULT' commands are specified, every
       file mentioned as a prerequisite, but not as a target in a rule,
       will have these commands executed on its behalf.

You don't provide any commands for the .DEFAULT target, so it's a
no-op.  Note nowhere does it say that "prerequisites of the .DEFAULT
target will be used as prerequisites for the targets for which no rules
are found", and in fact they are not.  Prerequisites are ignored.

  mo> What should I do so as 'make' and 'make foo' both result in 'make all' ?

You would have to do something like this, I guess:

  .DEFAULT:
        $(MAKE) all

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