Boost logo

Boost-Build :

Subject: Re: [Boost-build] How to remove code duplication from Jamfile
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-03-30 10:31:59


On Tuesday 30 March 2010 11:13:37 Евгений Шубин wrote:

>
> Fri, 19 Mar 2010 19:06:19 +0300 письмо от Vladimir Prus <ghost_at_[hidden]>:
>
> > You can put this in Jamroot:
> >
> > constant JAMROOT : $(__name__) ;
> > actions transform-script
> > {
> > sed "s_at_PREFIX@$(INSTALL_PATH)@g" $(>) | sed "s_at_NAME@$(DAEMON_NAME)@g" > $(<)
> > }
> >
> > rule your-install ( DAEMON_NAME )
> > {
> > alias install : install-bin install-conf $(INSTALL_PATH)/scripts/$(DAEMON_NAME) ;
> > install install-bin : $(DAEMON_NAME) : <location>$(INSTALL_PATH)/bin ;
> > install install-conf : ../../conf/$(DAEMON_NAME).conf : <location>$(INSTALL_PATH)/conf ;
> >
> > make $(INSTALL_PATH)/scripts/$(DAEMON_NAME) : ../../scripts/rc_script.freebsd : @$(JAMROOT).transform-script ;
> > }
> >
> > and then have:
> >
> > your-install some-daemon ;
> >
> > inside Jamfile for each component. Does this work?
>
> Is there any way to call "your-install some-daemon" explicit?

What do you mean "call explicit"? 'your-install' is a function, which
is called just like in any other language. It's metatarget that can
be explicit. If you want to make a metatarget explicit, you call
the 'explicit' function passing the name of the metatarget to it.
For example:

        explicit install install-bin ;

Does this help?

- Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk