converters.mk (1291B)
1 # Remove whitespace from any rule.mk provided vars 2 # - env cannot be overwritten but cannot have whitespace anyway 3 CONVERT_TO:=$(strip $(CONVERT_TO)) 4 ifneq ($(CONVERT_TO),) 5 6 # stash so we can overwrite env provided vars if needed 7 ACTIVE_CONVERTER=$(CONVERT_TO) 8 9 ifeq ($(PIN_COMPATIBLE),) 10 $(call CATASTROPHIC_ERROR,Converting to '$(CONVERT_TO)' not possible!) 11 endif 12 13 # glob to search each platfrorm and/or check for valid converter 14 CONVERTER := $(wildcard $(PLATFORM_PATH)/*/converters/$(PIN_COMPATIBLE)_to_$(CONVERT_TO)/) 15 ifeq ($(CONVERTER),) 16 $(call CATASTROPHIC_ERROR,Converting from '$(PIN_COMPATIBLE)' to '$(CONVERT_TO)' not possible!) 17 endif 18 19 -include $(CONVERTER)/pre_converter.mk 20 21 PLATFORM_KEY = $(shell echo $(CONVERTER) | cut -d "/" -f2) 22 23 # Configure any defaults 24 OPT_DEFS += -DCONVERT_TO_$(shell echo $(CONVERT_TO) | tr '[:lower:]' '[:upper:]') 25 OPT_DEFS += -DCONVERTER_TARGET=\"$(CONVERT_TO)\" 26 OPT_DEFS += -DCONVERTER_ENABLED 27 VPATH += $(CONVERTER) 28 29 # Configure for "alias" - worst case it produces an idential define 30 OPT_DEFS += -DCONVERT_TO_$(shell echo $(ACTIVE_CONVERTER) | tr '[:lower:]' '[:upper:]') 31 32 # Finally run any converter specific logic 33 include $(CONVERTER)/converter.mk 34 endif