blob: d39d9fde1efe299dcd414ee9290fe02516c6b8e5 [file] [log] [blame]
Peter D'Hoye513389b2009-05-22 21:58:48 +00001# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10PDBOXSRCDIR := $(APPSDIR)/plugins/pdbox
11PDBOXBUILDDIR := $(BUILDDIR)/apps/plugins/pdbox
12
13ROCKS += $(PDBOXBUILDDIR)/pdbox.rock
14
Dominik Wenger8010eaf2009-06-02 20:24:05 +000015PDBOX_SRC := $(call preprocess, $(PDBOXSRCDIR)/SOURCES)
16PDBOX_OBJ := $(call c2obj, $(PDBOX_SRC))
Peter D'Hoye513389b2009-05-22 21:58:48 +000017
18# add source files to OTHERSRC to get automatic dependencies
Frank Gevaertsca755f72010-02-25 23:35:16 +000019OTHER_SRC += $(PDBOX_SRC)
Peter D'Hoye513389b2009-05-22 21:58:48 +000020
Magnus Holmgrenb11a7fd2009-09-23 18:36:13 +000021$(PDBOXBUILDDIR)/pdbox.rock: $(PDBOX_OBJ) $(MPEG_OBJ) $(CODECDIR)/libtlsf.a
Peter D'Hoye513389b2009-05-22 21:58:48 +000022
Frank Gevaerts3c78cb32010-06-21 16:34:13 +000023PDBOXFLAGS = $(PLUGINFLAGS)
Frank Gevaerts64276fc2010-07-03 21:16:59 +000024PDBOXLDFLAGS = $(PLUGINLDFLAGS)
25ifdef SIMVER
26PDBOXLDFLAGS += -lm
27endif
Peter D'Hoye513389b2009-05-22 21:58:48 +000028
29# Compile PDBox with extra flags (adapted from ZXBox)
Teruaki Kawashimae3fc65c2010-01-17 13:03:10 +000030$(PDBOXBUILDDIR)/%.o: $(PDBOXSRCDIR)/%.c $(PDBOXSRCDIR)/pdbox.make
Peter D'Hoye513389b2009-05-22 21:58:48 +000031 $(SILENT)mkdir -p $(dir $@)
32 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PDBOXFLAGS) -c $< -o $@
Frank Gevaerts64276fc2010-07-03 21:16:59 +000033
34$(PDBOXBUILDDIR)/pdbox.rock:
35 $(call PRINTS,LD $(@F))$(CC) $(PLUGINFLAGS) -o $*.elf \
36 $(filter %.o, $^) \
37 $(filter %.a, $+) \
38 -lgcc $(PDBOXLDFLAGS)
39ifdef SIMVER
40 $(SILENT)cp $*.elf $@
41else
42 $(SILENT)$(OC) -O binary $*.elf $@
43endif
44
45