Simplify $(shell) use

This accounts for 20 instances of $(shell) that need to be rerun even if
we aren't regenerating the makefiles. Reimplement using standard
functions and macros that we can optimize for.

Test: Manual verification, the lists only differ based on sorting (it
      was random filesystem order before)
Change-Id: I797c9cd3b883db1f2801d85bf20bc1412b19eec6
2 files changed