Added 'keywords' and 'eol-style' properties.
[kugel-rb.git] / apps / codecs / codecs.make
blob2ba73af627df19543b58cf4693bbdedc83b53c0a
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 CODECDIR = $(BUILDDIR)/apps/codecs
11 CODECS_SRC := $(call preprocess, $(APPSDIR)/codecs/SOURCES)
12 OTHER_SRC += $(CODECS_SRC)
14 CODECS := $(CODECS_SRC:.c=.codec)
15 CODECS := $(subst $(ROOTDIR),$(BUILDDIR),$(CODECS))
17 # the codec helper library
18 include $(APPSDIR)/codecs/lib/libcodec.make
20 # the codec libraries
21 include $(APPSDIR)/codecs/demac/libdemac.make
22 include $(APPSDIR)/codecs/liba52/liba52.make
23 include $(APPSDIR)/codecs/libalac/libalac.make
24 include $(APPSDIR)/codecs/libasap/libasap.make
25 include $(APPSDIR)/codecs/libfaad/libfaad.make
26 include $(APPSDIR)/codecs/libffmpegFLAC/libffmpegFLAC.make
27 include $(APPSDIR)/codecs/libm4a/libm4a.make
28 include $(APPSDIR)/codecs/libmad/libmad.make
29 include $(APPSDIR)/codecs/libmusepack/libmusepack.make
30 include $(APPSDIR)/codecs/libspc/libspc.make
31 include $(APPSDIR)/codecs/libspeex/libspeex.make
32 include $(APPSDIR)/codecs/libtremor/libtremor.make
33 include $(APPSDIR)/codecs/libwavpack/libwavpack.make
34 include $(APPSDIR)/codecs/libwma/libwma.make
36 # compile flags for codecs
37 CODECFLAGS = $(CFLAGS) -I$(APPSDIR)/codecs -I$(APPSDIR)/codecs/lib \
38 -DCODEC
40 CODEC_LDS := $(APPSDIR)/plugins/plugin.lds # codecs and plugins use same file
41 CODECLINK_LDS := $(CODECDIR)/codec.link
42 CODEC_CRT0 := $(CODECDIR)/codec_crt0.o
44 CODECLIBS := $(DEMACLIB) $(A52LIB) $(ALACLIB) $(ASAPLIB) \
45 $(FAADLIB) $(FFMPEGFLACLIB) $(M4ALIB) $(MADLIB) $(MUSEPACKLIB) \
46 $(SPCLIB) $(SPEEXLIB) $(TREMORLIB) $(WAVPACKLIB) $(WMALIB) \
47 $(CODECLIB)
49 $(CODECS): $(CODEC_CRT0) $(CODECLINK_LDS)
51 $(CODECLINK_LDS): $(CODEC_LDS)
52 $(call PRINTS,PP $(@F))
53 $(shell mkdir -p $(dir $@))
54 $(call preprocess2file, $<, $@, -DCODEC)
56 # codec/library dependencies
57 $(CODECDIR)/spc.codec : $(CODECDIR)/libspc.a
58 $(CODECDIR)/mpa.codec : $(CODECDIR)/libmad.a
59 $(CODECDIR)/a52.codec : $(CODECDIR)/liba52.a
60 $(CODECDIR)/flac.codec : $(CODECDIR)/libffmpegFLAC.a
61 $(CODECDIR)/vorbis.codec : $(CODECDIR)/libtremor.a
62 $(CODECDIR)/speex.codec : $(CODECDIR)/libspeex.a
63 $(CODECDIR)/mpc.codec : $(CODECDIR)/libmusepack.a
64 $(CODECDIR)/wavpack.codec : $(CODECDIR)/libwavpack.a
65 $(CODECDIR)/alac.codec : $(CODECDIR)/libalac.a $(CODECDIR)/libm4a.a
66 $(CODECDIR)/aac.codec : $(CODECDIR)/libfaad.a $(CODECDIR)/libm4a.a
67 $(CODECDIR)/shorten.codec : $(CODECDIR)/libffmpegFLAC.a
68 $(CODECDIR)/ape.codec : $(CODECDIR)/libdemac.a
69 $(CODECDIR)/wma.codec : $(CODECDIR)/libwma.a
70 $(CODECDIR)/wavpack_enc.codec: $(CODECDIR)/libwavpack.a
71 $(CODECDIR)/asap.codec : $(CODECDIR)/libasap.a
73 $(CODECS): $(CODECLIB) # this must be last in codec dependency list
75 # libfaad and libmusepack both contain a huffman.h file, with different
76 # content. So we compile them with special command lines:
78 # pattern rule for compiling codecs
79 $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.c
80 $(SILENT)mkdir -p $(dir $@)
81 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
82 -I$(dir $<) $(CODECFLAGS) -c $< -o $@
84 # pattern rule for compiling codecs
85 $(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.S
86 $(SILENT)mkdir -p $(dir $@)
87 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
88 -I$(dir $<) $(CODECFLAGS) -c $< -o $@
90 ifdef SIMVER
91 CODECLDFLAGS = $(SHARED_FLAG) # <-- from Makefile
92 else
93 CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
94 CODECFLAGS += -UDEBUG -DNDEBUG
95 endif
97 $(CODECDIR)/%.codec: $(CODECDIR)/%.o
98 $(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \
99 $(filter %.o, $^) \
100 $(filter %.a, $^) \
101 -lgcc $(CODECLDFLAGS)
102 ifdef SIMVER
103 $(SILENT)cp $(CODECDIR)/$*.elf $@
104 else
105 $(SILENT)$(OC) -O binary $(CODECDIR)/$*.elf $@
106 endif