diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/Makefile | 31 | ||||
-rw-r--r-- | apps/SOURCES | 2 | ||||
-rw-r--r-- | apps/codecs/libFLAC/Makefile | 15 | ||||
-rw-r--r-- | apps/main_menu.c | 7 | ||||
-rw-r--r-- | apps/plugin.c | 2 | ||||
-rw-r--r-- | apps/plugin.h | 2 | ||||
-rw-r--r-- | apps/plugins/Makefile | 41 | ||||
-rw-r--r-- | apps/plugins/lib/Makefile | 7 |
8 files changed, 79 insertions, 28 deletions
diff --git a/apps/Makefile b/apps/Makefile index 75b9fbafb3..bcdc1ef265 100644 --- a/apps/Makefile +++ b/apps/Makefile | |||
@@ -13,11 +13,6 @@ DEPFILE = $(OBJDIR)/dep-apps | |||
13 | LDS := $(FIRMDIR)/app.lds | 13 | LDS := $(FIRMDIR)/app.lds |
14 | ROMLDS := $(FIRMDIR)/rom.lds | 14 | ROMLDS := $(FIRMDIR)/rom.lds |
15 | 15 | ||
16 | ifdef DEBUG | ||
17 | DEFINES := -DDEBUG | ||
18 | CFLAGS += -g | ||
19 | endif | ||
20 | |||
21 | ifdef ENABLEDPLUGINS | 16 | ifdef ENABLEDPLUGINS |
22 | ROCKS=rocks | 17 | ROCKS=rocks |
23 | endif | 18 | endif |
@@ -26,7 +21,8 @@ ifdef SOFTWARECODECS | |||
26 | CODECS=build-codecs | 21 | CODECS=build-codecs |
27 | endif | 22 | endif |
28 | 23 | ||
29 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) | 24 | SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ |
25 | $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) | ||
30 | DIRS = . | 26 | DIRS = . |
31 | 27 | ||
32 | ifdef APPEXTRA | 28 | ifdef APPEXTRA |
@@ -44,9 +40,11 @@ LINKROM = $(OBJDIR)/linkrom.lds | |||
44 | MAXINFILE = $(OBJDIR)/romstart.temp | 40 | MAXINFILE = $(OBJDIR)/romstart.temp |
45 | MAXOUTFILE = $(OBJDIR)/romstart | 41 | MAXOUTFILE = $(OBJDIR)/romstart |
46 | 42 | ||
47 | ifdef DEBUG | 43 | ifdef SIMVER |
48 | all: $(OBJDIR)/rockbox.elf $(CODECS) $(ROCKS) | 44 | # this is a sim build |
45 | all: $(OBJDIR)/$(BINARY) $(CODECS) $(ROCKS) | ||
49 | else | 46 | else |
47 | # regular target build | ||
50 | all: $(OBJDIR)/$(BINARY) $(FLASHFILE) $(CODECS) $(ROCKS) $(ARCHOSROM) | 48 | all: $(OBJDIR)/$(BINARY) $(FLASHFILE) $(CODECS) $(ROCKS) $(ARCHOSROM) |
51 | endif | 49 | endif |
52 | 50 | ||
@@ -80,9 +78,11 @@ $(OBJDIR)/rombox.elf : $(OBJS) $(LINKROM) $(OBJDIR)/librockbox.a $(DEPFILE) | |||
80 | @echo "LD rombox.elf" | 78 | @echo "LD rombox.elf" |
81 | @$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMDIR) -T$(LINKROM) -Wl,-Map,$(OBJDIR)/rombox.map | 79 | @$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMDIR) -T$(LINKROM) -Wl,-Map,$(OBJDIR)/rombox.map |
82 | 80 | ||
81 | ifndef SIMVER | ||
82 | |||
83 | $(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(OBJDIR)/librockbox.a $(DEPFILE) | 83 | $(OBJDIR)/rockbox.elf : $(OBJS) $(LINKFILE) $(OBJDIR)/librockbox.a $(DEPFILE) |
84 | @echo "LD rockbox.elf" | 84 | @echo "LD rockbox.elf" |
85 | $(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -L$(FIRMDIR) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map | 85 | $(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -L$(OBJDIR) -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/rockbox.map |
86 | 86 | ||
87 | $(OBJDIR)/rockbox.bin : $(OBJDIR)/rockbox.elf | 87 | $(OBJDIR)/rockbox.bin : $(OBJDIR)/rockbox.elf |
88 | @echo "OBJCOPY $<" | 88 | @echo "OBJCOPY $<" |
@@ -99,6 +99,16 @@ $(OBJDIR)/$(BINARY) : $(OBJDIR)/rockbox.bin | |||
99 | @echo "Build firmware file" | 99 | @echo "Build firmware file" |
100 | @$(MKFIRMWARE) $< $@ | 100 | @$(MKFIRMWARE) $< $@ |
101 | 101 | ||
102 | else | ||
103 | # this is a simulator build | ||
104 | $(OBJDIR)/$(BINARY) : $(OBJS) $(OBJDIR)/librockbox.a $(DEPFILE) $(OBJDIR)/libsim.a | ||
105 | @echo "LD $(BINARY)" | ||
106 | $(CC) $(GCCOPTS) -o $@ $(OBJS) $(LDOPTS) -L$(OBJDIR) -lrockbox -lsim -Wl,-Map,$(OBJDIR)/rockbox.map | ||
107 | |||
108 | $(OBJDIR)/libsim.a: | ||
109 | @$(MAKE) -C $(SIMDIR) | ||
110 | endif | ||
111 | |||
102 | $(OBJDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin | 112 | $(OBJDIR)/rockbox.ucl: $(OBJDIR)/rockbox.bin |
103 | @a=`uclpack -h 2>/dev/null`; \ | 113 | @a=`uclpack -h 2>/dev/null`; \ |
104 | if test -n "$$a"; then \ | 114 | if test -n "$$a"; then \ |
@@ -160,5 +170,8 @@ clean: | |||
160 | @$(MAKE) -C plugins clean | 170 | @$(MAKE) -C plugins clean |
161 | @$(MAKE) -C codecs clean | 171 | @$(MAKE) -C codecs clean |
162 | @rm -rf $(OBJDIR)/recorder $(OBJDIR)/player | 172 | @rm -rf $(OBJDIR)/recorder $(OBJDIR)/player |
173 | ifdef SIMVER | ||
174 | @$(MAKE) -C $(SIMDIR) clean | ||
175 | endif | ||
163 | 176 | ||
164 | -include $(DEPFILE) | 177 | -include $(DEPFILE) |
diff --git a/apps/SOURCES b/apps/SOURCES index 43cd3ddfb2..33a6ded691 100644 --- a/apps/SOURCES +++ b/apps/SOURCES | |||
@@ -19,7 +19,9 @@ settings_menu.c | |||
19 | sleeptimer.c | 19 | sleeptimer.c |
20 | sound_menu.c | 20 | sound_menu.c |
21 | status.c | 21 | status.c |
22 | #ifndef SIMULATOR | ||
22 | talk.c | 23 | talk.c |
24 | #endif | ||
23 | tree.c | 25 | tree.c |
24 | dbtree.c | 26 | dbtree.c |
25 | filetree.c | 27 | filetree.c |
diff --git a/apps/codecs/libFLAC/Makefile b/apps/codecs/libFLAC/Makefile index 329de9c3fd..ee4feab769 100644 --- a/apps/codecs/libFLAC/Makefile +++ b/apps/codecs/libFLAC/Makefile | |||
@@ -14,11 +14,22 @@ ifdef APPEXTRA | |||
14 | INCLUDES += -I$(APPSDIR)/$(APPEXTRA) | 14 | INCLUDES += -I$(APPSDIR)/$(APPEXTRA) |
15 | endif | 15 | endif |
16 | 16 | ||
17 | FLACOPTS = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA -DFLAC__INTEGER_ONLY_LIBRARY -DVERSION=\"1.1.2\" -fomit-frame-pointer -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__ --param large-function-insns=10000 | 17 | NEWGCC=$(shell expr $(GCCNUM) ">" 303) |
18 | |||
19 | FLACOPTS = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA \ | ||
20 | -DFLAC__INTEGER_ONLY_LIBRARY -DVERSION=\"1.1.2\" -fomit-frame-pointer \ | ||
21 | -funroll-loops -finline-functions -Wall -W -Winline -DFLaC__INLINE=__inline__ | ||
22 | |||
23 | ifeq ($(NEWGCC), 1) | ||
24 | # this is 3.4.X options: | ||
25 | FLACOPTS += --param large-function-insns=10000 | ||
26 | endif | ||
27 | |||
18 | CFLAGS = $(GCCOPTS) $(FLACOPTS)\ | 28 | CFLAGS = $(GCCOPTS) $(FLACOPTS)\ |
19 | $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} | 29 | $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} |
20 | 30 | ||
21 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) | 31 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ |
32 | $(TARGET) $(DEFINES) -E -P -include "config.h" - ) | ||
22 | SOURCES = $(SRC) | 33 | SOURCES = $(SRC) |
23 | OBJS := $(SRC:%.c=$(OBJDIR)/libFLAC/%.o) | 34 | OBJS := $(SRC:%.c=$(OBJDIR)/libFLAC/%.o) |
24 | DEPFILE = $(OBJDIR)/dep-libFLAC | 35 | DEPFILE = $(OBJDIR)/dep-libFLAC |
diff --git a/apps/main_menu.c b/apps/main_menu.c index 3eb1d69fb5..c7cfb0ea70 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -274,13 +274,6 @@ static bool plugin_browse(void) | |||
274 | } | 274 | } |
275 | 275 | ||
276 | #ifdef HAVE_RECORDING | 276 | #ifdef HAVE_RECORDING |
277 | #ifdef SIMULATOR | ||
278 | bool recording_screen(void) | ||
279 | { | ||
280 | /* a dummy */ | ||
281 | return false; | ||
282 | } | ||
283 | #endif | ||
284 | 277 | ||
285 | static bool recording_settings(void) | 278 | static bool recording_settings(void) |
286 | { | 279 | { |
diff --git a/apps/plugin.c b/apps/plugin.c index 93717ccd06..10daeaf325 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -187,9 +187,7 @@ static const struct plugin_api rockbox_api = { | |||
187 | strncasecmp, | 187 | strncasecmp, |
188 | memset, | 188 | memset, |
189 | memcpy, | 189 | memcpy, |
190 | #ifndef SIMULATOR | ||
191 | _ctype_, | 190 | _ctype_, |
192 | #endif | ||
193 | atoi, | 191 | atoi, |
194 | 192 | ||
195 | /* sound */ | 193 | /* sound */ |
diff --git a/apps/plugin.h b/apps/plugin.h index 590d02a4d1..96a9aabe1d 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -211,9 +211,7 @@ struct plugin_api { | |||
211 | int (*strncasecmp)(const char *s1, const char *s2, size_t n); | 211 | int (*strncasecmp)(const char *s1, const char *s2, size_t n); |
212 | void* (*memset)(void *dst, int c, size_t length); | 212 | void* (*memset)(void *dst, int c, size_t length); |
213 | void* (*memcpy)(void *out, const void *in, size_t n); | 213 | void* (*memcpy)(void *out, const void *in, size_t n); |
214 | #ifndef SIMULATOR | ||
215 | const char *_ctype_; | 214 | const char *_ctype_; |
216 | #endif | ||
217 | int (*atoi)(const char *str); | 215 | int (*atoi)(const char *str); |
218 | 216 | ||
219 | /* sound */ | 217 | /* sound */ |
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile index 0c90bde9b1..6af39327bc 100644 --- a/apps/plugins/Makefile +++ b/apps/plugins/Makefile | |||
@@ -24,16 +24,19 @@ LDS := plugin.lds | |||
24 | LINKFILE := $(OBJDIR)/pluginlink.lds | 24 | LINKFILE := $(OBJDIR)/pluginlink.lds |
25 | DEPFILE = $(OBJDIR)/dep-plugins | 25 | DEPFILE = $(OBJDIR)/dep-plugins |
26 | 26 | ||
27 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) \ | 27 | SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ |
28 | $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) | 28 | $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) |
29 | ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) | 29 | ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) |
30 | SOURCES = $(SRC) | 30 | SOURCES = $(SRC) |
31 | ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) | 31 | ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) |
32 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | 32 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) |
33 | # as created by the cross-compiler for win32: | ||
34 | DEFS := $(SRC:%.c=$(OBJDIR)/%.def) | ||
33 | DIRS = . | 35 | DIRS = . |
34 | 36 | ||
35 | all: $(OBJDIR)/libplugin.a $(ROCKS) $(DEPFILE) | 37 | all: $(OBJDIR)/libplugin.a $(ROCKS) $(DEPFILE) |
36 | 38 | ||
39 | ifndef SIMVER | ||
37 | $(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a | 40 | $(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a |
38 | @echo "LD $@" | 41 | @echo "LD $@" |
39 | @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map | 42 | @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map |
@@ -41,6 +44,37 @@ $(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a | |||
41 | $(OBJDIR)/%.rock : $(OBJDIR)/%.elf | 44 | $(OBJDIR)/%.rock : $(OBJDIR)/%.elf |
42 | @echo "OBJCOPY $<" | 45 | @echo "OBJCOPY $<" |
43 | @$(OC) -O binary $< $@ | 46 | @$(OC) -O binary $< $@ |
47 | else | ||
48 | |||
49 | ifeq ($(SIMVER), x11) | ||
50 | ################################################### | ||
51 | # This is the X11 simulator version | ||
52 | |||
53 | $(OBJDIR)/%.rock : $(OBJDIR)/%.o $(APPSDIR)/plugin.h | ||
54 | @echo "LD $@" | ||
55 | @$(CC) $(APPCFLAGS) -DPLUGIN -shared $< -L$(OBJDIR) -lplugin -o $@ | ||
56 | ifeq ($(UNAME),CYGWIN) | ||
57 | # 'x' must be kept or you'll have "Win32 error 5" | ||
58 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
59 | # #define ERROR_ACCESS_DENIED 5L | ||
60 | else | ||
61 | @chmod -x $@ | ||
62 | endif | ||
63 | |||
64 | else # end of x11-simulator | ||
65 | ################################################### | ||
66 | # This is the win32 simulator version | ||
67 | DLLTOOLFLAGS = --export-all | ||
68 | DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin | ||
69 | |||
70 | $(OBJDIR)/%.rock : $(OBJDIR)/%.o $(APPSDIR)/plugin.h | ||
71 | @echo "DLL $@" | ||
72 | @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $< | ||
73 | @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/libplugin.a -o $@ | ||
74 | @chmod -x $@ | ||
75 | endif # end of win32-simulator | ||
76 | |||
77 | endif # end of simulator section | ||
44 | 78 | ||
45 | include $(TOOLSDIR)/make.inc | 79 | include $(TOOLSDIR)/make.inc |
46 | 80 | ||
@@ -56,7 +90,8 @@ $(LINKFILE): $(LDS) | |||
56 | 90 | ||
57 | clean: | 91 | clean: |
58 | @echo "cleaning plugins" | 92 | @echo "cleaning plugins" |
59 | @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) $(OBJS) | 93 | @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \ |
94 | $(OBJS) $(DEFS) | ||
60 | @$(MAKE) -C lib clean | 95 | @$(MAKE) -C lib clean |
61 | 96 | ||
62 | -include $(DEPFILE) | 97 | -include $(DEPFILE) |
diff --git a/apps/plugins/lib/Makefile b/apps/plugins/lib/Makefile index b9daf737c4..b492bb578f 100644 --- a/apps/plugins/lib/Makefile +++ b/apps/plugins/lib/Makefile | |||
@@ -18,9 +18,9 @@ INCLUDES += -I$(APPSDIR)/$(APPEXTRA) | |||
18 | endif | 18 | endif |
19 | 19 | ||
20 | CFLAGS = $(GCCOPTS) \ | 20 | CFLAGS = $(GCCOPTS) \ |
21 | $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} | 21 | $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -DPLUGIN |
22 | 22 | ||
23 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) | 23 | SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) |
24 | SOURCES = $(SRC) | 24 | SOURCES = $(SRC) |
25 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | 25 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) |
26 | DEPFILE = $(OBJDIR)/dep-pluginlib | 26 | DEPFILE = $(OBJDIR)/dep-pluginlib |
@@ -31,8 +31,9 @@ OUTPUT = $(OBJDIR)/libplugin.a | |||
31 | all: $(OUTPUT) | 31 | all: $(OUTPUT) |
32 | 32 | ||
33 | $(OUTPUT): $(OBJS) | 33 | $(OUTPUT): $(OBJS) |
34 | @echo "AR $@" | 34 | @echo "AR+RANLIB $@" |
35 | @$(AR) ruv $@ $+ >/dev/null 2>&1 | 35 | @$(AR) ruv $@ $+ >/dev/null 2>&1 |
36 | @$(RANLIB) $@ | ||
36 | 37 | ||
37 | include $(TOOLSDIR)/make.inc | 38 | include $(TOOLSDIR)/make.inc |
38 | 39 | ||