bug-automake
[Top][All Lists]
Advanced

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

bug#32269: Expanding variables


From: Philip Prindeville
Subject: bug#32269: Expanding variables
Date: Wed, 25 Jul 2018 13:12:23 -0600

Since automake/autoconf are responsible for generating Makefiles, we could add 
something like:

val.%:
        @$(if $(filter undefined,$(origin $*)),\
                echo "$* undefined" >&2, \
                echo '$(subst ','"'"',$($*))' \
        )

var.%:
        @$(if $(filter undefined,$(origin $*)),\
                echo "$* undefined" >&2, \
                echo "$*='"'$(subst ','"'\"'\"'"',$($*))'"'" \
        )

toward the bottom.  Then if we found a line matching /\$(\([^)]+\))/ then we 
could look up “val.\1” from the match, and substitute that back in.  Obviously 
the more matches, the more iterations and the more “make -s val.\1” lookups.  
But at least it would work.

If we used a Perl helper, we could find ALL of the matches, and do ALL of the 
lookups at once in make for more constant time, since we’d do one make process 
per line regardless of how many substitutions were required.






reply via email to

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