You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/01/29 09:26:19 UTC

[incubator-nuttx] 03/05: drivers/segger: download the RTT/SystemView from github

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 11f04e516aef876d3fe31810ed629b94b4a243c8
Author: chao.an <an...@xiaomi.com>
AuthorDate: Wed Jan 26 22:34:47 2022 +0800

    drivers/segger: download the RTT/SystemView from github
    
    RTT:
    https://github.com/SEGGERMicro/RTT/archive/refs/tags/V7.54.zip
    
    SystemView:
    https://github.com/SEGGERMicro/SystemView/archive/refs/tags/V3.30.zip
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 drivers/Makefile          |  6 ++++--
 drivers/segger/.gitignore |  1 +
 drivers/segger/Make.defs  | 30 ++++++++++++++++++++++++++++++
 tools/Directories.mk      |  2 +-
 4 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index 94c1460..7433c13 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -103,7 +103,7 @@ OBJS = $(AOBJS) $(COBJS)
 BIN = libdrivers$(LIBEXT)
 
 all: $(BIN)
-.PHONY: depend clean distclean
+.PHONY: context depend clean distclean
 
 $(AOBJS): %$(OBJEXT): %.S
 	$(call ASSEMBLE, $<, $@)
@@ -114,6 +114,8 @@ $(COBJS): %$(OBJEXT): %.c
 $(BIN): $(OBJS)
 	$(call ARCHIVE, $@, $(OBJS))
 
+context::
+
 makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
 	$(call CATFILE, Make.dep, $^)
 	$(call DELFILE, $^)
@@ -128,7 +130,7 @@ clean:
 	$(call DELFILE, $(BIN))
 	$(call CLEAN)
 
-distclean: clean
+distclean:: clean
 	$(call DELFILE, Make.dep)
 	$(call DELFILE, .depend)
 
diff --git a/drivers/segger/.gitignore b/drivers/segger/.gitignore
index 481d748..052ff30 100644
--- a/drivers/segger/.gitignore
+++ b/drivers/segger/.gitignore
@@ -1,2 +1,3 @@
 /RTT
 /SystemView
+/*.zip
diff --git a/drivers/segger/Make.defs b/drivers/segger/Make.defs
index 902f063..4edadb8 100644
--- a/drivers/segger/Make.defs
+++ b/drivers/segger/Make.defs
@@ -18,6 +18,9 @@
 #
 ############################################################################
 
+TARGET_ZIP =
+SGDIR      = segger
+
 ifeq ($(CONFIG_SEGGER_RTT),y)
   CSRCS += segger/RTT/RTT/SEGGER_RTT.c
 
@@ -29,6 +32,16 @@ ifeq ($(CONFIG_SEGGER_RTT),y)
   ifeq ($(CONFIG_ARCH_ARMV7M),y)
     ASRCS += segger/RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S
   endif
+
+  RTT_VERSION ?= 7.54
+
+$(SGDIR)/RTT.zip:
+	$(Q) curl -L https://github.com/SEGGERMicro/RTT/archive/refs/tags/V$(RTT_VERSION).zip -o $(SGDIR)/RTT.zip
+	$(Q) unzip -o $(SGDIR)/RTT.zip -d $(SGDIR)
+	$(Q) mv $(SGDIR)/RTT-$(RTT_VERSION) $(SGDIR)/RTT
+
+TARGET_ZIP += $(SGDIR)/RTT.zip
+
 endif
 
 ifeq ($(CONFIG_SEGGER_SYSVIEW),y)
@@ -38,4 +51,21 @@ ifeq ($(CONFIG_SEGGER_SYSVIEW),y)
   CFLAGS += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)sched}
   CFLAGS += ${shell $(INCDIR) "$(CC)" segger$(DELIM)SystemView$(DELIM)SEGGER}
   CFLAGS += ${shell $(INCDIR) "$(CC)" segger$(DELIM)SystemView$(DELIM)SYSVIEW}
+
+  SYSVIEW_VERSION ?= 3.30
+
+$(SGDIR)/SystemView.zip:
+	$(Q) curl -L https://github.com/SEGGERMicro/SystemView/archive/refs/tags/V$(SYSVIEW_VERSION).zip -o $(SGDIR)/SystemView.zip
+	$(Q) unzip -o $(SGDIR)/SystemView.zip -d $(SGDIR)
+	$(Q) mv $(SGDIR)/SystemView-$(SYSVIEW_VERSION) $(SGDIR)/SystemView
+
+TARGET_ZIP += $(SGDIR)/SystemView.zip
+
 endif
+
+context:: $(TARGET_ZIP)
+
+distclean::
+	$(call DELDIR, $(SGDIR)/SystemView)
+	$(call DELDIR, $(SGDIR)/RTT)
+	$(call DELFILE, $(TARGET_ZIP))
diff --git a/tools/Directories.mk b/tools/Directories.mk
index 00ce04e..4192f10 100644
--- a/tools/Directories.mk
+++ b/tools/Directories.mk
@@ -61,7 +61,7 @@ ifeq ($(EXTERNALDIR),external)
   KERNDEPDIRS += external
 endif
 
-CONTEXTDIRS = boards fs $(APPDIR) $(ARCH_SRC)
+CONTEXTDIRS = boards drivers fs $(APPDIR) $(ARCH_SRC)
 CLEANDIRS += pass1
 
 ifeq ($(CONFIG_BUILD_FLAT),y)