summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mpegplayer/Makefile')
-rw-r--r--apps/plugins/mpegplayer/Makefile116
1 files changed, 116 insertions, 0 deletions
diff --git a/apps/plugins/mpegplayer/Makefile b/apps/plugins/mpegplayer/Makefile
new file mode 100644
index 0000000000..46ea76633b
--- /dev/null
+++ b/apps/plugins/mpegplayer/Makefile
@@ -0,0 +1,116 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14
15
16ifdef APPEXTRA
17 INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
18endif
19
20LINKFILE := $(OBJDIR)/link.lds
21DEPFILE = $(OBJDIR)/dep-mpegplayer
22
23# This sets up 'SRC' based on the files mentioned in SOURCES
24include $(TOOLSDIR)/makesrc.inc
25
26SOURCES = $(SRC)
27OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
28OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
29DIRS = .
30
31LDS := ../plugin.lds
32OUTPUT = $(OUTDIR)/mpegplayer.rock
33
34all: $(OUTPUT)
35
36ifndef SIMVER
37$(OBJDIR)/mpegplayer.elf: $(OBJS) $(LINKFILE)
38 @echo "LD "`basename $@`
39 @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
40 -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/mpegplayer.map
41
42$(OUTPUT): $(OBJDIR)/mpegplayer.elf
43 @echo "OBJCOPY "`basename $@`
44 @$(OC) -O binary $< $@
45else
46
47ifeq ($(SIMVER), x11)
48###################################################
49# This is the X11 simulator version
50
51$(OUTPUT): $(OBJS)
52 @echo "LD $<"
53 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
54ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
55# 'x' must be kept or you'll have "Win32 error 5"
56# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
57# #define ERROR_ACCESS_DENIED 5L
58else
59 @chmod -x $@
60endif
61
62else # end of x11-simulator
63ifeq ($(SIMVER), sdl)
64###################################################
65# This is the SDL simulator version
66
67$(OUTPUT): $(OBJS)
68 @echo "LD $<"
69 @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
70ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
71# 'x' must be kept or you'll have "Win32 error 5"
72# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
73# #define ERROR_ACCESS_DENIED 5L
74else
75 @chmod -x $@
76endif
77
78else # end of sdl-simulator
79###################################################
80# This is the win32 simulator version
81DLLTOOLFLAGS = --export-all
82DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
83
84$(OUTPUT): $(OBJS)
85 @echo "DLL "`basename $@`
86 @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
87 @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
88 $(BUILDDIR)/libplugin.a -o $@
89ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
90# 'x' must be kept or you'll have "Win32 error 5"
91# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
92# #define ERROR_ACCESS_DENIED 5L
93else
94 @chmod -x $@
95endif
96endif # end of win32-simulator
97endif
98endif # end of simulator section
99
100
101include $(TOOLSDIR)/make.inc
102
103# MEMORYSIZE should be passed on to this makefile with the chosen memory size
104# given in number of MB
105$(LINKFILE): $(LDS)
106 @echo "build "`basename $@`
107 @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
108 $(DEFINES) -E -P - >$@
109
110clean:
111 @echo "cleaning mpegplayer"
112 @rm -rf $(OBJDIR)/mpegplayer
113 @rm -f $(OBJDIR)/mpegplayer.* $(DEPFILE)
114
115-include $(DEPFILE)
116