bsd.java.mk removing != assignments
Chris Rees
utisoft at gmail.com
Wed Feb 20 19:04:09 UTC 2013
Hi all,
Way back, when kris@ was working on speeding up make index, he
replaced many of the != assignments in bsd.java.mk with clever sh
incantations.
His reasoning was that you can't use make's variable modifiers with
variables; i.e. one cannot use ${FOO:M${BAR}} where BAR is a variable.
However... because inside a for loop the variables are simply replaced
with strings, one *can* use these variables in this way;
FOO=jamaica ecuador java
BAR=ecuador
.for b in ${BAR}
COFFEE=${FOO:M$b}
.endfor
returns ${COFFEE} containing ecuador.
tl;dr, one can replace the != sh magic with the equivalent and much
shorter make logic in the two patches [1,2].
At the same time, I've removed the final != assignments in the
variable checking section and replaced them with the equivalent Make
idiom [3].
A svn diff of all the changes together is at [4]. I've done some
basic testing, but what else would be needed to implement these
changes?
[I'll also do some make index benchmarks to see what speed difference it makes].
Chris
[1] http://www.bayofrum.net/cgi-bin/fossil/portsMk/fdiff?v1=1bb44aeca134c2d0&v2=4f75cb395c347169
[2] http://www.bayofrum.net/cgi-bin/fossil/portsMk/fdiff?v1=4f75cb395c347169&v2=521279991ab2810b
[3] http://www.bayofrum.net/cgi-bin/fossil/portsMk/fdiff?v1=521279991ab2810ba6f2297164ddf044ec4c972b&v2=899672c495f90022612ee78c53bcc91866e1edf9
[4] http://www.bayofrum.net/~crees/patches/bsd-java-mk-remove-bang.diff
More information about the freebsd-java
mailing list