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 SPEEXFLAGS
= $(filter-out -O
%,$(CODECFLAGS
)) \
15 -DHAVE_CONFIG_H
-DSPEEX_DISABLE_ENCODER \
16 -I
$(APPSDIR
)/codecs
/libspeex
18 # libspeex is faster on ARM-targets with -O1 instead of -O2
25 VOICESPEEXFLAGS
= $(filter-out -ffunction-sections
, $(filter-out -DCODEC
,$(SPEEXFLAGS
))) -DROCKBOX_VOICE_CODEC
28 SPEEXLIB
:= $(CODECDIR
)/libspeex.a
29 SPEEXLIB_SRC
:= $(call preprocess
, $(APPSDIR
)/codecs
/libspeex
/SOURCES
)
30 SPEEXLIB_OBJ
:= $(call c2obj
, $(SPEEXLIB_SRC
))
31 OTHER_SRC
+= $(SPEEXLIB_SRC
)
33 $(SPEEXLIB
): $(SPEEXLIB_OBJ
)
34 $(SILENT
)$(shell rm -f
$@
)
35 $(call PRINTS
,AR
$(@F
))$(AR
) rcs
$@
$^
>/dev
/null
38 VOICESPEEXLIB
:= $(CODECDIR
)/libspeex-voice.a
39 VOICESPEEXLIB_SRC
:= $(call preprocess
, $(APPSDIR
)/codecs
/libspeex
/SOURCES
)
40 VOICESPEEXLIB_OBJ
:= $(addsuffix .o
,$(basename $(subst $(ROOTDIR
)/apps
/codecs
/libspeex
,$(BUILDDIR
)/apps
/codecs
/libspeex-voice
,$(VOICESPEEXLIB_SRC
))))
42 $(VOICESPEEXLIB
): $(VOICESPEEXLIB_OBJ
)
43 $(call PRINTS
,AR
$(@F
))$(AR
) rcs
$@
$^
>/dev
/null
47 $(CODECDIR
)/libspeex-voice
/%.o
: $(ROOTDIR
)/apps
/codecs
/libspeex
/%.c
48 $(SILENT
)mkdir
-p
$(dir $@
)
49 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) $(VOICESPEEXFLAGS
) -c
$< -o
$@
51 $(CODECDIR
)/libspeex-voice
/%.o
: $(ROOTDIR
)/apps
/codecs
/libspeex
/%.S
52 $(SILENT
)mkdir
-p
$(dir $@
)
53 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) $(VOICESPEEXFLAGS
) -c
$< -o
$@
55 $(CODECDIR
)/libspeex
/%.o
: $(ROOTDIR
)/apps
/codecs
/libspeex
/%.c
56 $(SILENT
)mkdir
-p
$(dir $@
)
57 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) $(SPEEXFLAGS
) -c
$< -o
$@
59 $(CODECDIR
)/libspeex
/%.o
: $(ROOTDIR
)/apps
/codecs
/libspeex
/%.S
60 $(SILENT
)mkdir
-p
$(dir $@
)
61 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<))$(CC
) $(SPEEXFLAGS
) -c
$< -o
$@