From d11554c88fdf1b6a9cad1c4c1252f27995117378 Mon Sep 17 00:00:00 2001 From: TiborGY Date: Mon, 31 Dec 2018 23:19:44 +0100 Subject: [PATCH] Validate user supplied TARGET (#1941) the build will now abort with an error message when an undefined build TARGET is named Fixes #1938 --- Makefile.system | 1 + getarch.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Makefile.system b/Makefile.system index fb8e7ea41..20d4f6492 100644 --- a/Makefile.system +++ b/Makefile.system @@ -65,6 +65,7 @@ endif ifdef TARGET GETARCH_FLAGS := -DFORCE_$(TARGET) +GETARCH_FLAGS += -DUSER_TARGET endif # Force fallbacks for 32bit diff --git a/getarch.c b/getarch.c index 146f1f36f..78ba0fefd 100644 --- a/getarch.c +++ b/getarch.c @@ -1068,6 +1068,10 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef FORCE +#ifdef USER_TARGET +#error "The TARGET specified on the command line or in Makefile.rule is not supported. Please choose a target from TargetList.txt" +#endif + #if defined(__powerpc__) || defined(__powerpc) || defined(powerpc) || \ defined(__PPC__) || defined(PPC) || defined(_POWER) || defined(__POWERPC__) #ifndef POWER