scons: Generalize building binaries.
authorGabe Black <gabeblack@google.com>
Thu, 7 Jun 2018 04:01:29 +0000 (21:01 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 26 Jun 2018 00:15:12 +0000 (00:15 +0000)
commit6df90da9fb701eea8381a35423d0c9e7bc940850
tree88c46db4fd0e127259f661b74ab317e86a8c5831
parent1678a08ded7e00049f4335d856c91043904002f7
scons: Generalize building binaries.

Building gem5 binaries or regression test binaries needs to be done
from within the make_env function which builds an environment for each
flavor of build (opt, fast, debug, etc.). That makes it impossible to
add new types of binaries without modifying the central SConscript.

This change refactors how binaries are set up so that the class that
represents them handles the details of how the binary should be built.
Also, a metaclass and some lists track types of binaries and individual
instances of binaries so that they can be iterated over automatically
in make_env.

Each new executable class can define a declare_all class function which
calls declare() on individual instances. declare_all is a place to do
any processing that only has to happen once (for instance specializing
the environment) for a particular family of executables.

Change-Id: I8a6ee9438280cd67e6c0b92ca28738a53cb16950
Reviewed-on: https://gem5-review.googlesource.com/10915
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
src/SConscript