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 ifeq ($(findstring Darwin
,$(shell uname
)),Darwin
)
31 ARCH_CMD
= -arch
$(ARCH
)
35 # This sets up 'SRC' based on the files mentioned in SOURCES
36 SRC
:= $(shell cat
$(SPEEXSRC
)/SOURCES |
$(CC
) $(CFLAGS
) -E
-P
- | grep
-v
"^\#")
38 SOURCES
= $(SRC
:%.c
=$(SPEEXSRC
)/%.c
) rbspeex.c rbspeexenc.c rbspeexdec.c
39 OBJS
:= $(SRC
:%.c
=%.o
)
45 all: ..
/rbspeexenc ..
/rbspeexdec
47 $(DEPFILE
): $(SOURCES
)
48 $(SILENT
)rm -f
$(DEPFILE
)
49 $(SILENT
)(for each in
$(SOURCES
) x
; do \
50 if
test "x" != "$$each"; then \
51 obj
=`echo $$each | sed -e 's/\.[cS]/.o/' | sed -e 's/^.*\///' `; \
52 $(CC
) -MG
-MM
-MT
"$$obj" $(CFLAGS
) $$each 2>/dev
/null
; \
54 if
test -n
"$$del"; then \
59 echo
"oo" > /dev
/null
)
61 librbspeex
$(ARCH_CMD
).a
: $(OBJS
) $(DEPFILE
) rbspeex.o
63 $(SILENT
)$(AR
) ruv
$@
$+ > /dev
/null
2>&1
65 ..
/rbspeexenc
: $(OBJS
) rbspeexenc.o librbspeex.a
66 @echo Linking ..
/rbspeexenc
67 $(SILENT
)$(CC
) $(CFLAGS
) -o ..
/rbspeexenc rbspeexenc.o librbspeex.a
-lm
69 ..
/rbspeexdec
: $(OBJS
) librbspeex.a rbspeexdec.o
70 @echo Linking ..
/rbspeexdec
71 $(SILENT
)$(CC
) $(CFLAGS
) -o ..
/rbspeexdec rbspeexdec.o librbspeex.a
-lm
75 $(SILENT
)$(CC
) $(CFLAGS
) -c
$< -o
$@
$(ARCH_CMD
)
77 universal
: librbspeexppc.a librbspeexi386.a
79 @
(SILENT
) lipo
-create librbspeexppc.a librbspeexi386.a
-output librbspeex.a
82 rm -f
$(OBJS
) rbspeex.o libspeex.a librbspeex.a rbspeexenc.o ..
/rbspeexenc dep-speex