make(1): Create two more custom variables to speed up dports
authorJohn Marino <draco@marino.st>
Sat, 28 Nov 2015 01:39:15 +0000 (02:39 +0100)
committerJohn Marino <draco@marino.st>
Sat, 28 Nov 2015 01:50:33 +0000 (02:50 +0100)
commita4cce4724800c9180e886281d6ba9952f7690528
treeb7b202d7945fc9c664d890e3d7b909140562092f
parentf9dc6f4420afa274bb41ddafc1109b068003050b
make(1): Create two more custom variables to speed up dports

I've added two new static values to bmake:

.MAKE.DF.OSREL
This will currently return "4.5"

.MAKE.DF.VERSION
This will currently return "400500".  It matches what was in place on
/usr/src/sys/sys/param.h during the last buildworld.

Every dport runs piped shell commands to get these values. After iterating
through the entire ports tree several times, I noticed a large presence
of awk in process list.  After modifying bmake and then modifying dports
locally, the iteration runs 15% faster.  There are other optimizations
that can be done, but that's out of scope of this commit.
contrib/bmake/bmake.1
contrib/bmake/main.c
usr.bin/bmake/Makefile