Skip to content

Commit

Permalink
Check that color is valid
Browse files Browse the repository at this point in the history
Instead of merely checking that COLOR is set, check that it is one of
RED, BLUE or GREEN
  • Loading branch information
tahnok committed Jun 26, 2024
1 parent 439843f commit 96fdf64
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions make.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96fdf64

Please sign in to comment.