2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 # we need to build two different speex libraries
11 # (one for codec, one for core voice)
12 # so a little trickery is necessary
14 # disable strict aliasing optimizations for now, it gives warnings due to
15 # some horrid typecasting
16 SPEEXFLAGS
= $(filter-out -O
%, $(filter-out -fstrict-aliasing
, $(CODECFLAGS
))) \
17 -fno-strict-aliasing
-DHAVE_CONFIG_H
-DSPEEX_DISABLE_ENCODER \
18 -I
$(APPSDIR
)/codecs
/libspeex
20 # libspeex is faster on ARM-targets with -O1 instead of -O2
27 VOICESPEEXFLAGS
= $(filter-out -ffunction-sections
, $(filter-out -DCODEC
,$(SPEEXFLAGS
))) -DROCKBOX_VOICE_CODEC
30 SPEEXLIB
:= $(CODECDIR
)/libspeex.a
31 SPEEXLIB_SRC
:= $(call preprocess
, $(APPSDIR
)/codecs
/libspeex
/SOURCES
)
32 SPEEXLIB_OBJ
:= $(call c2obj
, $(SPEEXLIB_SRC
))
33 OTHER_SRC
+= $(SPEEXLIB_SRC
)
35 $(SPEEXLIB
): $(SPEEXLIB_OBJ
)
36 $(SILENT
)$(shell rm -f
$@
)
37 $(call PRINTS
,AR
$(@F
))$(AR
) rcs
$@
$^
>/dev
/null
40 VOICESPEEXLIB
:= $(CODECDIR
)/libspeex-voice.a
41 VOICESPEEXLIB_SRC
:= $(call preprocess
, $(APPSDIR
)/codecs
/libspeex
/SOURCES
)
42 VOICESPEEXLIB_OBJ
:= $(addsuffix .o
,$(basename $(subst $(ROOTDIR
)/apps
/codecs
/libspeex
,$(BUILDDIR
)/apps
/codecs
/libspeex-voice
,$(VOICESPEEXLIB_SRC
))))
44 $(VOICESPEEXLIB
): $(VOICESPEEXLIB_OBJ
)
45 $(call PRINTS
,AR
$(@F
))$(AR
) rcs
$@
$^
>/dev
/null
49 $(CODECDIR
)/libspeex-voice
/%.o
: $(ROOTDIR
)/apps
/codecs
/libspeex
/%.c
50 $(SILENT
)mkdir
-p
$(dir $@
)
51 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) $(VOICESPEEXFLAGS
) -c
$< -o
$@
53 $(CODECDIR
)/libspeex-voice
/%.o
: $(ROOTDIR
)/apps
/codecs
/libspeex
/%.S
54 $(SILENT
)mkdir
-p
$(dir $@
)
55 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) $(VOICESPEEXFLAGS
) -c
$< -o
$@
57 $(CODECDIR
)/libspeex
/%.o
: $(ROOTDIR
)/apps
/codecs
/libspeex
/%.c
58 $(SILENT
)mkdir
-p
$(dir $@
)
59 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) $(SPEEXFLAGS
) -c
$< -o
$@
61 $(CODECDIR
)/libspeex
/%.o
: $(ROOTDIR
)/apps
/codecs
/libspeex
/%.S
62 $(SILENT
)mkdir
-p
$(dir $@
)
63 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) $(SPEEXFLAGS
) -c
$< -o
$@