]> git.earman.xyz Git - sensor-watch.git/commitdiff
Check that color is valid
authorWesley Ellis <tahnok@gmail.com>
Wed, 26 Jun 2024 15:30:31 +0000 (11:30 -0400)
committerWesley Ellis <tahnok@gmail.com>
Wed, 26 Jun 2024 15:30:31 +0000 (11:30 -0400)
Instead of merely checking that COLOR is set, check that it is one of
RED, BLUE or GREEN

make.mk

diff --git a/make.mk b/make.mk
index bb2d153775e02321429eca20760552a6064f5e11..00933d08af53c3e09a4c7b4511e2523e24146a2d 100644 (file)
--- 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