1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/cmsis-dsp: use modules to compile package

This commit is contained in:
Leandro Lanzieri 2020-08-17 14:15:16 +02:00
parent cc954274a7
commit 75902c96f8
No known key found for this signature in database
GPG Key ID: 13559905E2EBEAA5
4 changed files with 32 additions and 40 deletions

View File

@ -5,7 +5,21 @@ PKG_LICENSE=Apache-2.0
include $(RIOTBASE)/pkg/pkg.mk
CFLAGS += -Wno-strict-aliasing -Wno-unused-parameter
CMSIS_DSP_MODULES = \
cmsis-dsp_BasicMathFunctions \
cmsis-dsp_CommonTables \
cmsis-dsp_ComplexMathFunctions \
cmsis-dsp_ControllerFunctions \
cmsis-dsp_FastMathFunctions \
cmsis-dsp_FilteringFunctions \
cmsis-dsp_MatrixFunctions \
cmsis-dsp_StatisticsFunctions \
cmsis-dsp_SupportFunctions \
cmsis-dsp_TransformFunctions \
all:
"$(MAKE)" -C $(PKG_SOURCE_DIR) -f $(CURDIR)/Makefile.$(PKG_NAME) all
.PHONY: cmsis-dsp_%
all: $(CMSIS_DSP_MODULES)
cmsis-dsp_%:
$(MAKE) -C $(PKG_SOURCE_DIR)/CMSIS/DSP/Source/$* -f $(CURDIR)/Makefile.cmsis-dsp MODULE=$@

View File

@ -1,40 +1,5 @@
PKG_NAME=cmsis-dsp
# A list of all the directories to build for CMSIS-DSP
CMSIS_DIRS += \
CMSIS/DSP/Source/BasicMathFunctions \
CMSIS/DSP/Source/CommonTables \
CMSIS/DSP/Source/ComplexMathFunctions \
CMSIS/DSP/Source/ControllerFunctions \
CMSIS/DSP/Source/FastMathFunctions \
CMSIS/DSP/Source/FilteringFunctions \
CMSIS/DSP/Source/MatrixFunctions \
CMSIS/DSP/Source/StatisticsFunctions \
CMSIS/DSP/Source/SupportFunctions \
CMSIS/DSP/Source/TransformFunctions \
#
INCLUDES += -I$(CURDIR)/CMSIS/DSP/Include
CMSIS_BINDIRS = $(addprefix $(BINDIR)/$(PKG_NAME)/,$(CMSIS_DIRS))
# Override default RIOT search path for sources to include all of the CMSIS-DSP
# sources in one library instead of one library per subdirectory.
SRC := $(foreach DIR,$(CMSIS_DIRS),$(wildcard $(DIR)/*.c))
SRCXX := $(foreach DIR,$(CMSIS_DIRS),$(wildcard $(DIR)/*.cpp))
ASMSRC := $(foreach DIR,$(CMSIS_DIRS),$(wildcard $(DIR)/*.s))
ASSMSRC := $(foreach DIR,$(CMSIS_DIRS),$(wildcard $(DIR)/*.S))
OBJC := $(SRC:%.c=$(BINDIR)/$(PKG_NAME)/%.o)
OBJCXX := $(SRCXX:%.cpp=$(BINDIR)/$(PKG_NAME)/%.o)
ASMOBJ := $(ASMSRC:%.s=$(BINDIR)/$(PKG_NAME)/%.o)
ASSMOBJ := $(ASSMSRC:%.S=$(BINDIR)/$(PKG_NAME)/%.o)
OBJ = $(OBJC) $(OBJCXX) $(ASMOBJ) $(ASSMOBJ)
# Create subdirectories if they do not already exist
$(OBJ): | $(CMSIS_BINDIRS)
$(CMSIS_BINDIRS):
@mkdir -p $@
CFLAGS += -Wno-strict-aliasing
CFLAGS += -Wno-unused-parameter
# Include RIOT settings and recipes
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,10 @@
USEMODULE += cmsis-dsp_BasicMathFunctions
USEMODULE += cmsis-dsp_CommonTables
USEMODULE += cmsis-dsp_ComplexMathFunctions
USEMODULE += cmsis-dsp_ControllerFunctions
USEMODULE += cmsis-dsp_FastMathFunctions
USEMODULE += cmsis-dsp_FilteringFunctions
USEMODULE += cmsis-dsp_MatrixFunctions
USEMODULE += cmsis-dsp_StatisticsFunctions
USEMODULE += cmsis-dsp_SupportFunctions
USEMODULE += cmsis-dsp_TransformFunctions

View File

@ -1 +1,4 @@
INCLUDES += -I$(PKGDIRBASE)/cmsis-dsp/CMSIS/DSP/Include
# cmsis-dsp module is not a concrete module, so declare it as a pseudomodule
PSEUDOMODULES += cmsis-dsp