From 96fdf64c4c23d61eade6ea5f178b1ea4b418de86 Mon Sep 17 00:00:00 2001 From: Wesley Ellis Date: Wed, 26 Jun 2024 11:30:31 -0400 Subject: [PATCH] Check that color is valid Instead of merely checking that COLOR is set, check that it is one of RED, BLUE or GREEN --- make.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/make.mk b/make.mk index bb2d15377..00933d08a 100644 --- a/make.mk +++ b/make.mk @@ -213,6 +213,12 @@ ifndef COLOR $(error Set the COLOR variable to RED, BLUE, or GREEN depending on what board you have.) endif +COLOR_VALID := $(filter $(COLOR),RED BLUE GREEN) + +ifeq ($(COLOR_VALID),) +$(error COLOR must be RED, BLUE, or GREEN) +endif + ifeq ($(COLOR), BLUE) CFLAGS += -DWATCH_IS_BLUE_BOARD endif