[Top][All Lists]

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

Re: .DEFAULT_GOAL with two targets

From: Paul Smith
Subject: Re: .DEFAULT_GOAL with two targets
Date: Mon, 18 Dec 2017 11:38:54 -0500

On Mon, 2017-12-18 at 17:10 +0100, Gökçe Aydos wrote:
> I wanted to write a minimal Makefile with two targets:
> target1 target2:
>      echo $@
> clean:
>      rm $(.DEFAULT_GOAL)
> I noticed that .DEFAULT_GOAL [1] supports only one target name, so I  
> have to define a separate target with target{1,2} as prerequisites.
> Why does .DEFAULT_GOAL support only one target?

Because there can only ever be one default goal.  That's just the way
make works: the first target defined in the makefile is the default
goal, so there is only ever one.

I don't quite understand what you're trying to do here.  Why do you
always want to delete the single default goal, regardless of what was

reply via email to

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