From 77954fc86e0236d90a8b171200b77198baa362ec Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Thu, 14 Mar 2019 13:36:25 -0700 Subject: Create TARGET_TAGS Signed-off-by: Nathaniel Graff --- bsp/coreip-e20-arty/settings.mk | 2 ++ bsp/coreip-e20-rtl/settings.mk | 2 ++ bsp/coreip-e21-arty/settings.mk | 2 ++ bsp/coreip-e21-rtl/settings.mk | 2 ++ bsp/coreip-e24-arty/settings.mk | 2 ++ bsp/coreip-e24-rtl/settings.mk | 2 ++ bsp/coreip-e31-arty/settings.mk | 2 ++ bsp/coreip-e31-rtl/settings.mk | 2 ++ bsp/coreip-e34-arty/settings.mk | 2 ++ bsp/coreip-e34-rtl/settings.mk | 2 ++ bsp/coreip-e76-arty/settings.mk | 2 ++ bsp/coreip-e76-rtl/settings.mk | 2 ++ bsp/coreip-s51-arty/settings.mk | 2 ++ bsp/coreip-s51-rtl/settings.mk | 2 ++ bsp/coreip-s54-arty/settings.mk | 2 ++ bsp/coreip-s54-rtl/settings.mk | 2 ++ bsp/coreip-s76-arty/settings.mk | 2 ++ bsp/coreip-s76-rtl/settings.mk | 2 ++ bsp/freedom-e310-arty/settings.mk | 2 ++ bsp/sifive-hifive1-revb/settings.mk | 2 ++ bsp/sifive-hifive1/settings.mk | 2 ++ 21 files changed, 42 insertions(+) diff --git a/bsp/coreip-e20-arty/settings.mk b/bsp/coreip-e20-arty/settings.mk index 31143b5..9d61abe 100644 --- a/bsp/coreip-e20-arty/settings.mk +++ b/bsp/coreip-e20-arty/settings.mk @@ -1,2 +1,4 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 + +TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-e20-rtl/settings.mk b/bsp/coreip-e20-rtl/settings.mk index 1ac4d9f..19a7b2b 100644 --- a/bsp/coreip-e20-rtl/settings.mk +++ b/bsp/coreip-e20-rtl/settings.mk @@ -4,3 +4,5 @@ RISCV_ARCH=rv32imc RISCV_ABI=ilp32 RISCV_CMODEL=medlow COREIP_MEM_WIDTH=32 + +TARGET_TAGS=rtl diff --git a/bsp/coreip-e21-arty/settings.mk b/bsp/coreip-e21-arty/settings.mk index 31143b5..9d61abe 100644 --- a/bsp/coreip-e21-arty/settings.mk +++ b/bsp/coreip-e21-arty/settings.mk @@ -1,2 +1,4 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 + +TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-e21-rtl/settings.mk b/bsp/coreip-e21-rtl/settings.mk index 32bb84d..c3f98c4 100644 --- a/bsp/coreip-e21-rtl/settings.mk +++ b/bsp/coreip-e21-rtl/settings.mk @@ -4,3 +4,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow COREIP_MEM_WIDTH=32 + +TARGET_TAGS=rtl diff --git a/bsp/coreip-e24-arty/settings.mk b/bsp/coreip-e24-arty/settings.mk index 829d3e8..0b9c2cb 100644 --- a/bsp/coreip-e24-arty/settings.mk +++ b/bsp/coreip-e24-arty/settings.mk @@ -1,3 +1,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow + +TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-e24-rtl/settings.mk b/bsp/coreip-e24-rtl/settings.mk index 32bb84d..c3f98c4 100644 --- a/bsp/coreip-e24-rtl/settings.mk +++ b/bsp/coreip-e24-rtl/settings.mk @@ -4,3 +4,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow COREIP_MEM_WIDTH=32 + +TARGET_TAGS=rtl diff --git a/bsp/coreip-e31-arty/settings.mk b/bsp/coreip-e31-arty/settings.mk index 829d3e8..0b9c2cb 100644 --- a/bsp/coreip-e31-arty/settings.mk +++ b/bsp/coreip-e31-arty/settings.mk @@ -1,3 +1,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow + +TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-e31-rtl/settings.mk b/bsp/coreip-e31-rtl/settings.mk index 32bb84d..c3f98c4 100644 --- a/bsp/coreip-e31-rtl/settings.mk +++ b/bsp/coreip-e31-rtl/settings.mk @@ -4,3 +4,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow COREIP_MEM_WIDTH=32 + +TARGET_TAGS=rtl diff --git a/bsp/coreip-e34-arty/settings.mk b/bsp/coreip-e34-arty/settings.mk index 829d3e8..0b9c2cb 100644 --- a/bsp/coreip-e34-arty/settings.mk +++ b/bsp/coreip-e34-arty/settings.mk @@ -1,3 +1,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow + +TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-e34-rtl/settings.mk b/bsp/coreip-e34-rtl/settings.mk index 32bb84d..c3f98c4 100644 --- a/bsp/coreip-e34-rtl/settings.mk +++ b/bsp/coreip-e34-rtl/settings.mk @@ -4,3 +4,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow COREIP_MEM_WIDTH=32 + +TARGET_TAGS=rtl diff --git a/bsp/coreip-e76-arty/settings.mk b/bsp/coreip-e76-arty/settings.mk index 31143b5..9d61abe 100644 --- a/bsp/coreip-e76-arty/settings.mk +++ b/bsp/coreip-e76-arty/settings.mk @@ -1,2 +1,4 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 + +TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-e76-rtl/settings.mk b/bsp/coreip-e76-rtl/settings.mk index fd049f4..4a9e97f 100644 --- a/bsp/coreip-e76-rtl/settings.mk +++ b/bsp/coreip-e76-rtl/settings.mk @@ -4,3 +4,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow COREIP_MEM_WIDTH=64 + +TARGET_TAGS=rtl diff --git a/bsp/coreip-s51-arty/settings.mk b/bsp/coreip-s51-arty/settings.mk index 3f994a3..2832d7c 100644 --- a/bsp/coreip-s51-arty/settings.mk +++ b/bsp/coreip-s51-arty/settings.mk @@ -1,3 +1,5 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 RISCV_CMODEL=medany + +TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-s51-rtl/settings.mk b/bsp/coreip-s51-rtl/settings.mk index a3cd0bb..78ef056 100644 --- a/bsp/coreip-s51-rtl/settings.mk +++ b/bsp/coreip-s51-rtl/settings.mk @@ -2,3 +2,5 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 COREIP_MEM_WIDTH=64 RISCV_CMODEL=medany + +TARGET_TAGS=rtl diff --git a/bsp/coreip-s54-arty/settings.mk b/bsp/coreip-s54-arty/settings.mk index ab3b474..684f76d 100644 --- a/bsp/coreip-s54-arty/settings.mk +++ b/bsp/coreip-s54-arty/settings.mk @@ -1,3 +1,5 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 iRISCV_CMODEL=medany + +TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-s54-rtl/settings.mk b/bsp/coreip-s54-rtl/settings.mk index fabb838..e6b6330 100644 --- a/bsp/coreip-s54-rtl/settings.mk +++ b/bsp/coreip-s54-rtl/settings.mk @@ -2,3 +2,5 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 RISCV_CMODE=medany COREIP_MEM_WIDTH=64 + +TARGET_TAGS=rtl diff --git a/bsp/coreip-s76-arty/settings.mk b/bsp/coreip-s76-arty/settings.mk index 1627f4b..3c7d718 100644 --- a/bsp/coreip-s76-arty/settings.mk +++ b/bsp/coreip-s76-arty/settings.mk @@ -1,2 +1,4 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 + +TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-s76-rtl/settings.mk b/bsp/coreip-s76-rtl/settings.mk index a7d8dfa..4aeb6b5 100644 --- a/bsp/coreip-s76-rtl/settings.mk +++ b/bsp/coreip-s76-rtl/settings.mk @@ -2,3 +2,5 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 RISCV_CMODEL=medany COREIP_MEM_WIDTH=64 + +TARGET_TAGS=rtl diff --git a/bsp/freedom-e310-arty/settings.mk b/bsp/freedom-e310-arty/settings.mk index b7a7782..a2774d2 100644 --- a/bsp/freedom-e310-arty/settings.mk +++ b/bsp/freedom-e310-arty/settings.mk @@ -3,3 +3,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODE=medlow + +TARGET_TAGS=fpga openocd diff --git a/bsp/sifive-hifive1-revb/settings.mk b/bsp/sifive-hifive1-revb/settings.mk index 61e2b02..d0c3628 100644 --- a/bsp/sifive-hifive1-revb/settings.mk +++ b/bsp/sifive-hifive1-revb/settings.mk @@ -2,3 +2,5 @@ RISCV_ARCH = rv32imac RISCV_ABI = ilp32 RISCV_CMODEL = medlow SEGGER_JLINK_OB = 1 + +TARGET_TAGS=board jlink diff --git a/bsp/sifive-hifive1/settings.mk b/bsp/sifive-hifive1/settings.mk index fd73559..ba1ed20 100644 --- a/bsp/sifive-hifive1/settings.mk +++ b/bsp/sifive-hifive1/settings.mk @@ -1,3 +1,5 @@ RISCV_ARCH = rv32imac RISCV_ABI = ilp32 RISCV_CMODEL = medlow + +TARGET_TAGS=board openocd -- cgit v1.2.3 From 72efc798890672897fd54332d29afb0956a1c73e Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Thu, 14 Mar 2019 13:42:04 -0700 Subject: Fix typos and formatting in settings.mk Signed-off-by: Nathaniel Graff --- bsp/coreip-e20-arty/settings.mk | 1 + bsp/coreip-e20-rtl/settings.mk | 3 +-- bsp/coreip-e21-arty/settings.mk | 1 + bsp/coreip-e21-rtl/settings.mk | 3 +-- bsp/coreip-e24-rtl/settings.mk | 3 +-- bsp/coreip-e31-rtl/settings.mk | 3 +-- bsp/coreip-e34-rtl/settings.mk | 3 +-- bsp/coreip-e76-arty/settings.mk | 1 + bsp/coreip-e76-rtl/settings.mk | 3 +-- bsp/coreip-s51-rtl/settings.mk | 3 ++- bsp/coreip-s54-arty/settings.mk | 2 +- bsp/coreip-s54-rtl/settings.mk | 3 ++- bsp/coreip-s76-arty/settings.mk | 1 + bsp/coreip-s76-rtl/settings.mk | 1 + bsp/freedom-e310-arty/settings.mk | 4 +--- bsp/sifive-hifive1-revb/settings.mk | 9 +++++---- bsp/sifive-hifive1/settings.mk | 6 +++--- 17 files changed, 25 insertions(+), 25 deletions(-) diff --git a/bsp/coreip-e20-arty/settings.mk b/bsp/coreip-e20-arty/settings.mk index 9d61abe..0b9c2cb 100644 --- a/bsp/coreip-e20-arty/settings.mk +++ b/bsp/coreip-e20-arty/settings.mk @@ -1,4 +1,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 +RISCV_CMODEL=medlow TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-e20-rtl/settings.mk b/bsp/coreip-e20-rtl/settings.mk index 19a7b2b..699498e 100644 --- a/bsp/coreip-e20-rtl/settings.mk +++ b/bsp/coreip-e20-rtl/settings.mk @@ -1,8 +1,7 @@ -#write_config_file - RISCV_ARCH=rv32imc RISCV_ABI=ilp32 RISCV_CMODEL=medlow + COREIP_MEM_WIDTH=32 TARGET_TAGS=rtl diff --git a/bsp/coreip-e21-arty/settings.mk b/bsp/coreip-e21-arty/settings.mk index 9d61abe..0b9c2cb 100644 --- a/bsp/coreip-e21-arty/settings.mk +++ b/bsp/coreip-e21-arty/settings.mk @@ -1,4 +1,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 +RISCV_CMODEL=medlow TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-e21-rtl/settings.mk b/bsp/coreip-e21-rtl/settings.mk index c3f98c4..f60f250 100644 --- a/bsp/coreip-e21-rtl/settings.mk +++ b/bsp/coreip-e21-rtl/settings.mk @@ -1,8 +1,7 @@ -#write_config_file - RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow + COREIP_MEM_WIDTH=32 TARGET_TAGS=rtl diff --git a/bsp/coreip-e24-rtl/settings.mk b/bsp/coreip-e24-rtl/settings.mk index c3f98c4..f60f250 100644 --- a/bsp/coreip-e24-rtl/settings.mk +++ b/bsp/coreip-e24-rtl/settings.mk @@ -1,8 +1,7 @@ -#write_config_file - RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow + COREIP_MEM_WIDTH=32 TARGET_TAGS=rtl diff --git a/bsp/coreip-e31-rtl/settings.mk b/bsp/coreip-e31-rtl/settings.mk index c3f98c4..f60f250 100644 --- a/bsp/coreip-e31-rtl/settings.mk +++ b/bsp/coreip-e31-rtl/settings.mk @@ -1,8 +1,7 @@ -#write_config_file - RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow + COREIP_MEM_WIDTH=32 TARGET_TAGS=rtl diff --git a/bsp/coreip-e34-rtl/settings.mk b/bsp/coreip-e34-rtl/settings.mk index c3f98c4..f60f250 100644 --- a/bsp/coreip-e34-rtl/settings.mk +++ b/bsp/coreip-e34-rtl/settings.mk @@ -1,8 +1,7 @@ -#write_config_file - RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow + COREIP_MEM_WIDTH=32 TARGET_TAGS=rtl diff --git a/bsp/coreip-e76-arty/settings.mk b/bsp/coreip-e76-arty/settings.mk index 9d61abe..0b9c2cb 100644 --- a/bsp/coreip-e76-arty/settings.mk +++ b/bsp/coreip-e76-arty/settings.mk @@ -1,4 +1,5 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 +RISCV_CMODEL=medlow TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-e76-rtl/settings.mk b/bsp/coreip-e76-rtl/settings.mk index 4a9e97f..dd09d48 100644 --- a/bsp/coreip-e76-rtl/settings.mk +++ b/bsp/coreip-e76-rtl/settings.mk @@ -1,8 +1,7 @@ -#write_config_file - RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow + COREIP_MEM_WIDTH=64 TARGET_TAGS=rtl diff --git a/bsp/coreip-s51-rtl/settings.mk b/bsp/coreip-s51-rtl/settings.mk index 78ef056..4d48fc1 100644 --- a/bsp/coreip-s51-rtl/settings.mk +++ b/bsp/coreip-s51-rtl/settings.mk @@ -1,6 +1,7 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 -COREIP_MEM_WIDTH=64 RISCV_CMODEL=medany +COREIP_MEM_WIDTH=64 + TARGET_TAGS=rtl diff --git a/bsp/coreip-s54-arty/settings.mk b/bsp/coreip-s54-arty/settings.mk index 684f76d..2832d7c 100644 --- a/bsp/coreip-s54-arty/settings.mk +++ b/bsp/coreip-s54-arty/settings.mk @@ -1,5 +1,5 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 -iRISCV_CMODEL=medany +RISCV_CMODEL=medany TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-s54-rtl/settings.mk b/bsp/coreip-s54-rtl/settings.mk index e6b6330..4d48fc1 100644 --- a/bsp/coreip-s54-rtl/settings.mk +++ b/bsp/coreip-s54-rtl/settings.mk @@ -1,6 +1,7 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 -RISCV_CMODE=medany +RISCV_CMODEL=medany + COREIP_MEM_WIDTH=64 TARGET_TAGS=rtl diff --git a/bsp/coreip-s76-arty/settings.mk b/bsp/coreip-s76-arty/settings.mk index 3c7d718..2832d7c 100644 --- a/bsp/coreip-s76-arty/settings.mk +++ b/bsp/coreip-s76-arty/settings.mk @@ -1,4 +1,5 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 +RISCV_CMODEL=medany TARGET_TAGS=fpga openocd diff --git a/bsp/coreip-s76-rtl/settings.mk b/bsp/coreip-s76-rtl/settings.mk index 4aeb6b5..4d48fc1 100644 --- a/bsp/coreip-s76-rtl/settings.mk +++ b/bsp/coreip-s76-rtl/settings.mk @@ -1,6 +1,7 @@ RISCV_ARCH=rv64imac RISCV_ABI=lp64 RISCV_CMODEL=medany + COREIP_MEM_WIDTH=64 TARGET_TAGS=rtl diff --git a/bsp/freedom-e310-arty/settings.mk b/bsp/freedom-e310-arty/settings.mk index a2774d2..0b9c2cb 100644 --- a/bsp/freedom-e310-arty/settings.mk +++ b/bsp/freedom-e310-arty/settings.mk @@ -1,7 +1,5 @@ -#write_config_file - RISCV_ARCH=rv32imac RISCV_ABI=ilp32 -RISCV_CMODE=medlow +RISCV_CMODEL=medlow TARGET_TAGS=fpga openocd diff --git a/bsp/sifive-hifive1-revb/settings.mk b/bsp/sifive-hifive1-revb/settings.mk index d0c3628..fc5f172 100644 --- a/bsp/sifive-hifive1-revb/settings.mk +++ b/bsp/sifive-hifive1-revb/settings.mk @@ -1,6 +1,7 @@ -RISCV_ARCH = rv32imac -RISCV_ABI = ilp32 -RISCV_CMODEL = medlow -SEGGER_JLINK_OB = 1 +RISCV_ARCH=rv32imac +RISCV_ABI=ilp32 +RISCV_CMODEL=medlow + +SEGGER_JLINK_OB=1 TARGET_TAGS=board jlink diff --git a/bsp/sifive-hifive1/settings.mk b/bsp/sifive-hifive1/settings.mk index ba1ed20..d863a6d 100644 --- a/bsp/sifive-hifive1/settings.mk +++ b/bsp/sifive-hifive1/settings.mk @@ -1,5 +1,5 @@ -RISCV_ARCH = rv32imac -RISCV_ABI = ilp32 -RISCV_CMODEL = medlow +RISCV_ARCH=rv32imac +RISCV_ABI=ilp32 +RISCV_CMODEL=medlow TARGET_TAGS=board openocd -- cgit v1.2.3 From db199c80c3b3b2cfaf6bc86fcf98987e47985c03 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Thu, 14 Mar 2019 13:55:43 -0700 Subject: Use TARGET_TAGS in Makefile Signed-off-by: Nathaniel Graff --- Makefile | 15 ++++++++------- scripts/standalone.mk | 14 +++++++------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 7f3eafb..1769d44 100644 --- a/Makefile +++ b/Makefile @@ -131,13 +131,14 @@ include scripts/libmetal.mk ifeq ($(STANDALONE_DEST),) standalone: $(error Please provide STANDALONE_DEST to create a standalone project) -else +else # STANDALONE_DEST != "" $(STANDALONE_DEST): $(STANDALONE_DEST)/%: mkdir -p $@ -ifneq ($(COREIP_MEM_WIDTH),) +ifneq ($(filter rtl,$(TARGET_TAGS)),) +# TARGETs with the "rtl" TARGET_TAG need elf2hex in their standalone project standalone: \ $(STANDALONE_DEST) \ $(STANDALONE_DEST)/bsp \ @@ -169,7 +170,7 @@ standalone: \ echo "PROGRAM = $(PROGRAM)" > $> $> $ $> $> $ Date: Thu, 14 Mar 2019 14:07:59 -0700 Subject: Remove SEGGER_JLINK_OB from settings.mk Signed-off-by: Nathaniel Graff --- bsp/sifive-hifive1-revb/settings.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/bsp/sifive-hifive1-revb/settings.mk b/bsp/sifive-hifive1-revb/settings.mk index fc5f172..4c1f33e 100644 --- a/bsp/sifive-hifive1-revb/settings.mk +++ b/bsp/sifive-hifive1-revb/settings.mk @@ -2,6 +2,4 @@ RISCV_ARCH=rv32imac RISCV_ABI=ilp32 RISCV_CMODEL=medlow -SEGGER_JLINK_OB=1 - TARGET_TAGS=board jlink -- cgit v1.2.3 From 28956117d173b478d6e47b570aa05ea38d605976 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Thu, 14 Mar 2019 14:22:51 -0700 Subject: BSPs are any directory with settings.mk Signed-off-by: Nathaniel Graff --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1769d44..c513359 100644 --- a/Makefile +++ b/Makefile @@ -106,11 +106,12 @@ clean: # format or fixed text of the output without consulting the # Freedom Studio dev team. ############################################################# -# -# Metal boards are any folders that aren't the Legacy BSP or update-targets.sh -EXCLUDE_TARGET_DIRS = drivers env include libwrap update-targets.sh + +# Finds all directories in bsp/ with settings.mk, extracts the name of those directories, and sorts them +ALL_TARGETS = $(sort $(patsubst $(TARGET_ROOT)/bsp/%/,%,$(dir $(shell find $(TARGET_ROOT)/bsp -name settings.mk)))) + list-targets: - @echo bsp-list: $(sort $(filter-out $(EXCLUDE_TARGET_DIRS),$(notdir $(wildcard bsp/*)))) + @echo bsp-list: $(ALL_TARGETS) # Metal programs are any submodules in the software folder list-programs: -- cgit v1.2.3 From 7083079297ea072a5a76b07ab53785372442d01f Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Thu, 14 Mar 2019 15:01:02 -0700 Subject: list-targets accepts TARGET_REQUIRE_TAGS as filter make list-targets TARGET_REQUIRE_TAGS="tag1 tag2 tag3" will list only the BSPs with all of the requested tags. Signed-off-by: Nathaniel Graff --- Makefile | 10 +++++++--- scripts/filter-targets | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100755 scripts/filter-targets diff --git a/Makefile b/Makefile index c513359..c97db4c 100644 --- a/Makefile +++ b/Makefile @@ -107,11 +107,14 @@ clean: # Freedom Studio dev team. ############################################################# -# Finds all directories in bsp/ with settings.mk, extracts the name of those directories, and sorts them -ALL_TARGETS = $(sort $(patsubst $(TARGET_ROOT)/bsp/%/,%,$(dir $(shell find $(TARGET_ROOT)/bsp -name settings.mk)))) +# Find all settings.mk with TARGET_REQUIRE_TAGS in TARGET_TAGS +MATCHING_SETTINGS = $(shell scripts/filter-targets $(TARGET_ROOT)/bsp $(TARGET_REQUIRE_TAGS)) + +# Get the name of the containing directory of all matching settings.mk +MATCHING_TARGETS = $(patsubst $(TARGET_ROOT)/bsp/%/,%,$(dir $(MATCHING_SETTINGS))) list-targets: - @echo bsp-list: $(ALL_TARGETS) + @echo bsp-list: $(sort $(MATCHING_TARGETS)) # Metal programs are any submodules in the software folder list-programs: @@ -228,3 +231,4 @@ debug: $(PROGRAM_ELF) scripts/debug --elf $(PROGRAM_ELF) --openocd $(RISCV_OPENOCD) --gdb $(RISCV_GDB) --openocd-config bsp/$(TARGET)/openocd.cfg endif + diff --git a/scripts/filter-targets b/scripts/filter-targets new file mode 100755 index 0000000..580a433 --- /dev/null +++ b/scripts/filter-targets @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e +set -o pipefail + +unset tag +unset bsp_dir +unset all_settings + +bsp_dir="$1" +shift 1 + +all_settings=`find ${bsp_dir} -name settings.mk` + +while [[ "$1" != "" ]] +do + all_settings=`grep -le "TARGET_TAGS.*=.*$1.*" ${all_settings}` + shift 1 +done + +echo ${all_settings} -- cgit v1.2.3 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 From 5dd316a7fff887877c229be395db74dd62634586 Mon Sep 17 00:00:00 2001 From: Nathaniel Graff Date: Fri, 15 Mar 2019 10:05:57 -0700 Subject: Mark list-* as PHONY Signed-off-by: Nathaniel Graff --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 4003189..7eb7229 100644 --- a/Makefile +++ b/Makefile @@ -113,6 +113,7 @@ MATCHING_SETTINGS = $(shell scripts/filter-targets $(TARGET_ROOT)/bsp $(TARGET_R # Get the name of the containing directory of all matching settings.mk MATCHING_TARGETS = $(patsubst $(TARGET_ROOT)/bsp/%/,%,$(dir $(MATCHING_SETTINGS))) +.PHONY: list-targets list-targets: @echo bsp-list: $(sort $(MATCHING_TARGETS)) @@ -125,6 +126,7 @@ list-targets: # 5. Sort the lines # 6. Find unique tags # +.PHONY: list-target-tags list-target-tags: @echo target-tags: $(shell find $(TARGET_ROOT)/bsp -name settings.mk | \ xargs grep -he "TARGET_TAGS" | \ @@ -134,9 +136,11 @@ list-target-tags: uniq) # Metal programs are any submodules in the software folder +.PHONY: list-programs list-programs: @echo program-list: $(shell grep -o '= software/.*$$' .gitmodules | sed 's/.*\///') +.PHONY: list-options list-options: list-programs list-targets ############################################################# -- cgit v1.2.3