2007-11-16 15:35:37 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
2007-11-16 15:58:38 +00:00
|
|
|
# $Id$
|
2007-11-16 15:35:37 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
ifndef V
|
|
|
|
SILENT = @
|
|
|
|
endif
|
|
|
|
|
|
|
|
SPEEXSRC = ../../apps/codecs/libspeex
|
|
|
|
|
2007-11-16 19:53:47 +00:00
|
|
|
INCLUDES = -I $(SPEEXSRC)
|
2007-11-16 15:35:37 +00:00
|
|
|
SPEEXOPTS = -DHAVE_CONFIG_H -DROCKBOX_VOICE_ENCODER
|
|
|
|
|
|
|
|
CFLAGS = $(SPEEXOPTS) $(INCLUDES) -O3 -fomit-frame-pointer -Wno-unused-parameter
|
|
|
|
|
2007-11-16 21:05:34 +00:00
|
|
|
#build standalone win32 executables on cygwin
|
|
|
|
ifeq ($(findstring CYGWIN,$(shell uname)),CYGWIN)
|
|
|
|
CFLAGS+=-mno-cygwin
|
|
|
|
endif
|
2007-12-15 15:11:53 +00:00
|
|
|
# on mingw32, make sure CC is set to gcc
|
|
|
|
ifeq ($(findstring MINGW,$(shell uname)),MINGW)
|
|
|
|
CC = gcc
|
|
|
|
endif
|
2007-11-16 21:05:34 +00:00
|
|
|
|
2007-11-16 15:35:37 +00:00
|
|
|
# This sets up 'SRC' based on the files mentioned in SOURCES
|
|
|
|
SRC := $(shell cat $(SPEEXSRC)/SOURCES | $(CC) $(CFLAGS) -E -P - | grep -v "^\#")
|
|
|
|
|
2007-12-14 16:04:38 +00:00
|
|
|
SOURCES = $(SRC:%.c=$(SPEEXSRC)/%.c) rbspeex.c rbspeexenc.c rbspeexdec.c
|
2007-11-17 16:54:54 +00:00
|
|
|
OBJS := $(SRC:%.c=%.o)
|
2007-11-16 15:35:37 +00:00
|
|
|
DEPFILE = dep-speex
|
|
|
|
DIRS =
|
|
|
|
|
|
|
|
.PHONY : all
|
|
|
|
|
2007-11-28 13:42:44 +00:00
|
|
|
all: ../rbspeexenc ../rbspeexdec
|
2007-11-16 15:35:37 +00:00
|
|
|
|
|
|
|
$(DEPFILE): $(SOURCES)
|
|
|
|
$(SILENT)rm -f $(DEPFILE)
|
|
|
|
$(SILENT)(for each in $(SOURCES) x; do \
|
|
|
|
if test "x" != "$$each"; then \
|
|
|
|
obj=`echo $$each | sed -e 's/\.[cS]/.o/' | sed -e 's/^.*\///' `; \
|
|
|
|
$(CC) -MG -MM -MT "$$obj" $(CFLAGS) $$each 2>/dev/null; \
|
|
|
|
fi; \
|
|
|
|
if test -n "$$del"; then \
|
|
|
|
rm $$del; \
|
|
|
|
del=""; \
|
|
|
|
fi \
|
|
|
|
done > $(DEPFILE); \
|
|
|
|
echo "oo" > /dev/null )
|
|
|
|
|
2007-12-14 16:04:38 +00:00
|
|
|
librbspeex.a: $(OBJS) $(DEPFILE) rbspeex.o
|
|
|
|
@echo AR librbspeex.a
|
2007-12-15 15:11:53 +00:00
|
|
|
$(SILENT)$(AR) ruv $@ $+ > /dev/null 2>&1
|
2007-11-17 16:54:54 +00:00
|
|
|
|
2007-12-14 16:04:38 +00:00
|
|
|
../rbspeexenc: $(OBJS) rbspeexenc.o librbspeex.a
|
2007-11-17 16:54:54 +00:00
|
|
|
@echo Linking ../rbspeexenc
|
2007-12-14 16:04:38 +00:00
|
|
|
$(SILENT)$(CC) $(CFLAGS) -o ../rbspeexenc rbspeexenc.o librbspeex.a -lm
|
2007-11-16 15:35:37 +00:00
|
|
|
|
2007-12-14 16:04:38 +00:00
|
|
|
../rbspeexdec: $(OBJS) librbspeex.a rbspeexdec.o
|
2007-11-28 13:42:44 +00:00
|
|
|
@echo Linking ../rbspeexdec
|
2007-12-14 16:04:38 +00:00
|
|
|
$(SILENT)$(CC) $(CFLAGS) -o ../rbspeexdec rbspeexdec.o librbspeex.a -lm
|
2007-11-28 13:42:44 +00:00
|
|
|
|
2007-11-16 15:35:37 +00:00
|
|
|
%.o:
|
2007-11-17 16:54:54 +00:00
|
|
|
@echo CC $<
|
|
|
|
$(SILENT)$(CC) $(CFLAGS) -c $< -o $@
|
2007-11-16 15:35:37 +00:00
|
|
|
|
2007-12-14 16:04:38 +00:00
|
|
|
|
2007-11-16 15:35:37 +00:00
|
|
|
clean:
|
2007-12-14 16:04:38 +00:00
|
|
|
rm -f $(OBJS) libspeex.a librbspeex.a rbspeexenc.o ../rbspeexenc dep-speex
|
2007-11-16 15:35:37 +00:00
|
|
|
|
|
|
|
-include $(DEPFILE)
|