summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libspeex/libspeex.make
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libspeex/libspeex.make')
-rw-r--r--lib/rbcodec/codecs/libspeex/libspeex.make66
1 files changed, 66 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libspeex/libspeex.make b/lib/rbcodec/codecs/libspeex/libspeex.make
new file mode 100644
index 0000000000..6138dff4a9
--- /dev/null
+++ b/lib/rbcodec/codecs/libspeex/libspeex.make
@@ -0,0 +1,66 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10# we need to build two different speex libraries
11# (one for codec, one for core voice)
12# so a little trickery is necessary
13
14# disable strict aliasing optimizations for now, it gives warnings due to
15# some horrid typecasting
16_SPEEXFLAGS = $(filter-out -fstrict-aliasing, $(CODECFLAGS)) \
17 -fno-strict-aliasing -DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER \
18 -I$(RBCODECLIB_DIR)/codecs/libspeex
19
20# build voice codec with core -O switch
21VOICESPEEXFLAGS = $(filter-out -ffunction-sections, $(filter-out -DCODEC,$(_SPEEXFLAGS))) -DROCKBOX_VOICE_CODEC
22
23# libspeex is faster on ARM-targets with -O1 instead of -O2
24SPEEXFLAGS = $(filter-out -O%,$(_SPEEXFLAGS))
25
26ifeq ($(ARCH),arch_arm)
27 SPEEXFLAGS += -O1
28else
29 SPEEXFLAGS += -O2
30endif
31
32# libspeex
33SPEEXLIB := $(CODECDIR)/libspeex.a
34SPEEXLIB_SRC := $(call preprocess, $(RBCODECLIB_DIR)/codecs/libspeex/SOURCES)
35SPEEXLIB_OBJ := $(call c2obj, $(SPEEXLIB_SRC))
36OTHER_SRC += $(SPEEXLIB_SRC)
37
38$(SPEEXLIB): $(SPEEXLIB_OBJ)
39 $(SILENT)$(shell rm -f $@)
40 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
41
42# libspeex-voice
43VOICESPEEXLIB := $(CODECDIR)/libspeex-voice.a
44VOICESPEEXLIB_SRC := $(call preprocess, $(RBCODECLIB_DIR)/codecs/libspeex/SOURCES)
45VOICESPEEXLIB_OBJ := $(addsuffix .o,$(basename $(subst $(RBCODECLIB_DIR)/codecs/libspeex,$(RBCODEC_BLD)/codecs/libspeex-voice,$(VOICESPEEXLIB_SRC))))
46
47$(VOICESPEEXLIB): $(VOICESPEEXLIB_OBJ)
48 $(call PRINTS,AR $(@F))$(AR) rcs $@ $^ >/dev/null
49
50# pattern rules
51
52$(CODECDIR)/libspeex-voice/%.o : $(RBCODECLIB_DIR)/codecs/libspeex/%.c
53 $(SILENT)mkdir -p $(dir $@)
54 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) -c $< -o $@
55
56$(CODECDIR)/libspeex-voice/%.o : $(RBCODECLIB_DIR)/codecs/libspeex/%.S
57 $(SILENT)mkdir -p $(dir $@)
58 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) $(ASMFLAGS) -c $< -o $@
59
60$(CODECDIR)/libspeex/%.o: $(RBCODECLIB_DIR)/codecs/libspeex/%.c
61 $(SILENT)mkdir -p $(dir $@)
62 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) -c $< -o $@
63
64$(CODECDIR)/libspeex/%.o: $(RBCODECLIB_DIR)/codecs/libspeex/%.S
65 $(SILENT)mkdir -p $(dir $@)
66 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) $(ASMFLAGS) -c $< -o $@