2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 # we need to build two different mad libraries
11 # (one for codec, one for mpegplayer)
12 # so a little trickery is necessary
14 # Extract optimization level ('-O') from compile flags. Will be set later.
15 MADFLAGS
= $(filter-out -O
%,$(CODECFLAGS
)) -I
$(APPSDIR
)/codecs
/libmad
16 MADFLAGS
+= -UDEBUG
-DNDEBUG
-DHAVE_LIMITS_H
18 # libmad is faster on ARM-targets with -O1 than -O2
26 MPEGMADFLAGS
= $(MADFLAGS
) -DMPEGPLAYER
29 MADLIB
:= $(CODECDIR
)/libmad.a
30 MADLIB_SRC
:= $(call preprocess
, $(APPSDIR
)/codecs
/libmad
/SOURCES
)
31 MADLIB_OBJ
:= $(call c2obj
, $(MADLIB_SRC
))
32 OTHER_SRC
+= $(MADLIB_SRC
)
34 $(MADLIB
): $(MADLIB_OBJ
)
35 $(SILENT
)$(shell rm -f
$@
)
36 $(call PRINTS
,AR
$(@F
))$(AR
) rcs
$@
$^
>/dev
/null
39 MPEGMADLIB
:= $(CODECDIR
)/libmad-mpeg.a
40 MPEGMADLIB_SRC
:= $(call preprocess
, $(APPSDIR
)/codecs
/libmad
/SOURCES
)
41 MPEGMADLIB_OBJ
:= $(addsuffix .o
,$(basename $(subst $(ROOTDIR
)/apps
/codecs
/libmad
,$(BUILDDIR
)/apps
/codecs
/libmad-mpeg
,$(MPEGMADLIB_SRC
))))
43 $(MPEGMADLIB
): $(MPEGMADLIB_OBJ
)
44 $(call PRINTS
,AR
$(@F
))$(AR
) rcs
$@
$^
>/dev
/null
48 $(CODECDIR
)/libmad-mpeg
/%.o
: $(ROOTDIR
)/apps
/codecs
/libmad
/%.c
49 $(SILENT
)mkdir
-p
$(dir $@
)
50 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<)) \
51 $(CC
) $(MPEGMADFLAGS
) -c
$< -o
$@
53 $(CODECDIR
)/libmad-mpeg
/%.o
: $(ROOTDIR
)/apps
/codecs
/libmad
/%.S
54 $(SILENT
)mkdir
-p
$(dir $@
)
55 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<)) \
56 $(CC
) $(MPEGMADFLAGS
) -c
$< -o
$@
58 $(CODECDIR
)/libmad
/%.o
: $(ROOTDIR
)/apps
/codecs
/libmad
/%.c
59 $(SILENT
)mkdir
-p
$(dir $@
)
60 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<)) \
61 $(CC
) $(MADFLAGS
) -c
$< -o
$@
63 $(CODECDIR
)/libmad
/%.o
: $(ROOTDIR
)/apps
/codecs
/libmad
/%.S
64 $(SILENT
)mkdir
-p
$(dir $@
)
65 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<)) \
66 $(CC
) $(MADFLAGS
) -c
$< -o
$@