2008-11-20 11:27:31 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
2008-11-25 19:54:23 +00:00
|
|
|
# $Id$
|
2008-11-20 11:27:31 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
CODECDIR = $(BUILDDIR)/apps/codecs
|
|
|
|
CODECS_SRC := $(call preprocess, $(APPSDIR)/codecs/SOURCES)
|
|
|
|
OTHER_SRC += $(CODECS_SRC)
|
|
|
|
|
|
|
|
CODECS := $(CODECS_SRC:.c=.codec)
|
|
|
|
CODECS := $(subst $(ROOTDIR),$(BUILDDIR),$(CODECS))
|
|
|
|
|
2009-08-29 12:23:40 +00:00
|
|
|
# TLSF memory allocator library
|
|
|
|
include $(APPSDIR)/codecs/lib/tlsf/libtlsf.make
|
|
|
|
|
2008-11-20 11:27:31 +00:00
|
|
|
# the codec helper library
|
|
|
|
include $(APPSDIR)/codecs/lib/libcodec.make
|
2009-01-12 21:56:46 +00:00
|
|
|
OTHER_INC += -I$(APPSDIR)/codecs/lib
|
2008-11-20 11:27:31 +00:00
|
|
|
|
|
|
|
# the codec libraries
|
|
|
|
include $(APPSDIR)/codecs/demac/libdemac.make
|
|
|
|
include $(APPSDIR)/codecs/liba52/liba52.make
|
|
|
|
include $(APPSDIR)/codecs/libalac/libalac.make
|
|
|
|
include $(APPSDIR)/codecs/libasap/libasap.make
|
|
|
|
include $(APPSDIR)/codecs/libfaad/libfaad.make
|
|
|
|
include $(APPSDIR)/codecs/libffmpegFLAC/libffmpegFLAC.make
|
|
|
|
include $(APPSDIR)/codecs/libm4a/libm4a.make
|
|
|
|
include $(APPSDIR)/codecs/libmad/libmad.make
|
|
|
|
include $(APPSDIR)/codecs/libmusepack/libmusepack.make
|
|
|
|
include $(APPSDIR)/codecs/libspc/libspc.make
|
|
|
|
include $(APPSDIR)/codecs/libspeex/libspeex.make
|
|
|
|
include $(APPSDIR)/codecs/libtremor/libtremor.make
|
|
|
|
include $(APPSDIR)/codecs/libwavpack/libwavpack.make
|
|
|
|
include $(APPSDIR)/codecs/libwma/libwma.make
|
2009-07-06 22:40:45 +00:00
|
|
|
include $(APPSDIR)/codecs/libcook/libcook.make
|
2009-07-25 15:13:50 +00:00
|
|
|
include $(APPSDIR)/codecs/librm/librm.make
|
2009-08-14 17:36:57 +00:00
|
|
|
include $(APPSDIR)/codecs/libatrac/libatrac.make
|
2008-11-20 11:27:31 +00:00
|
|
|
|
|
|
|
# compile flags for codecs
|
|
|
|
CODECFLAGS = $(CFLAGS) -I$(APPSDIR)/codecs -I$(APPSDIR)/codecs/lib \
|
|
|
|
-DCODEC
|
|
|
|
|
2009-02-09 18:31:56 +00:00
|
|
|
ifndef SIMVER
|
|
|
|
CODEC_LDS := $(APPSDIR)/plugins/plugin.lds # codecs and plugins use same file
|
|
|
|
CODECLINK_LDS := $(CODECDIR)/codec.link
|
|
|
|
endif
|
|
|
|
|
2008-11-20 11:27:31 +00:00
|
|
|
CODEC_CRT0 := $(CODECDIR)/codec_crt0.o
|
|
|
|
|
|
|
|
CODECLIBS := $(DEMACLIB) $(A52LIB) $(ALACLIB) $(ASAPLIB) \
|
|
|
|
$(FAADLIB) $(FFMPEGFLACLIB) $(M4ALIB) $(MADLIB) $(MUSEPACKLIB) \
|
2009-07-06 22:40:45 +00:00
|
|
|
$(SPCLIB) $(SPEEXLIB) $(TREMORLIB) $(WAVPACKLIB) $(WMALIB) $(COOKLIB) \
|
2009-08-14 17:36:57 +00:00
|
|
|
$(ATRACLIB) \
|
2008-11-20 11:27:31 +00:00
|
|
|
$(CODECLIB)
|
|
|
|
|
|
|
|
$(CODECS): $(CODEC_CRT0) $(CODECLINK_LDS)
|
|
|
|
|
|
|
|
$(CODECLINK_LDS): $(CODEC_LDS)
|
|
|
|
$(call PRINTS,PP $(@F))
|
2008-11-20 13:45:57 +00:00
|
|
|
$(shell mkdir -p $(dir $@))
|
2008-11-20 15:54:47 +00:00
|
|
|
$(call preprocess2file, $<, $@, -DCODEC)
|
2008-11-20 11:27:31 +00:00
|
|
|
|
|
|
|
# codec/library dependencies
|
|
|
|
$(CODECDIR)/spc.codec : $(CODECDIR)/libspc.a
|
|
|
|
$(CODECDIR)/mpa.codec : $(CODECDIR)/libmad.a
|
|
|
|
$(CODECDIR)/a52.codec : $(CODECDIR)/liba52.a
|
|
|
|
$(CODECDIR)/flac.codec : $(CODECDIR)/libffmpegFLAC.a
|
2009-08-29 12:23:40 +00:00
|
|
|
$(CODECDIR)/vorbis.codec : $(CODECDIR)/libtremor.a $(TLSFLIB)
|
2008-11-20 11:27:31 +00:00
|
|
|
$(CODECDIR)/speex.codec : $(CODECDIR)/libspeex.a
|
|
|
|
$(CODECDIR)/mpc.codec : $(CODECDIR)/libmusepack.a
|
|
|
|
$(CODECDIR)/wavpack.codec : $(CODECDIR)/libwavpack.a
|
|
|
|
$(CODECDIR)/alac.codec : $(CODECDIR)/libalac.a $(CODECDIR)/libm4a.a
|
|
|
|
$(CODECDIR)/aac.codec : $(CODECDIR)/libfaad.a $(CODECDIR)/libm4a.a
|
|
|
|
$(CODECDIR)/shorten.codec : $(CODECDIR)/libffmpegFLAC.a
|
|
|
|
$(CODECDIR)/ape.codec : $(CODECDIR)/libdemac.a
|
|
|
|
$(CODECDIR)/wma.codec : $(CODECDIR)/libwma.a
|
|
|
|
$(CODECDIR)/wavpack_enc.codec: $(CODECDIR)/libwavpack.a
|
|
|
|
$(CODECDIR)/asap.codec : $(CODECDIR)/libasap.a
|
2009-07-25 15:13:50 +00:00
|
|
|
$(CODECDIR)/cook.codec : $(CODECDIR)/libcook.a $(CODECDIR)/librm.a
|
2009-07-25 15:47:13 +00:00
|
|
|
$(CODECDIR)/raac.codec : $(CODECDIR)/libfaad.a $(CODECDIR)/librm.a
|
2009-08-04 15:05:56 +00:00
|
|
|
$(CODECDIR)/a52_rm.codec : $(CODECDIR)/liba52.a $(CODECDIR)/librm.a
|
2009-08-14 17:36:57 +00:00
|
|
|
$(CODECDIR)/atrac3_rm.codec : $(CODECDIR)/libatrac.a $(CODECDIR)/librm.a
|
2008-11-20 11:27:31 +00:00
|
|
|
|
|
|
|
$(CODECS): $(CODECLIB) # this must be last in codec dependency list
|
|
|
|
|
|
|
|
# libfaad and libmusepack both contain a huffman.h file, with different
|
|
|
|
# content. So we compile them with special command lines:
|
|
|
|
|
|
|
|
# pattern rule for compiling codecs
|
|
|
|
$(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.c
|
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
|
|
|
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
|
|
|
|
-I$(dir $<) $(CODECFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
# pattern rule for compiling codecs
|
|
|
|
$(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.S
|
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
|
|
|
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
|
|
|
|
-I$(dir $<) $(CODECFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
ifdef SIMVER
|
|
|
|
CODECLDFLAGS = $(SHARED_FLAG) # <-- from Makefile
|
|
|
|
else
|
|
|
|
CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
|
|
|
|
CODECFLAGS += -UDEBUG -DNDEBUG
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(CODECDIR)/%.codec: $(CODECDIR)/%.o
|
|
|
|
$(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \
|
|
|
|
$(filter %.o, $^) \
|
2009-03-02 08:16:36 +00:00
|
|
|
$(filter %.a, $+) \
|
2008-11-20 11:27:31 +00:00
|
|
|
-lgcc $(CODECLDFLAGS)
|
2008-11-20 12:09:36 +00:00
|
|
|
ifdef SIMVER
|
2008-11-20 12:44:49 +00:00
|
|
|
$(SILENT)cp $(CODECDIR)/$*.elf $@
|
2008-11-20 12:09:36 +00:00
|
|
|
else
|
|
|
|
$(SILENT)$(OC) -O binary $(CODECDIR)/$*.elf $@
|
|
|
|
endif
|