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