From 23070ea89d17af8b4675ba1854910b604e89d9c5 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Fri, 15 Mar 2019 09:52:47 -0700 Subject: Add the list-target-tags make target `make list-target-tags` returns a list of all unique values in TARGET_TAGS for all of the BSPs. Signed-off-by: Nathaniel Graff --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Makefile b/Makefile index c97db4c..4003189 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,23 @@ MATCHING_TARGETS = $(patsubst $(TARGET_ROOT)/bsp/%/,%,$(dir $(MATCHING_SETTINGS) list-targets: @echo bsp-list: $(sort $(MATCHING_TARGETS)) +# Lists all available TARGET_TAGS +# +# 1. Find all settings.mk +# 2. Extract the TARGET_TAGS line +# 3. Extract the value of TARGET_TAGS +# 4. Split each tag onto a newline +# 5. Sort the lines +# 6. Find unique tags +# +list-target-tags: + @echo target-tags: $(shell find $(TARGET_ROOT)/bsp -name settings.mk | \ + xargs grep -he "TARGET_TAGS" | \ + sed -r 's/TARGET_TAGS.*=(.*)/\1/' | \ + tr ' ' '\n' | \ + sort | \ + uniq) + # Metal programs are any submodules in the software folder list-programs: @echo program-list: $(shell grep -o '= software/.*$$' .gitmodules | sed 's/.*\///') -- cgit v1.2.3