btstack/test/sbc/Makefile

90 lines
3.4 KiB
Makefile
Raw Normal View History

2016-06-10 08:43:13 +00:00
CC=gcc
BTSTACK_ROOT = ../..
SBC_DECODER_ROOT = ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder
SBC_ENCODER_ROOT = ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder
include ${SBC_DECODER_ROOT}/Makefile.inc
include ${SBC_ENCODER_ROOT}/Makefile.inc
2016-07-14 09:21:39 +00:00
SBC_DECODER += \
2016-07-23 13:08:13 +00:00
${BTSTACK_ROOT}/src/classic/btstack_sbc_plc.c \
${BTSTACK_ROOT}/src/classic/btstack_sbc_decoder_bluedroid.c \
2016-07-14 09:21:39 +00:00
2016-07-22 15:32:44 +00:00
SBC_ENCODER += \
${BTSTACK_ROOT}/src/classic/btstack_sbc_encoder_bluedroid.c \
2016-07-23 13:19:56 +00:00
${BTSTACK_ROOT}/src/classic/hfp_msbc.c \
2016-07-22 15:32:44 +00:00
2016-06-10 08:43:13 +00:00
SBC_DECODER_OBJ = $(SBC_DECODER:.c=.o)
SBC_ENCODER_OBJ = $(SBC_ENCODER:.c=.o)
2016-09-19 13:02:59 +00:00
CFLAGS = -g -Wall -I. -I../ -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/src/classic -I${BTSTACK_ROOT}/platform/posix
2016-07-08 15:11:57 +00:00
CFLAGS += -I${SBC_DECODER_ROOT}/include
CFLAGS += -I${SBC_ENCODER_ROOT}/include
CFLAGS += -Werror=unused-parameter
#CFLAGS += -D PRINT_SAMPLES -D PRINT_SCALEFACTORS -D OI_DEBUG -D TRACE_EXECUTION
2016-06-10 08:43:13 +00:00
LDFLAGS += -lCppUTest -lCppUTestExt
2016-07-01 12:56:16 +00:00
VPATH += ${SBC_DECODER_ROOT}/srce
VPATH += ${SBC_ENCODER_ROOT}/srce
VPATH += ${BTSTACK_ROOT}/src
2016-09-19 13:02:59 +00:00
VPATH += ${BTSTACK_ROOT}/platform/posix
VPATH += ${BTSTACK_ROOT}/port/libusb
2016-07-01 12:56:16 +00:00
COMMON += \
hci_dump.c \
btstack_util.c \
2016-09-19 13:02:59 +00:00
wav_util.c \
2016-07-01 12:56:16 +00:00
COMMON_OBJ = $(COMMON:.c=.o)
2016-06-10 08:43:13 +00:00
SBC_TESTS = sbc_decoder_test msbc_encoder_test
#sbc_decoder_sine
2016-06-10 08:43:13 +00:00
all: ${SBC_TESTS}
2016-07-27 09:03:55 +00:00
sbc_decoder_test: ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${COMMON_OBJ} sbc_decoder_test.o
2016-06-10 08:43:13 +00:00
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
msbc_encoder_test: ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${COMMON_OBJ} msbc_encoder_test.o
2016-06-10 08:43:13 +00:00
${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
2017-05-23 14:56:52 +00:00
data_sine_stereo_sbc.h: data/sine-stereo.sbc
xxd -i -l 14800 $^ > $@
data_fanfare_8sb_stereo_sbc.h: data/fanfare-8sb-stereo.sbc
xxd -i $^ > $@
sbc_decoder_sine: ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${COMMON_OBJ} sbc_decoder_sine.o data_sine_stereo_sbc.h
${CC} $(filter-out data_sine_stereo_sbc.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
2016-06-10 08:43:13 +00:00
test: all
2016-10-05 14:32:01 +00:00
./sbc_decoder_test data/avdtp_sink sbc 0 0
#./sbc_decoder_test data/sine-4sb-mono msbc 1 100
#./sbc_encoder_test data/sine-mono.wav data/sine-4sb-mono.sbc
2016-06-10 08:43:13 +00:00
pytest-sine:
2016-05-12 08:43:30 +00:00
./sbc_decoder_test.py data/sine-4sb-mono.sbc data/sine-4sb-decoded-mono.wav
./sbc_decoder_test.py data/sine-8sb-mono.sbc data/sine-8sb-decoded-mono.wav
./sbc_decoder_test.py data/sine-4sb-stereo.sbc data/sine-4sb-decoded-stereo.wav
./sbc_decoder_test.py data/sine-8sb-stereo.sbc data/sine-8sb-decoded-stereo.wav
2016-05-12 08:40:46 +00:00
2016-05-19 14:00:28 +00:00
./sbc_encoder_test.py data/sine-mono.wav 16 4 31 0 data/sine-4sb-mono.sbc
./sbc_encoder_test.py data/sine-mono.wav 16 8 64 0 data/sine-8sb-mono.sbc
./sbc_encoder_test.py data/sine-stereo.wav 16 4 30 1 2 data/sine-4sb-stereo.sbc
./sbc_encoder_test.py data/sine-stereo.wav 16 8 64 2 data/sine-8sb-stereo.sbc
2016-05-12 08:40:46 +00:00
2016-06-10 08:43:13 +00:00
pytest:
2016-05-12 08:43:30 +00:00
./sbc_decoder_test.py data/fanfare-4sb-mono.sbc data/fanfare-4sb-decoded-mono.wav
./sbc_decoder_test.py data/fanfare-8sb-mono.sbc data/fanfare-8sb-decoded-mono.wav
./sbc_decoder_test.py data/fanfare-4sb-stereo.sbc data/fanfare-4sb-decoded-stereo.wav
./sbc_decoder_test.py data/fanfare-8sb-stereo.sbc data/fanfare-8sb-decoded-stereo.wav
2016-05-12 08:40:46 +00:00
2016-05-19 14:00:28 +00:00
./sbc_encoder_test.py data/fanfare-mono.wav 16 4 31 0 data/fanfare-4sb-mono.sbc
./sbc_encoder_test.py data/fanfare-mono.wav 16 8 64 0 data/fanfare-8sb-mono.sbc
./sbc_encoder_test.py data/fanfare-stereo.wav 16 4 31 2 data/fanfare-4sb-stereo.sbc
./sbc_encoder_test.py data/fanfare-stereo.wav 16 8 64 2 data/fanfare-8sb-stereo.sbc
2016-05-12 08:35:52 +00:00
clean:
2017-05-23 14:56:52 +00:00
rm -f *.pyc *.wav *.sbc data/*-decoded.wav data/*-encoded.sbc *.o $(SBC_TESTS) *.dSYM *_test data_*.h