summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-03-15 09:52:47 -0700
committerNathaniel Graff <nathaniel.graff@sifive.com>2019-03-15 09:52:47 -0700
commit23070ea89d17af8b4675ba1854910b604e89d9c5 (patch)
tree9e7efbd3f50137ef139a158e4e61dd930f6b7ba7 /Makefile
parent7083079297ea072a5a76b07ab53785372442d01f (diff)
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 <nathaniel.graff@sifive.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 17 insertions, 0 deletions
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/.*\///')