From 11f04e516aef876d3fe31810ed629b94b4a243c8 Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Wed, 26 Jan 2022 22:34:47 +0800 Subject: [PATCH] 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 --- 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 94c1460a64..7433c13ecb 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 481d74898b..052ff30ba3 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 902f063049..4edadb827f 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 00ce04e0b8..4192f107c7 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)