meta data for this page
  •  

Differences

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

Link to this comparison view

programming:makefile:snippets:uppercase [2024/05/22 11:59] – created niziakprogramming:makefile:snippets:uppercase [2024/08/23 11:56] (current) niziak
Line 17: Line 17:
 BOARD_ASMFLAGS += -DBOARD_$(call UPPERCASE,$(BOARD)) BOARD_ASMFLAGS += -DBOARD_$(call UPPERCASE,$(BOARD))
 </code> </code>
 +
 +====== HELP macros ======
 +
 +<code make>
 +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
 +</code>
 +