From d37673be9f7c3c0daab596f8957572260cfb2be4 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 24 Mar 2022 17:28:26 -0700 Subject: [PATCH] scons: Remove the default-default build target. In gem5, there are many equally valid and equally useful top level targets which the user might want. It no longer makes sense to arbitrarily pick one to be the default target. It makes sense to force the user to actually specify what they want, instead of assuming it must be the ARM debug binary. There is currently an M5_DEFAULT_BINARY environment variable which will change what the default binary is, if set. This change leaves that in place, but removes the default-default, or in other words the default that is used if M5_DEFAULT_BINARY is not set. This way if the user knows what default they want, they can specify it locally in their environment and avoid having to type it over and over again, but we're not making an arbitrary choice at a more global level without the context to know what actually makes sense. Change-Id: I886adb1289b9879d53387250f950909a4809ed8b --- SConstruct | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index c4782691ff..44b3e8f795 100755 --- a/SConstruct +++ b/SConstruct @@ -196,7 +196,14 @@ if not ('CC' in main and 'CXX' in main): error("No C++ compiler installed (package g++ on Ubuntu and RedHat)") # Find default configuration & binary. -Default(environ.get('M5_DEFAULT_BINARY', 'build/ARM/gem5.debug')) +default_target = environ.get('M5_DEFAULT_BINARY', None) +if default_target: + Default(default_target) + +# If no target is set, even a default, print help instead. +if not BUILD_TARGETS: + warning("No target specified, and no default.") + SetOption('help', True) buildopts_dir = Dir('#build_opts') buildopts = list([f for f in os.listdir(buildopts_dir.abspath) if