diff options
Diffstat (limited to 'apps/plugins/mpegplayer/Makefile')
-rw-r--r-- | apps/plugins/mpegplayer/Makefile | 116 |
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 | |||
10 | INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ | ||
11 | -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) | ||
12 | CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \ | ||
13 | -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN | ||
14 | |||
15 | |||
16 | ifdef APPEXTRA | ||
17 | INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA))) | ||
18 | endif | ||
19 | |||
20 | LINKFILE := $(OBJDIR)/link.lds | ||
21 | DEPFILE = $(OBJDIR)/dep-mpegplayer | ||
22 | |||
23 | # This sets up 'SRC' based on the files mentioned in SOURCES | ||
24 | include $(TOOLSDIR)/makesrc.inc | ||
25 | |||
26 | SOURCES = $(SRC) | ||
27 | OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o) | ||
28 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | ||
29 | DIRS = . | ||
30 | |||
31 | LDS := ../plugin.lds | ||
32 | OUTPUT = $(OUTDIR)/mpegplayer.rock | ||
33 | |||
34 | all: $(OUTPUT) | ||
35 | |||
36 | ifndef 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 $< $@ | ||
45 | else | ||
46 | |||
47 | ifeq ($(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 $@ | ||
54 | ifeq ($(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 | ||
58 | else | ||
59 | @chmod -x $@ | ||
60 | endif | ||
61 | |||
62 | else # end of x11-simulator | ||
63 | ifeq ($(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 $@ | ||
70 | ifeq ($(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 | ||
74 | else | ||
75 | @chmod -x $@ | ||
76 | endif | ||
77 | |||
78 | else # end of sdl-simulator | ||
79 | ################################################### | ||
80 | # This is the win32 simulator version | ||
81 | DLLTOOLFLAGS = --export-all | ||
82 | DLLWRAPFLAGS = -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 $@ | ||
89 | ifeq ($(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 | ||
93 | else | ||
94 | @chmod -x $@ | ||
95 | endif | ||
96 | endif # end of win32-simulator | ||
97 | endif | ||
98 | endif # end of simulator section | ||
99 | |||
100 | |||
101 | include $(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 | |||
110 | clean: | ||
111 | @echo "cleaning mpegplayer" | ||
112 | @rm -rf $(OBJDIR)/mpegplayer | ||
113 | @rm -f $(OBJDIR)/mpegplayer.* $(DEPFILE) | ||
114 | |||
115 | -include $(DEPFILE) | ||
116 | |||