2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
14 SPEEXSRC
= ..
/..
/apps
/codecs
/libspeex
16 INCLUDES
= -I
$(SPEEXSRC
)
17 SPEEXOPTS
= -DHAVE_CONFIG_H
-DROCKBOX_VOICE_ENCODER
19 CFLAGS
= $(SPEEXOPTS
) $(INCLUDES
) -O3
-fomit-frame-pointer
-Wno-unused-parameter
21 #build standalone win32 executables on cygwin
22 ifeq ($(findstring CYGWIN
,$(shell uname
)),CYGWIN
)
25 # on mingw32, make sure CC is set to gcc
26 ifeq ($(findstring MINGW
,$(shell uname
)),MINGW
)
30 # This sets up 'SRC' based on the files mentioned in SOURCES
31 SRC
:= $(shell cat
$(SPEEXSRC
)/SOURCES |
$(CC
) $(CFLAGS
) -E
-P
- | grep
-v
"^\#")
33 SOURCES
= $(SRC
:%.c
=$(SPEEXSRC
)/%.c
) rbspeex.c rbspeexenc.c rbspeexdec.c
34 OBJS
:= $(SRC
:%.c
=%.o
)
40 all: ..
/rbspeexenc ..
/rbspeexdec
42 $(DEPFILE
): $(SOURCES
)
43 $(SILENT
)rm -f
$(DEPFILE
)
44 $(SILENT
)(for each in
$(SOURCES
) x
; do \
45 if
test "x" != "$$each"; then \
46 obj
=`echo $$each | sed -e 's/\.[cS]/.o/' | sed -e 's/^.*\///' `; \
47 $(CC
) -MG
-MM
-MT
"$$obj" $(CFLAGS
) $$each 2>/dev
/null
; \
49 if
test -n
"$$del"; then \
54 echo
"oo" > /dev
/null
)
56 librbspeex.a
: $(OBJS
) $(DEPFILE
) rbspeex.o
58 $(SILENT
)$(AR
) ruv
$@
$+ > /dev
/null
2>&1
60 ..
/rbspeexenc
: $(OBJS
) rbspeexenc.o librbspeex.a
61 @echo Linking ..
/rbspeexenc
62 $(SILENT
)$(CC
) $(CFLAGS
) -o ..
/rbspeexenc rbspeexenc.o librbspeex.a
-lm
64 ..
/rbspeexdec
: $(OBJS
) librbspeex.a rbspeexdec.o
65 @echo Linking ..
/rbspeexdec
66 $(SILENT
)$(CC
) $(CFLAGS
) -o ..
/rbspeexdec rbspeexdec.o librbspeex.a
-lm
70 $(SILENT
)$(CC
) $(CFLAGS
) -c
$< -o
$@
74 rm -f
$(OBJS
) libspeex.a librbspeex.a rbspeexenc.o ..
/rbspeexenc dep-speex