[FROM] := a b c d e f g h i j k l m n o p q r s t u v w x y z - . [TO] := A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ _ UPPERCASE = $(strip $(eval __tmp := $1) \ $(foreach c, $(join $(addsuffix :,$([FROM])),$([TO])), \ $(eval __tmp := \ $(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)),\ $(__tmp)))) \ $(__tmp)) BOARD_CFLAGS += -DBOARD_$(call UPPERCASE,$(BOARD)) BOARD_ASMFLAGS += -DBOARD_$(call UPPERCASE,$(BOARD))
define FLASH_HELP @printf ' - %-25s %s\n' "flash" "flash '$(TARGET)' application" @printf ' - %-25s %s\n' "flash_mbr" "flash '$(TARGET)' MBR" @printf ' - %-25s %s\n' "erase" "chip erase" @printf ' - %-25s %s\n' "recover" "unlock protected device" endef HELP_MACROS += FLASH_HELP # Needed for the foreach loops to loop over the list of hooks, so that # each hook call is properly separated by a newline. define sep endef help: @echo "Most important targets:" @echo " - setup create build environment" ifneq ($(HELP_MACROS),) @echo "" @echo "Additional targets:" $(foreach p,$(HELP_MACROS), \ @echo ""$(sep) \ $(call $(p))$(sep) \ ) endif