2011-11-02 19:20:39 +01:00
|
|
|
#
|
|
|
|
# Rules to add CMSIS2 to a PiOS target
|
|
|
|
#
|
|
|
|
|
2013-05-17 22:41:34 +02:00
|
|
|
CMSIS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
|
|
|
EXTRAINCDIRS += $(CMSIS_DIR)Include
|
2012-12-30 20:15:46 +01:00
|
|
|
|
|
|
|
# Rules to build the ARM DSP library
|
|
|
|
ifeq ($(USE_DSP_LIB), YES)
|
2013-03-17 15:59:29 +01:00
|
|
|
DSPLIB_NAME := dsp
|
2013-05-17 22:41:34 +02:00
|
|
|
CMSIS_DSPLIB := $(CMSIS_DIR)DSP_Lib/Source
|
2012-12-30 20:15:46 +01:00
|
|
|
|
2013-03-17 15:59:29 +01:00
|
|
|
# Compile all files into output directory
|
2013-04-19 20:43:31 +02:00
|
|
|
DSPLIB_SRC := $(sort $(wildcard $(CMSIS_DSPLIB)/*/*.c))
|
2013-03-17 15:59:29 +01:00
|
|
|
DSPLIB_SRCBASE := $(notdir $(basename $(DSPLIB_SRC)))
|
|
|
|
$(foreach src, $(DSPLIB_SRC), $(eval $(call COMPILE_C_TEMPLATE, $(src))))
|
2012-12-30 20:15:46 +01:00
|
|
|
|
2013-03-17 15:59:29 +01:00
|
|
|
# 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)))
|
2012-12-30 20:15:46 +01:00
|
|
|
|
2013-03-17 15:59:29 +01:00
|
|
|
# Create a library file
|
|
|
|
$(eval $(call ARCHIVE_TEMPLATE, $(OUTDIR)/lib$(DSPLIB_NAME).a, $(DSPLIB_OBJ), $(DSPLIB_OBJDIR)))
|
2012-12-30 20:15:46 +01:00
|
|
|
|
2013-03-17 15:59:29 +01:00
|
|
|
# Add library to the list of linked objects
|
|
|
|
ALLLIB += $(OUTDIR)/lib$(DSPLIB_NAME).a
|
2012-12-30 20:15:46 +01:00
|
|
|
endif
|