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
)
31 CFLAGS
+= -arch
$(RBARCH
)
35 # This sets up 'SRC' based on the files mentioned in SOURCES
36 SRC
:= $(shell cat
$(SPEEXSRC
)/SOURCES |
$(CC
) $(CFLAGS
) -E
-P
- | grep
-v
"^\#" | grep
-v
"^$$")
39 SOURCES
= $(SRC
:%.c
=$(SPEEXSRC
)/%.c
) rbspeex.c rbspeexenc.c rbspeexdec.c
40 OBJS
= $(addprefix $(OUT
)/,$(SRC
:%.c
=%.o
))
41 DEPFILE
= $(OUT
)/dep-speex
46 all: ..
/rbspeexenc ..
/rbspeexdec
48 $(DEPFILE
): $(SOURCES
) $(OUT
)
49 $(SILENT
)rm -f
$(DEPFILE
)
50 $(SILENT
)(for each in
$(SOURCES
) x
; do \
51 if
test "x" != "$$each"; then \
52 obj
=`echo $$each | sed -e 's/\.[cS]/.o/' | sed -e 's/^.*\///' `; \
53 $(CC
) -MG
-MM
-MT
"$(OUT)/$$obj" $(CFLAGS
) $$each 2>/dev
/null
; \
55 if
test -n
"$$del"; then \
60 echo
"oo" > /dev
/null
)
64 $(OUT
)/librbspeex.a
: $(OBJS
) $(DEPFILE
) $(OUT
)/rbspeex.o
65 @echo AR
$(OUT
)/librbspeex
$(RBARCH
).a
66 $(SILENT
)$(AR
) ruv
$@
$+ > /dev
/null
2>&1
68 librbspeex
$(RBARCH
).a
: $(OUT
)/librbspeex.a
69 $(SILENT
)cp
$(OUT
)/librbspeex.a librbspeex
$(RBARCH
).a
71 ..
/rbspeexenc
: $(OBJS
) $(OUT
)/rbspeexenc.o librbspeex
$(RBARCH
).a
72 @echo Linking ..
/rbspeexenc
73 $(SILENT
)$(CC
) $(CFLAGS
) -o ..
/rbspeexenc
$(OUT
)/rbspeexenc.o librbspeex
$(RBARCH
).a
-lm
75 ..
/rbspeexdec
: $(OBJS
) librbspeex
$(RBARCH
).a
$(OUT
)/rbspeexdec.o
76 @echo Linking ..
/rbspeexdec
77 $(SILENT
)$(CC
) $(CFLAGS
) -o ..
/rbspeexdec
$(OUT
)/rbspeexdec.o librbspeex
$(RBARCH
).a
-lm
81 $(SILENT
)$(CC
) $(CFLAGS
) -c
$< -o
$@
83 # some trickery to build ppc and i386 from a single call
86 make RBARCH
=i386 librbspeexi386.a
89 make RBARCH
=ppc librbspeexppc.a
92 librbspeex-universal
: librbspeexi386.a librbspeexppc.a
93 @echo lipo librbspeex.a
94 $(SILENT
) rm -f librbspeex.a
95 lipo
-create librbspeexppc.a librbspeexi386.a
-output librbspeex.a
98 rm -f
$(OBJS
) librbspeex
* ..
/rbspeexenc ..
/rbspeexdec dep-speex
102 @echo MKDIR build
$(RBARCH
)
103 $(SILENT
)mkdir build
$(RBARCH
)