diff --git a/make/mcu-defs.mk b/make/mcu-defs.mk index 5eb4d4bd..f32c972d 100644 --- a/make/mcu-defs.mk +++ b/make/mcu-defs.mk @@ -8,16 +8,18 @@ include $(MODDIR)/make/mcu-tags.mk -ifeq ($(MCU_BOARD_MODEL),) - $(error MCU_BOARD_MODEL not specified) -endif - -ifeq ($(MCU_FLASH_OFFSET),) - $(error MCU_FLASH_OFFSET not specified) -endif - -ifeq ($(MCU_FLASH_SIZE),) - $(error MCU_FLASH_SIZE not specified) +ifneq ($(MAKECMDGOALS),clean) + ifeq ($(MCU_BOARD_MODEL),) + $(error MCU_BOARD_MODEL not specified) + endif + + ifeq ($(MCU_FLASH_OFFSET),) + $(error MCU_FLASH_OFFSET not specified) + endif + + ifeq ($(MCU_FLASH_SIZE),) + $(error MCU_FLASH_SIZE not specified) + endif endif MCU_PRODUCT_TMPL_DIR ?= $(MODDIR)/tmpl/products