automake
[Top][All Lists]
Advanced

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

Re: Automake Digest, Vol 175, Issue 3


From: Kip Warner
Subject: Re: Automake Digest, Vol 175, Issue 3
Date: Thu, 07 Sep 2017 18:23:55 -0700

On Tue, 2017-09-05 at 18:57 -0400, Nick Bowler wrote:
> If your only uses of the directoryless-filenames are in rules, then
> just write the names including directories in the make variables,
> then strip off the directory components inside the rule.  In rules
> you can use the much more powerful shell constructs.

Hey Nick.

> Example:
> 
>   % cat >Makefile <<'EOF'
>   FOO = a b/c d/e/f
> 
>   my_rule:
>       for i in $(FOO); do \
>         case $$i in */*) i=`expr "$$i" : '.*/\(.*\)'`; esac; \
>         printf '%s\n' "$$i"; \
>       done
> EOF
>   % make my_rule
>   a
>   c
>   f

This would work beautifully, except the short version of the file names
has to be computed in advance for the _SOURCES Automake primary as
Thomas hinted at. I'm not sure how Automake parses those variables, but
I'm assuming they have to be computed in advance if you're also using
them outside of a rule.

-- 
Kip Warner | Senior Software Engineer
OpenPGP signed/encrypted mail preferred
http://www.thevertigo.com

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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