Re: Seeking Makefile style suggestions

[email protected] (Paul Jarc)
Newsgroups gmane.comp.gnu.utils
Organization What did you have in mind? A short, blunt, human pyramid?
Message-ID <[email protected]>
Kirk Strauser <[email protected]> wrote:
> Is it idiomatic to do this by putting that in a target like so:
>
>   svnprops:
>         find $(CURDIR) -name '*.py' \
>                 -execdir svn ....
>
> or is there a more "native" way I could approach this?

That looks fine to me.  If you like, you could also make this target a
dependency of the main build target ("all", usually).

> Also, I'd really like to refactor all those identical calls into a
> variable that contains something like "svn propset -q", but I'm not sure
> how to get Make to split such a string into the command and its arguments
> instead of a command named exactly that.

Make never does the splitting; the shell does.  Make also doesn't do
quote removal; the shell does.  So...

>  For example, this snippet:
>
>   foo: TESTVAR = "echo this is a test"
>   foo:
>         $(TESTVAR)
>
> tries to run a command called "echo this is a test":

Use this instead:
foo: TESTVAR = echo this is a test


paul
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.