From ae2edfdd6cc310aa4a5d667cccb02537c98609c0 Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Mon, 25 Jan 2016 15:49:15 +0800 Subject: [PATCH] Move maplookup routine up a bit so include Makefiles can also use it --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 887d715..3de40e1 100644 --- a/Makefile +++ b/Makefile @@ -138,6 +138,11 @@ endif #Define default target. If not defined here the one in the included Makefile is used as the default one. default-tgt: all +define maplookup +$(patsubst $(strip $(1)):%,%,$(filter $(strip $(1)):%,$(2))) +endef + + #Include options and target specific to the OUTPUT_TYPE include Makefile.$(OUTPUT_TYPE) @@ -153,10 +158,6 @@ INCDIR := $(addprefix -I,$(SRC_DIR)) EXTRA_INCDIR := $(addprefix -I,$(EXTRA_INCDIR)) MODULE_INCDIR := $(addsuffix /include,$(INCDIR)) -define maplookup -$(patsubst $(strip $(1)):%,%,$(filter $(strip $(1)):%,$(2))) -endef - ESP_FLASH_SIZE_IX=$(call maplookup,$(ESP_SPI_FLASH_SIZE_K),512:0 1024:2 2048:5 4096:6) ESPTOOL_FREQ=$(call maplookup,$(ESP_FLASH_FREQ_DIV),0:40m 1:26m, 2:20m 0xf:80m) ESPTOOL_MODE=$(call maplookup,$(ESP_FLASH_MODE),0:qio 1:qout 2:dio 3:dout)