meta data for this page
  •  
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


programming:makefile:snippets:uppercase [2024/05/22 11:59] (current) – created niziak
Line 1: Line 1:
 +====== UPPERCASE ======
 +
 +<code make>
 +[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))
 +</code>