bug-make
[Top][All Lists]
Advanced

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

Re: Condtional target-specific variable assignment does not work as expe


From: Philip Guenther
Subject: Re: Condtional target-specific variable assignment does not work as expected
Date: Fri, 9 Aug 2013 13:53:25 -0700

On Fri, Aug 9, 2013 at 12:59 PM, Ed Hutchins <address@hidden> wrote:
...
> In my case I'd like to have "init", "start" and "start_clean" end-user
> targets which reuse common
> targets which in turn depend on targets specified by the above semantic
> intent. If there were a
> true order-only operator (say ||), I could do:
>
> .PHONY: <all of the below>
>
> init_server: <some initialization for a running server>
> start_server: <start a server and load existing database info>
> start_clean_server: <start a server and create a clean database>
> common: || init_server start_server start_clean_server
> init: init_server common
> start: start_server common
> start_clean: start_server common
>
> If I try the above with the current order-only | operator all three 
> dependencies are
> invoked by common. Is there a way to get the effect of the above that anyone 
> can think of?

Sounds to me like the commands currently in 'common' should be saved
in a macro which is used by the 'init', 'start', and 'start_clean'
targets and the 'common' target itself eliminated.  Indeed, the same
may be true of 'init_server', 'start_server', and
'start_clean_server', particularly if they don't have any
dependencies.  How is making them targets useful?


Philip Guenther



reply via email to

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