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 MADFLAGS
= $(CODECFLAGS
) -UDEBUG
-DNDEBUG
-O2
-I
$(APPSDIR
)/codecs
/libmad
-DHAVE_LIMITS_H
15 MPEGMADFLAGS
= $(MADFLAGS
) -DMPEGPLAYER
18 MADLIB
:= $(CODECDIR
)/libmad.a
19 MADLIB_SRC
:= $(call preprocess
, $(APPSDIR
)/codecs
/libmad
/SOURCES
)
20 MADLIB_OBJ
:= $(call c2obj
, $(MADLIB_SRC
))
21 OTHER_SRC
+= $(MADLIB_SRC
)
23 $(MADLIB
): $(MADLIB_OBJ
)
24 $(SILENT
)$(shell rm -f
$@
)
25 $(call PRINTS
,AR
$(@F
))$(AR
) rcs
$@
$^
>/dev
/null
28 MPEGMADLIB
:= $(CODECDIR
)/libmad-mpeg.a
29 MPEGMADLIB_SRC
:= $(call preprocess
, $(APPSDIR
)/codecs
/libmad
/SOURCES
)
30 MPEGMADLIB_OBJ
:= $(addsuffix .o
,$(basename $(subst $(ROOTDIR
)/apps
/codecs
/libmad
,$(BUILDDIR
)/apps
/codecs
/libmad-mpeg
,$(MPEGMADLIB_SRC
))))
32 $(MPEGMADLIB
): $(MPEGMADLIB_OBJ
)
33 $(call PRINTS
,AR
$(@F
))$(AR
) rcs
$@
$^
>/dev
/null
37 $(CODECDIR
)/libmad-mpeg
/%.o
: $(ROOTDIR
)/apps
/codecs
/libmad
/%.c
38 $(SILENT
)mkdir
-p
$(dir $@
)
39 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<)) \
40 $(CC
) $(MPEGMADFLAGS
) -c
$< -o
$@
42 $(CODECDIR
)/libmad-mpeg
/%.o
: $(ROOTDIR
)/apps
/codecs
/libmad
/%.S
43 $(SILENT
)mkdir
-p
$(dir $@
)
44 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<)) \
45 $(CC
) $(MPEGMADFLAGS
) -c
$< -o
$@
47 $(CODECDIR
)/libmad
/%.o
: $(ROOTDIR
)/apps
/codecs
/libmad
/%.c
48 $(SILENT
)mkdir
-p
$(dir $@
)
49 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<)) \
50 $(CC
) $(MADFLAGS
) -c
$< -o
$@
52 $(CODECDIR
)/libmad
/%.o
: $(ROOTDIR
)/apps
/codecs
/libmad
/%.S
53 $(SILENT
)mkdir
-p
$(dir $@
)
54 $(call PRINTS
,CC
$(subst $(ROOTDIR
)/,,$<)) \
55 $(CC
) $(MADFLAGS
) -c
$< -o
$@