2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 INCLUDES
= -I
$(APPSDIR
) -I..
-I.
$(TARGET_INC
) -I
$(FIRMDIR
)/include -I
$(FIRMDIR
)/export \
11 -I
$(FIRMDIR
)/common
-I
$(FIRMDIR
)/drivers
-I
$(APPSDIR
)/plugins
/lib
-I
$(OUTDIR
) -I
$(BUILDDIR
)
12 CFLAGS
= $(INCLUDES
) $(GCCOPTS
) -O2
$(TARGET
) $(EXTRA_DEFINES
) \
13 -DTARGET_ID
=$(TARGET_ID
) -DMEM
=${MEMORYSIZE} -DPLUGIN
16 INCLUDES
+= $(patsubst %,-I
$(APPSDIR
)/%,$(subst :, ,$(APPEXTRA
)))
19 LINKFILE
:= $(OBJDIR
)/link.lds
20 DEPFILE
= $(OBJDIR
)/dep-mpegplayer
22 # This sets up 'SRC' based on the files mentioned in SOURCES
23 include $(TOOLSDIR
)/makesrc.inc
26 OBJS2
:= $(SRC
:%.c
=$(OBJDIR
)/%.o
)
27 OBJS
= $(patsubst %.S
, $(OBJDIR
)/%.o
, $(OBJS2
))
31 OUTPUT
= $(OUTDIR
)/mpegplayer.rock
35 .PHONY
: libmad-mpegplayer
37 $(BUILDDIR
)/libmad-mpegplayer.a
: libmad-mpegplayer
40 $(SILENT
)mkdir
-p
$(OBJDIR
)/libmad-mpegplayer
41 $(call PRINTS
,MAKE in libmad for mpegplayer
)$(MAKE
) -C
$(APPSDIR
)/codecs
/libmad MPEGPLAYER
=1 OBJDIR
=$(OBJDIR
)/libmad-mpegplayer OUTPUT
=$(BUILDDIR
)/libmad-mpegplayer.a
44 $(OBJDIR
)/mpegplayer.elf
: $(OBJS
) $(LINKFILE
) $(BUILDDIR
)/libmad-mpegplayer.a
45 $(call PRINTS
,LD
$(@F
))$(CC
) $(CFLAGS
) -o
$@
$(OBJS
) -L
$(BUILDDIR
) -lplugin
-lmad-mpegplayer
-lgcc\
46 $(LINKBITMAPS
) -T
$(LINKFILE
) -Wl
,--gc-sections
-Wl
,-Map
,$(OBJDIR
)/mpegplayer.map
48 $(OUTPUT
): $(OBJDIR
)/mpegplayer.elf
49 $(call PRINTS
,OBJCOPY
$(@F
))$(OC
) -O binary
$< $@
51 # This is the SDL simulator version
53 $(OUTPUT
): $(OBJS
) $(BUILDDIR
)/libmad-mpegplayer.a
54 $(call PRINTS
,LD
$(@F
))$(CC
) $(CFLAGS
) $(SHARED_FLAG
) $(OBJS
) -L
$(BUILDDIR
) -lplugin
$(LINKBITMAPS
) -lmad-mpegplayer
-o
$@
55 ifeq ($(findstring CYGWIN
,$(UNAME
)),CYGWIN
)
56 # 'x' must be kept or you'll have "Win32 error 5"
57 # $ fgrep 5 /usr/include/w32api/winerror.h | head -1
58 # #define ERROR_ACCESS_DENIED 5L
63 endif # end of sdl-simulator
65 include $(TOOLSDIR
)/make.inc
67 # MEMORYSIZE should be passed on to this makefile with the chosen memory size
68 # given in number of MB
70 $(call PRINTS
,build
$(@F
))cat
$< |
$(CC
) -DMEMORYSIZE
=$(MEMORYSIZE
) $(INCLUDES
) $(TARGET
) \
71 $(DEFINES
) -E
-P
- >$@
74 $(call PRINTS
,cleaning mpegplayer
)rm -rf
$(OBJDIR
)/mpegplayer
75 $(SILENT
)rm -f
$(OBJDIR
)/mpegplayer.
* $(DEPFILE
)