mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
[OP-775] Provide rules to build DSP library
This commit is contained in:
parent
89cb49733e
commit
95f16e25c4
@ -4,3 +4,26 @@
|
|||||||
|
|
||||||
CMSIS2_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
CMSIS2_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||||
EXTRAINCDIRS += $(CMSIS2_DIR)/Include
|
EXTRAINCDIRS += $(CMSIS2_DIR)/Include
|
||||||
|
|
||||||
|
# Rules to build the ARM DSP library
|
||||||
|
ifeq ($(USE_DSP_LIB), YES)
|
||||||
|
|
||||||
|
DSPLIB_NAME := dsp
|
||||||
|
CMSIS_DSPLIB := $(CMSIS2_DIR)/DSP_Lib/Source
|
||||||
|
|
||||||
|
# Compile all files into output directory
|
||||||
|
DSPLIB_SRC := $(wildcard $(CMSIS_DSPLIB)/*/*.c)
|
||||||
|
DSPLIB_SRCBASE := $(notdir $(basename $(DSPLIB_SRC)))
|
||||||
|
$(foreach src, $(DSPLIB_SRC), $(eval $(call COMPILE_C_TEMPLATE, $(src))))
|
||||||
|
|
||||||
|
# Define the object files directory and a list of object files for the library
|
||||||
|
DSPLIB_OBJDIR = $(OUTDIR)
|
||||||
|
DSPLIB_OBJ = $(addprefix $(DSPLIB_OBJDIR)/, $(addsuffix .o, $(DSPLIB_SRCBASE)))
|
||||||
|
|
||||||
|
# Create a library file
|
||||||
|
$(eval $(call ARCHIVE_TEMPLATE, $(OUTDIR)/lib$(DSPLIB_NAME).a, $(DSPLIB_OBJ), $(DSPLIB_OBJDIR)))
|
||||||
|
|
||||||
|
# Add library to the list of linked objects
|
||||||
|
ALLLIB += $(OUTDIR)/lib$(DSPLIB_NAME).a
|
||||||
|
|
||||||
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user