regenerate.sh: only keep the generated files we actually need.

Also tidy up the script to reduce duplication.

Bug: http://b/139450866
Test: ./regenerate.sh && mm -j32
Change-Id: If02d8d7939ab7a8a3b289e57e081dca1bac040a4
19 files changed