diff options
-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 | ||||
-rw-r--r-- | firmware/Makefile | 3 | ||||
-rw-r--r-- | firmware/SOURCES | 48 | ||||
-rw-r--r-- | firmware/common/timefuncs.c | 1 | ||||
-rw-r--r-- | firmware/debug.c | 1 | ||||
-rw-r--r-- | firmware/include/dir.h | 4 | ||||
-rw-r--r-- | firmware/include/stdio.h | 9 | ||||
-rw-r--r-- | firmware/include/time.h | 11 | ||||
-rw-r--r-- | firmware/mpeg.c | 7 | ||||
-rwxr-xr-x | tools/buildzip.pl | 6 | ||||
-rwxr-xr-x | tools/configure | 235 | ||||
-rw-r--r-- | uisimulator/FILES | 3 | ||||
-rw-r--r-- | uisimulator/common/Makefile | 56 | ||||
-rw-r--r-- | uisimulator/common/SOURCES | 8 | ||||
-rw-r--r-- | uisimulator/win32/Makefile | 220 | ||||
-rw-r--r-- | uisimulator/win32/SOURCES | 10 | ||||
-rw-r--r-- | uisimulator/x11/Makefile | 252 | ||||
-rw-r--r-- | uisimulator/x11/SOURCES | 10 |
25 files changed, 417 insertions, 574 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 | ||
diff --git a/firmware/Makefile b/firmware/Makefile index 966d9e048d..618a7703ac 100644 --- a/firmware/Makefile +++ b/firmware/Makefile | |||
@@ -11,7 +11,7 @@ INCLUDES=-Iinclude -I$(FIRMDIR) -Iexport -Icommon -Idrivers | |||
11 | 11 | ||
12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} | 12 | CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} |
13 | 13 | ||
14 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) | 14 | SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) |
15 | SOURCES = $(SRC) | 15 | SOURCES = $(SRC) |
16 | OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o | 16 | OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o |
17 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) | 17 | OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) |
@@ -29,6 +29,7 @@ $(TOOLSDIR)/convbdf: | |||
29 | $(OUTPUT): $(OBJS) $(DEPFILE) | 29 | $(OUTPUT): $(OBJS) $(DEPFILE) |
30 | @echo "AR $@" | 30 | @echo "AR $@" |
31 | @$(AR) ruv $@ $(OBJS) >/dev/null 2>&1 | 31 | @$(AR) ruv $@ $(OBJS) >/dev/null 2>&1 |
32 | @$(RANLIB) $@ | ||
32 | 33 | ||
33 | include $(TOOLSDIR)/make.inc | 34 | include $(TOOLSDIR)/make.inc |
34 | 35 | ||
diff --git a/firmware/SOURCES b/firmware/SOURCES index 535b221127..a5e95e7152 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -1,11 +1,15 @@ | |||
1 | #ifndef SIMULATOR | ||
1 | backlight.c | 2 | backlight.c |
3 | #endif | ||
2 | buffer.c | 4 | buffer.c |
3 | common/atoi.c | 5 | common/atoi.c |
4 | common/ctype.c | 6 | common/ctype.c |
7 | #ifndef SIMULATOR | ||
5 | common/dir.c | 8 | common/dir.c |
9 | common/file.c | ||
10 | #endif | ||
6 | common/disk.c | 11 | common/disk.c |
7 | common/errno.c | 12 | common/errno.c |
8 | common/file.c | ||
9 | common/memcmp.c | 13 | common/memcmp.c |
10 | common/qsort.c | 14 | common/qsort.c |
11 | common/random.c | 15 | common/random.c |
@@ -16,7 +20,7 @@ common/strcat.c | |||
16 | common/strchr.c | 20 | common/strchr.c |
17 | common/strcmp.c | 21 | common/strcmp.c |
18 | common/strcpy.c | 22 | common/strcpy.c |
19 | #if CONFIG_CPU == SH7034 | 23 | #if (CONFIG_CPU == SH7034) && !defined(SIMULATOR) |
20 | common/strlen_a.S | 24 | common/strlen_a.S |
21 | #else | 25 | #else |
22 | common/strlen.c | 26 | common/strlen.c |
@@ -33,7 +37,20 @@ common/memset_a.S | |||
33 | common/memcpy.c | 37 | common/memcpy.c |
34 | common/memset.c | 38 | common/memset.c |
35 | #endif | 39 | #endif |
36 | debug.c | 40 | #ifdef HAVE_LCD_CHARCELLS |
41 | drivers/lcd-player-charset.c | ||
42 | drivers/lcd-player.c | ||
43 | #endif | ||
44 | #ifdef HAVE_LCD_BITMAP | ||
45 | #if CONFIG_LCD == LCD_S1D15E06 | ||
46 | drivers/lcd-h100.c | ||
47 | #else | ||
48 | drivers/lcd-recorder.c | ||
49 | #endif | ||
50 | #endif | ||
51 | drivers/power.c | ||
52 | drivers/led.c | ||
53 | #ifndef SIMULATOR | ||
37 | drivers/adc.c | 54 | drivers/adc.c |
38 | #ifdef HAVE_MMC | 55 | #ifdef HAVE_MMC |
39 | drivers/ata_mmc.c | 56 | drivers/ata_mmc.c |
@@ -54,42 +71,35 @@ tuner_philips.c | |||
54 | #endif | 71 | #endif |
55 | #endif | 72 | #endif |
56 | drivers/i2c.c | 73 | drivers/i2c.c |
57 | #ifdef HAVE_LCD_CHARCELLS | ||
58 | drivers/lcd-player-charset.c | ||
59 | drivers/lcd-player.c | ||
60 | #endif | ||
61 | #ifdef HAVE_LCD_BITMAP | ||
62 | #if CONFIG_LCD == LCD_S1D15E06 | ||
63 | drivers/lcd-h100.c | ||
64 | #else | ||
65 | drivers/lcd-recorder.c | ||
66 | #endif | ||
67 | #endif | ||
68 | drivers/led.c | ||
69 | #if CONFIG_HWCODEC != MASNONE | 74 | #if CONFIG_HWCODEC != MASNONE |
70 | drivers/mas.c | 75 | drivers/mas.c |
71 | #endif | 76 | #endif |
72 | drivers/power.c | ||
73 | #ifdef HAVE_RTC | 77 | #ifdef HAVE_RTC |
74 | drivers/rtc.c | 78 | drivers/rtc.c |
75 | #endif | 79 | #endif |
76 | drivers/serial.c | 80 | drivers/serial.c |
81 | #endif /* !SIMULATOR */ | ||
77 | #ifdef HAVE_LCD_BITMAP | 82 | #ifdef HAVE_LCD_BITMAP |
78 | font.c | 83 | font.c |
79 | #endif | 84 | #endif |
80 | hwcompat.c | 85 | hwcompat.c |
81 | id3.c | 86 | id3.c |
87 | #ifndef SIMULATOR | ||
82 | kernel.c | 88 | kernel.c |
89 | rolo.c | ||
90 | thread.c | ||
91 | crt0.S | ||
92 | #endif | ||
83 | mp3_playback.c | 93 | mp3_playback.c |
84 | mp3data.c | 94 | mp3data.c |
85 | mpeg.c | 95 | mpeg.c |
96 | #ifndef WIN32 /* the win32 sim has its own versin of these: */ | ||
86 | panic.c | 97 | panic.c |
98 | debug.c | ||
99 | #endif | ||
87 | powermgmt.c | 100 | powermgmt.c |
88 | rolo.c | ||
89 | system.c | 101 | system.c |
90 | thread.c | ||
91 | usb.c | 102 | usb.c |
92 | crt0.S | ||
93 | #if CONFIG_CPU == SH7034 | 103 | #if CONFIG_CPU == SH7034 |
94 | bitswap.S | 104 | bitswap.S |
95 | descramble.S | 105 | descramble.S |
diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c index 1e95733399..1a256cc05e 100644 --- a/firmware/common/timefuncs.c +++ b/firmware/common/timefuncs.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | #include <stdio.h> /* get NULL */ | ||
20 | #include "config.h" | 21 | #include "config.h" |
21 | 22 | ||
22 | #include "rtc.h" | 23 | #include "rtc.h" |
diff --git a/firmware/debug.c b/firmware/debug.c index 5cc032b1b3..0989e80b17 100644 --- a/firmware/debug.c +++ b/firmware/debug.c | |||
@@ -222,6 +222,7 @@ void debugf(const char *fmt, ...) | |||
222 | void debug_init(void) | 222 | void debug_init(void) |
223 | { | 223 | { |
224 | } | 224 | } |
225 | extern void *stderr; | ||
225 | 226 | ||
226 | void debugf(const char *fmt, ...) | 227 | void debugf(const char *fmt, ...) |
227 | { | 228 | { |
diff --git a/firmware/include/dir.h b/firmware/include/dir.h index 8dcbb8e900..12ec724692 100644 --- a/firmware/include/dir.h +++ b/firmware/include/dir.h | |||
@@ -22,8 +22,6 @@ | |||
22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
23 | #include <file.h> | 23 | #include <file.h> |
24 | 24 | ||
25 | #ifndef DIRENT_DEFINED | ||
26 | |||
27 | #define ATTR_READ_ONLY 0x01 | 25 | #define ATTR_READ_ONLY 0x01 |
28 | #define ATTR_HIDDEN 0x02 | 26 | #define ATTR_HIDDEN 0x02 |
29 | #define ATTR_SYSTEM 0x04 | 27 | #define ATTR_SYSTEM 0x04 |
@@ -32,6 +30,8 @@ | |||
32 | #define ATTR_ARCHIVE 0x20 | 30 | #define ATTR_ARCHIVE 0x20 |
33 | #define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */ | 31 | #define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */ |
34 | 32 | ||
33 | #ifndef DIRENT_DEFINED | ||
34 | |||
35 | struct dirent { | 35 | struct dirent { |
36 | unsigned char d_name[MAX_PATH]; | 36 | unsigned char d_name[MAX_PATH]; |
37 | int attribute; | 37 | int attribute; |
diff --git a/firmware/include/stdio.h b/firmware/include/stdio.h index b98f01c729..968bd59aab 100644 --- a/firmware/include/stdio.h +++ b/firmware/include/stdio.h | |||
@@ -36,4 +36,13 @@ | |||
36 | int snprintf (char *buf, size_t size, const char *fmt, ...); | 36 | int snprintf (char *buf, size_t size, const char *fmt, ...); |
37 | int vsnprintf (char *buf, int size, const char *fmt, __VALIST ap); | 37 | int vsnprintf (char *buf, int size, const char *fmt, __VALIST ap); |
38 | 38 | ||
39 | #ifdef SIMULATOR | ||
40 | typedef void FILE; | ||
41 | int vfprintf(FILE *stream, const char *format, __VALIST ap); | ||
42 | #ifdef WIN32 | ||
43 | #define FILENAME_MAX 260 /* ugly hard-coded value of a limit that is set | ||
44 | in file.h */ | ||
45 | #endif | ||
46 | #endif | ||
47 | |||
39 | #endif /* _STDIO_H_ */ | 48 | #endif /* _STDIO_H_ */ |
diff --git a/firmware/include/time.h b/firmware/include/time.h index 5213468662..267face71b 100644 --- a/firmware/include/time.h +++ b/firmware/include/time.h | |||
@@ -20,5 +20,16 @@ struct tm | |||
20 | int tm_isdst; | 20 | int tm_isdst; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | #if defined(SIMULATOR) && !defined(_TIME_T_DEFINED) | ||
24 | /* for non-win32 simulators */ | ||
25 | typedef long time_t; | ||
26 | |||
27 | /* this define below is used by the mingw headers to prevent duplicate | ||
28 | typedefs */ | ||
29 | #define _TIME_T_DEFINED | ||
30 | time_t time(time_t *t); | ||
31 | |||
32 | #endif | ||
33 | |||
23 | #endif /* _TIME_H_ */ | 34 | #endif /* _TIME_H_ */ |
24 | 35 | ||
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index e9ddb18556..8673da9980 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c | |||
@@ -2485,9 +2485,12 @@ unsigned long mpeg_num_recorded_bytes(void) | |||
2485 | return 0; | 2485 | return 0; |
2486 | } | 2486 | } |
2487 | 2487 | ||
2488 | #elif CONFIG_HWCODEC == MASNONE | 2488 | #elif (CONFIG_HWCODEC == MASNONE) || defined(SIMULATOR) |
2489 | 2489 | ||
2490 | /* dummies coming up */ | 2490 | /* dummies coming up |
2491 | |||
2492 | NOTE: when we implment these functions for real for software coded targets, | ||
2493 | these dummies shall remain for the simulator */ | ||
2491 | 2494 | ||
2492 | void bitswap(unsigned char *data, int length) | 2495 | void bitswap(unsigned char *data, int length) |
2493 | { | 2496 | { |
diff --git a/tools/buildzip.pl b/tools/buildzip.pl index 2179298b8d..b44ed91e8e 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl | |||
@@ -166,10 +166,10 @@ sub runone { | |||
166 | 166 | ||
167 | my $target = $ARGV[0]; | 167 | my $target = $ARGV[0]; |
168 | 168 | ||
169 | my $exe = ""; | 169 | my $exe = $ARGV[1]; |
170 | 170 | ||
171 | if($target !~ /sim/i) { | 171 | if(!$exe) { |
172 | # not a simulator | 172 | # not specified, guess! |
173 | if($target =~ /(recorder|ondio)/i) { | 173 | if($target =~ /(recorder|ondio)/i) { |
174 | $exe = "ajbrec.ajz"; | 174 | $exe = "ajbrec.ajz"; |
175 | } | 175 | } |
diff --git a/tools/configure b/tools/configure index ac007716bd..364a3d707e 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -19,32 +19,83 @@ input() { | |||
19 | echo $response | 19 | echo $response |
20 | } | 20 | } |
21 | 21 | ||
22 | prefixtools () { | ||
23 | prefix="$1" | ||
24 | CC=${prefix}gcc | ||
25 | WINDRES=${prefix}windres | ||
26 | DLLTOOL=${prefix}dlltool | ||
27 | DLLWRAP=${prefix}dllwrap | ||
28 | RANLIB=${prefix}ranlib | ||
29 | LD=${prefix}ld | ||
30 | AR=${prefix}ar | ||
31 | AS=${prefix}as | ||
32 | OC=${prefix}objcopy | ||
33 | } | ||
34 | |||
35 | crosswincc () { | ||
36 | # naive approach to selecting a mingw cross-compiler on linux/*nix | ||
37 | echo "Enabling win32 crosscompiling" | ||
38 | |||
39 | prefixtools i386-mingw32msvc- | ||
40 | |||
41 | LDOPTS="-lgdi32 -luser32 -mwindows" | ||
42 | # add cross-compiler option(s) | ||
43 | GCCOPTS="$GCCOPTS -mno-cygwin" | ||
44 | } | ||
45 | |||
46 | simcc () { | ||
47 | |||
48 | # default tool setup for native building | ||
49 | prefixtools "" | ||
50 | |||
51 | GCCOPTS='-W -Wall -g -fno-builtin -I$(ROOTDIR)/uisimulator/common -I$(ROOTDIR)/uisimulator/$(SIMVER)' | ||
52 | |||
53 | output="rockboxui" # use this as default output binary name | ||
54 | |||
55 | case $uname in | ||
56 | CYGWIN*) | ||
57 | echo "Cygwin host detected" | ||
58 | LDOPTS='-L/usr/X11R6/lib -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 -lpthread' | ||
59 | output="rockboxui.exe" # use this as output binary name | ||
60 | ;; | ||
61 | |||
62 | Linux) | ||
63 | echo "Linux host detected" | ||
64 | LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -lnsl -ldl -lpthread' | ||
65 | if [ "$simver" = "win32" ]; then | ||
66 | crosswincc # setup cross-compiler | ||
67 | fi | ||
68 | ;; | ||
69 | |||
70 | FreeBSD) | ||
71 | echo "FreeBSD host detected" | ||
72 | LDOPTS='-L/usr/X11R6/lib -lX11 -lm -lXt -lXmu -dl -lpthread' | ||
73 | if [ "$simver" = "win32" ]; then | ||
74 | crosswincc # setup cross-compiler | ||
75 | fi | ||
76 | ;; | ||
77 | |||
78 | *) | ||
79 | echo "Unsupported system: $uname, fix configure and retry" | ||
80 | exit | ||
81 | ;; | ||
82 | esac | ||
83 | } | ||
84 | |||
22 | shcc () { | 85 | shcc () { |
23 | CC=sh-elf-gcc | 86 | prefixtools sh-elf- |
24 | LD=sh-elf-ld | ||
25 | AR=sh-elf-ar | ||
26 | AS=sh-elf-as | ||
27 | OC=sh-elf-objcopy | ||
28 | GCCOPTS="$CCOPTS -m1" | 87 | GCCOPTS="$CCOPTS -m1" |
29 | GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns" | 88 | GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns" |
30 | } | 89 | } |
31 | 90 | ||
32 | calmrisccc () { | 91 | calmrisccc () { |
33 | CC=calmrisc16-unknown-elf-gcc | 92 | prefixtools calmrisc16-unknown-elf- |
34 | LD=calmrisc16-unknown-elf-ld | ||
35 | AR=calmrisc16-unknown-elf-ar | ||
36 | AS=calmrisc16-unknown-elf-as | ||
37 | OC=calmrisc16-unknown-elf-objcopy | ||
38 | GCCOPTS="-Wl\,--no-check-sections $CCOPTS" | 93 | GCCOPTS="-Wl\,--no-check-sections $CCOPTS" |
39 | GCCOPTIMIZE="-fomit-frame-pointer" | 94 | GCCOPTIMIZE="-fomit-frame-pointer" |
40 | } | 95 | } |
41 | 96 | ||
42 | coldfirecc () { | 97 | coldfirecc () { |
43 | CC=m68k-elf-gcc | 98 | prefixtools m68k-elf- |
44 | LD=m68k-elf-ld | ||
45 | AR=m68k-elf-ar | ||
46 | AS=m68k-elf-as | ||
47 | OC=m68k-elf-objcopy | ||
48 | GCCOPTS="$CCOPTS -g -m5200 -Wa\,-m5249 -malign-int -mstrict-align" | 99 | GCCOPTS="$CCOPTS -g -m5200 -Wa\,-m5249 -malign-int -mstrict-align" |
49 | GCCOPTIMIZE="-fomit-frame-pointer" | 100 | GCCOPTIMIZE="-fomit-frame-pointer" |
50 | } | 101 | } |
@@ -86,6 +137,13 @@ if [ -z "$simver" ]; then | |||
86 | case $option in | 137 | case $option in |
87 | [Ww]) | 138 | [Ww]) |
88 | simver="win32" | 139 | simver="win32" |
140 | |||
141 | WINDRES=windres | ||
142 | DLLTOOL=dlltool | ||
143 | DLLWRAP=dllwrap | ||
144 | |||
145 | # make sure the code knows this is for win32 | ||
146 | extradefines="$extradefines -DWIN32" | ||
89 | ;; | 147 | ;; |
90 | *) | 148 | *) |
91 | simver="x11" | 149 | simver="x11" |
@@ -95,77 +153,6 @@ if [ -z "$simver" ]; then | |||
95 | fi | 153 | fi |
96 | } | 154 | } |
97 | 155 | ||
98 | |||
99 | simul () { | ||
100 | |||
101 | sed > Makefile \ | ||
102 | -e "s,@ROOTDIR@,${rootdir},g" \ | ||
103 | -e "s,@ARCHOS@,${archos},g" \ | ||
104 | -e "s,@DEBUG@,${debug},g" \ | ||
105 | -e "s,@KEYPAD@,${keypad},g" \ | ||
106 | -e "s,@PWD@,${pwd},g" \ | ||
107 | -e "s,@LANGUAGE@,${language},g" \ | ||
108 | -e "s,@TARGET@,${target},g" \ | ||
109 | -e "s,@PLUGINS@,${plugins},g" \ | ||
110 | -e "s,@CODECS@,${codecs},g" \ | ||
111 | -e "s,@SIMVER@,${simver},g" \ | ||
112 | -e "s,@MEMORY@,${memory},g" \ | ||
113 | <<EOF | ||
114 | ## Automaticly generated. http://rockbox.haxx.se | ||
115 | |||
116 | export ARCHOS=@ARCHOS@ | ||
117 | export ROOTDIR=@ROOTDIR@ | ||
118 | export FIRMDIR=\$(ROOTDIR)/firmware | ||
119 | export APPSDIR=\$(ROOTDIR)/apps | ||
120 | export TOOLSDIR=\$(ROOTDIR)/tools | ||
121 | export DOCSDIR=\$(ROOTDIR)/docs | ||
122 | export APPSDIR=@ROOTDIR@/apps | ||
123 | export SIMDIR=\$(ROOTDIR)/uisimulator/@SIMVER@ | ||
124 | export DEBUG=@DEBUG@ | ||
125 | export KEYPAD=@KEYPAD@ | ||
126 | export OBJDIR=@PWD@ | ||
127 | export SIMVER=@SIMVER@ | ||
128 | export TARGET=@TARGET@ | ||
129 | export LANGUAGE=@LANGUAGE@ | ||
130 | export VERSION=\$(shell date +%y%m%d-%H%M) | ||
131 | export ENABLEDPLUGINS=@PLUGINS@ | ||
132 | export SOFTWARECODECS=@CODECS@ | ||
133 | export MEMORYSIZE=@MEMORY@ | ||
134 | |||
135 | .PHONY: | ||
136 | |||
137 | all: sim | ||
138 | |||
139 | sim: | ||
140 | \$(MAKE) -C \$(SIMDIR) | ||
141 | |||
142 | clean: | ||
143 | \$(MAKE) -C \$(SIMDIR) clean | ||
144 | rm -rf rockbox.zip | ||
145 | |||
146 | tags: | ||
147 | @rm -f TAGS | ||
148 | make -C \$(SIMDIR) tags | ||
149 | |||
150 | zip: | ||
151 | \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" sim\$(TARGET) | ||
152 | |||
153 | install: | ||
154 | @echo "installing a full setup in your archos dir" | ||
155 | @(make zip && cd archos && unzip -oq ../rockbox.zip) | ||
156 | EOF | ||
157 | |||
158 | echo "Created Makefile" | ||
159 | |||
160 | if [ -d "archos" ]; then | ||
161 | echo "sub directory archos already present" | ||
162 | else | ||
163 | mkdir archos | ||
164 | echo "created an archos subdirectory for simulating the hard disk" | ||
165 | fi | ||
166 | |||
167 | } | ||
168 | |||
169 | picklang() { | 156 | picklang() { |
170 | # figure out which languages that are around | 157 | # figure out which languages that are around |
171 | for file in $rootdir/apps/lang/*.lang; do | 158 | for file in $rootdir/apps/lang/*.lang; do |
@@ -238,7 +225,7 @@ if [ "$target" = "update" ]; then | |||
238 | else | 225 | else |
239 | 226 | ||
240 | echo "This script will setup your Rockbox build environment." | 227 | echo "This script will setup your Rockbox build environment." |
241 | echo "Further docs here: http://rockbox.haxx.se/docs/" | 228 | echo "Further docs here: http://www.rockbox.org/" |
242 | echo "" | 229 | echo "" |
243 | 230 | ||
244 | fi | 231 | fi |
@@ -471,6 +458,7 @@ if [ -z "$debug" ]; then | |||
471 | [Ss]) | 458 | [Ss]) |
472 | debug="1" | 459 | debug="1" |
473 | simulator="yes" | 460 | simulator="yes" |
461 | extradefines="-DSIMULATOR" | ||
474 | echo "Simulator build selected" | 462 | echo "Simulator build selected" |
475 | whichsim | 463 | whichsim |
476 | ;; | 464 | ;; |
@@ -504,10 +492,43 @@ if [ -z "$language" ]; then | |||
504 | echo "Language set to $language" | 492 | echo "Language set to $language" |
505 | fi | 493 | fi |
506 | 494 | ||
495 | uname=`uname` | ||
496 | |||
507 | if [ "yes" = "$simulator" ]; then | 497 | if [ "yes" = "$simulator" ]; then |
508 | # we have already dealt with the simulator Makefile separately | 498 | # setup compiler and things for simulator |
509 | simul | 499 | simcc |
510 | exit | 500 | |
501 | if [ -d "archos" ]; then | ||
502 | echo "sub directory archos already present" | ||
503 | else | ||
504 | mkdir archos | ||
505 | echo "created an archos subdirectory for simulating the hard disk" | ||
506 | fi | ||
507 | fi | ||
508 | |||
509 | # Now, figure out version number of the (gcc) compiler we are about to use | ||
510 | gccver=`$CC -dumpversion`; | ||
511 | |||
512 | if [ -z "$gccver" ]; then | ||
513 | echo "WARNING: The compiler you must use ($CC) is not in your path!" | ||
514 | echo "WARNING: this may cause your build to fail since we cannot do the" | ||
515 | echo "WARNING: checks we want now." | ||
516 | else | ||
517 | |||
518 | # gccver should now be "3.3.5", "3.4.3", "2.95.3-6" and similar, but don't | ||
519 | # DEPEND on it | ||
520 | |||
521 | num1=`echo $gccver | cut -d . -f1` | ||
522 | num2=`echo $gccver | cut -d . -f2` | ||
523 | gccnum=`(expr $num1 "*" 100 + $num2) 2>/dev/null` | ||
524 | |||
525 | # This makes: | ||
526 | # 3.3.X => 303 | ||
527 | # 3.4.X => 304 | ||
528 | # 2.95.3 => 295 | ||
529 | |||
530 | echo "Using $CC $gccver ($gccnum)" | ||
531 | |||
511 | fi | 532 | fi |
512 | 533 | ||
513 | sed > Makefile \ | 534 | sed > Makefile \ |
@@ -523,6 +544,10 @@ sed > Makefile \ | |||
523 | -e "s,@AR@,${AR},g" \ | 544 | -e "s,@AR@,${AR},g" \ |
524 | -e "s,@AS@,${AS},g" \ | 545 | -e "s,@AS@,${AS},g" \ |
525 | -e "s,@OC@,${OC},g" \ | 546 | -e "s,@OC@,${OC},g" \ |
547 | -e "s,@WINDRES@,${WINDRES},g" \ | ||
548 | -e "s,@DLLTOOL@,${DLLTOOL},g" \ | ||
549 | -e "s,@DLLWRAP@,${DLLWRAP},g" \ | ||
550 | -e "s,@RANLIB@,${RANLIB},g" \ | ||
526 | -e "s,@TOOL@,${tool},g" \ | 551 | -e "s,@TOOL@,${tool},g" \ |
527 | -e "s,@OUTPUT@,${output},g" \ | 552 | -e "s,@OUTPUT@,${output},g" \ |
528 | -e "s,@APPEXTRA@,${appextra},g" \ | 553 | -e "s,@APPEXTRA@,${appextra},g" \ |
@@ -531,11 +556,15 @@ sed > Makefile \ | |||
531 | -e "s,@PLUGINS@,${plugins},g" \ | 556 | -e "s,@PLUGINS@,${plugins},g" \ |
532 | -e "s,@CODECS@,${codecs},g" \ | 557 | -e "s,@CODECS@,${codecs},g" \ |
533 | -e "s,@GCCOPTS@,${GCCOPTS},g" \ | 558 | -e "s,@GCCOPTS@,${GCCOPTS},g" \ |
559 | -e "s,@LDOPTS@,${LDOPTS},g" \ | ||
534 | -e "s,@LOADADDRESS@,${loadaddress},g" \ | 560 | -e "s,@LOADADDRESS@,${loadaddress},g" \ |
535 | -e "s,@EXTRADEF@,${extradefines},g" \ | 561 | -e "s,@EXTRADEF@,${extradefines},g" \ |
536 | -e "s,@APPSDIR@,${appsdir},g" \ | 562 | -e "s,@APPSDIR@,${appsdir},g" \ |
563 | -e "s,@SIMVER@,${simver},g" \ | ||
564 | -e "s,@GCCVER@,${gccver},g" \ | ||
565 | -e "s,@GCCNUM@,${gccnum},g" \ | ||
537 | <<EOF | 566 | <<EOF |
538 | ## Automaticly generated. http://rockbox.haxx.se | 567 | ## Automaticly generated. http://www.rockbox.org/ |
539 | 568 | ||
540 | export ROOTDIR=@ROOTDIR@ | 569 | export ROOTDIR=@ROOTDIR@ |
541 | export FIRMDIR=\$(ROOTDIR)/firmware | 570 | export FIRMDIR=\$(ROOTDIR)/firmware |
@@ -562,8 +591,17 @@ export LD=@LD@ | |||
562 | export AR=@AR@ | 591 | export AR=@AR@ |
563 | export AS=@AS@ | 592 | export AS=@AS@ |
564 | export OC=@OC@ | 593 | export OC=@OC@ |
594 | export WINDRES=@WINDRES@ | ||
595 | export DLLTOOL=@DLLTOOL@ | ||
596 | export DLLWRAP=@DLLWRAP@ | ||
597 | export RANLIB=@RANLIB@ | ||
565 | export GCCOPTS=@GCCOPTS@ | 598 | export GCCOPTS=@GCCOPTS@ |
566 | export LOADADDRESS=@LOADADDRESS@ | 599 | export LOADADDRESS=@LOADADDRESS@ |
600 | export SIMVER=@SIMVER@ | ||
601 | export SIMDIR=\$(ROOTDIR)/uisimulator/\$(SIMVER) | ||
602 | export LDOPTS=@LDOPTS@ | ||
603 | export GCCVER=@GCCVER@ | ||
604 | export GCCNUM=@GCCNUM@ | ||
567 | 605 | ||
568 | .PHONY: all clean tags zip | 606 | .PHONY: all clean tags zip |
569 | 607 | ||
@@ -583,8 +621,19 @@ tags: | |||
583 | \$(MAKE) -C \$(APPSDIR)/plugins tags | 621 | \$(MAKE) -C \$(APPSDIR)/plugins tags |
584 | \$(MAKE) -C \$(APPSDIR)/plugins/lib tags | 622 | \$(MAKE) -C \$(APPSDIR)/plugins/lib tags |
585 | 623 | ||
586 | zip: | 624 | zip: all |
587 | \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET) | 625 | \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY) |
626 | EOF | ||
627 | |||
628 | if [ "yes" = "$simulator" ]; then | ||
629 | |||
630 | cat >> Makefile <<EOF | ||
631 | |||
632 | install: | ||
633 | @echo "installing a full setup in your archos dir" | ||
634 | @(make zip && cd archos && unzip -oq ../rockbox.zip) | ||
588 | EOF | 635 | EOF |
589 | 636 | ||
637 | fi | ||
638 | |||
590 | echo "Created Makefile" | 639 | echo "Created Makefile" |
diff --git a/uisimulator/FILES b/uisimulator/FILES index 5735d135dd..66ebcfec6b 100644 --- a/uisimulator/FILES +++ b/uisimulator/FILES | |||
@@ -14,3 +14,6 @@ win32/rockbox.ico | |||
14 | x11/*.[ch] | 14 | x11/*.[ch] |
15 | x11/Makefile | 15 | x11/Makefile |
16 | x11/archos/rockbox112.bmp | 16 | x11/archos/rockbox112.bmp |
17 | common/SOURCES | ||
18 | win32/SOURCES | ||
19 | x11/SOURCES | ||
diff --git a/uisimulator/common/Makefile b/uisimulator/common/Makefile new file mode 100644 index 0000000000..b044440adf --- /dev/null +++ b/uisimulator/common/Makefile | |||
@@ -0,0 +1,56 @@ | |||
1 | ############################################################################ | ||
2 | # __________ __ ___. | ||
3 | # Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | # \/ \/ \/ \/ \/ | ||
8 | # $Id$ | ||
9 | # | ||
10 | # Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.se> | ||
11 | # | ||
12 | # All files in this archive are subject to the GNU General Public License. | ||
13 | # See the file COPYING in the source tree root for full license agreement. | ||
14 | # | ||
15 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | # KIND, either express or implied. | ||
17 | # | ||
18 | ############################################################################ | ||
19 | |||
20 | DEPFILE = $(OBJDIR)/dep-commonsim | ||
21 | |||
22 | RM = rm -f | ||
23 | DEBUG = -g | ||
24 | |||
25 | # Use this for simulator-only files | ||
26 | INCLUDES = -I. -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) | ||
27 | |||
28 | SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ | ||
29 | $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) | ||
30 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
31 | |||
32 | DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ | ||
33 | $(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES) | ||
34 | |||
35 | SOURCES = $(SRC) | ||
36 | |||
37 | DIRS = . | ||
38 | |||
39 | CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS) | ||
40 | |||
41 | OUTFILE = $(OBJDIR)/libsim.a | ||
42 | |||
43 | all: $(OUTFILE) | ||
44 | |||
45 | include $(TOOLSDIR)/make.inc | ||
46 | |||
47 | clean: | ||
48 | @echo "cleaning commonsim" | ||
49 | @$(RM) $(OBJS) *~ core $(DEPFILE) | ||
50 | |||
51 | $(OUTFILE): $(OBJS) | ||
52 | @echo "AR+RANLIB $@" | ||
53 | @$(AR) ruv $@ $(OBJS) >/dev/null 2>&1 | ||
54 | @$(RANLIB) $@ | ||
55 | |||
56 | -include $(DEPFILE) | ||
diff --git a/uisimulator/common/SOURCES b/uisimulator/common/SOURCES new file mode 100644 index 0000000000..d12a78db53 --- /dev/null +++ b/uisimulator/common/SOURCES | |||
@@ -0,0 +1,8 @@ | |||
1 | fmradio.c | ||
2 | font-player.c | ||
3 | io.c | ||
4 | lcd-common.c | ||
5 | lcd-playersim.c | ||
6 | mpegplay.c | ||
7 | sim_icons.c | ||
8 | stubs.c | ||
diff --git a/uisimulator/win32/Makefile b/uisimulator/win32/Makefile index e7d118cd5a..4878d85bf1 100644 --- a/uisimulator/win32/Makefile +++ b/uisimulator/win32/Makefile | |||
@@ -17,145 +17,52 @@ | |||
17 | # | 17 | # |
18 | ############################################################################ | 18 | ############################################################################ |
19 | 19 | ||
20 | APPDIR = ../../apps | ||
21 | RECDIR = $(APPDIR)/recorder | ||
22 | PLAYDIR = $(APPDIR)/player | ||
23 | PLUGINDIR = $(APPDIR)/plugins | ||
24 | SIMCOMMON = ../common | 20 | SIMCOMMON = ../common |
25 | 21 | ||
26 | ISONDIO := $(findstring ONDIO, $(TARGET)) | 22 | DEPFILE = $(OBJDIR)/dep-simwin |
27 | ISIRIVER := $(findstring IRIVER, $(TARGET)) | ||
28 | ISPLAYER := $(findstring PLAYER, $(TARGET)) | ||
29 | ifeq ($(ISPLAYER), PLAYER) | ||
30 | MACHINEDIR = $(PLAYDIR) | ||
31 | else | ||
32 | MACHINEDIR = $(RECDIR) | ||
33 | endif | ||
34 | |||
35 | PREVAPPDIR= .. | ||
36 | FIRMWAREDIR = ../../firmware | ||
37 | |||
38 | # build some sources from these dirs | ||
39 | DRIVERS = $(FIRMWAREDIR)/drivers | ||
40 | COMMON = $(FIRMWAREDIR)/common | ||
41 | |||
42 | # include here: | ||
43 | EXPORT = $(FIRMWAREDIR)/export | ||
44 | TOOLSDIR = ../../tools | ||
45 | DOCSDIR = ../../docs | ||
46 | 23 | ||
47 | RM = rm -f | 24 | RM = rm -f |
48 | DEBUG = -g | 25 | DEBUG = -g |
49 | 26 | ||
50 | ifndef OBJDIR | 27 | INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) |
51 | no_configure: | ||
52 | @echo "Don't run make here. Run the tools/configure script from your own build" | ||
53 | @echo "directory, then run make there." | ||
54 | @echo | ||
55 | @echo "More help on how to build rockbox can be found here:" | ||
56 | @echo "http://rockbox.haxx.se/docs/how_to_compile.html" | ||
57 | endif | ||
58 | 28 | ||
59 | DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ | 29 | DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ |
60 | $(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES) | 30 | $(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES) |
61 | 31 | ||
62 | LDFLAGS = -lgdi32 -luser32 | 32 | LDFLAGS = -lgdi32 -luser32 |
63 | 33 | ||
64 | # Use this for simulator-only files | 34 | SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ |
65 | INCLUDES = -I. -I$(EXPORT) -I$(APPDIR) -I$(MACHINEDIR) -I$(SIMCOMMON) -I$(OBJDIR) -I$(PLUGINDIR)/lib | 35 | $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) |
66 | 36 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | |
67 | # The true Rockbox Applications should use this include path: | ||
68 | APPINCLUDES = $(INCLUDES) | ||
69 | 37 | ||
70 | DEFINES += -DWIN32 | 38 | SOURCES = $(SRC) |
39 | DIRS = . | ||
71 | 40 | ||
72 | CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin | 41 | CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin |
73 | 42 | ||
74 | APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall -mno-cygwin | ||
75 | DLLTOOLFLAGS = --export-all | 43 | DLLTOOLFLAGS = --export-all |
76 | DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin | 44 | DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin |
77 | 45 | ||
78 | UNAME := $(shell uname|sed -e "s/CYGWIN.*/CYGWIN/") | 46 | OUTFILE = $(OBJDIR)/libsim.a |
79 | EXEFILE := $(OBJDIR)/rockboxui.exe | 47 | |
80 | 48 | all: $(OUTFILE) | |
81 | ifeq ($(UNAME),CYGWIN) | 49 | @echo "MAKE in common sim" |
82 | CC = gcc | 50 | $(MAKE) -C $(SIMCOMMON) |
83 | WINDRES = windres | 51 | |
84 | DLLTOOL = dlltool | 52 | include $(TOOLSDIR)/make.inc |
85 | DLLWRAP = dllwrap | 53 | |
86 | RANLIB = ranlib | 54 | $(OUTFILE): $(OBJS) |
87 | DEFINES += -DNOCYGWIN | 55 | @echo "AR+RANLIB $@" |
88 | LDFLAGS += -mno-cygwin | 56 | @$(AR) ruv $@ $(OBJS) >/dev/null 2>&1 |
89 | else | 57 | @$(RANLIB) $@ |
90 | CC = i386-mingw32msvc-gcc | ||
91 | WINDRES = i386-mingw32msvc-windres | ||
92 | DLLTOOL = i386-mingw32msvc-dlltool | ||
93 | DLLWRAP = i386-mingw32msvc-dllwrap | ||
94 | RANLIB = i386-mingw32msvc-ranlib | ||
95 | CFLAGS += -mwindows | ||
96 | LDFLAGS += -mwindows | ||
97 | APPCFLAGS += -mwindows | ||
98 | endif | ||
99 | |||
100 | ifeq ($(ISPLAYER),PLAYER) | ||
101 | LCDSRSC = lcd-playersim.c lcd-player.c lcd-player-charset.c font-player.c | ||
102 | else | ||
103 | ifeq ($(ISIRIVER),IRIVER) | ||
104 | LCDSRSC = lcd-h100.c sysfont.c font.c | ||
105 | else | ||
106 | LCDSRSC = lcd-recorder.c sysfont.c font.c | ||
107 | endif | ||
108 | endif | ||
109 | COMMONSRCS = io.c stubs.c lcd-common.c sim_icons.c fmradio.c | ||
110 | |||
111 | FIRMSRCS = $(LCDSRSC) id3.c mp3data.c usb.c mpeg.c mp3_playback.c \ | ||
112 | powermgmt.c power.c sprintf.c buffer.c strtok.c random.c \ | ||
113 | timefuncs.c strcasestr.c | ||
114 | |||
115 | APPS = main.c tree.c menu.c credits.c main_menu.c icons.c language.c \ | ||
116 | playlist.c wps.c wps-display.c settings.c status.c \ | ||
117 | screens.c sleeptimer.c keyboard.c onplay.c\ | ||
118 | misc.c plugin.c playlist_viewer.c bookmark.c filetypes.c \ | ||
119 | settings_menu.c sound_menu.c playlist_menu.c filetree.c dbtree.c | ||
120 | |||
121 | ifneq ($(ISPLAYER),PLAYER) | ||
122 | APPS += peakmeter.c bmp.c widgets.c radio.c | ||
123 | endif | ||
124 | |||
125 | SRCS = button.c lcd-win32.c panic-win32.c thread-win32.c \ | ||
126 | debug-win32.c kernel.c string-win32.c uisw32.c \ | ||
127 | $(APPS) $(FIRMSRCS) $(COMMONSRCS) | ||
128 | |||
129 | OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) $(OBJDIR)/uisw32-res.o | ||
130 | |||
131 | ifdef ENABLEDPLUGINS | ||
132 | ROCKS := $(patsubst $(PLUGINDIR)/%.c,$(OBJDIR)/%.rock,$(wildcard $(PLUGINDIR)/*.c)) | ||
133 | PLUGINLIBOBJS := $(patsubst $(PLUGINDIR)/lib/%.c,$(OBJDIR)/%.o,$(wildcard $(PLUGINDIR)/lib/*.c)) | ||
134 | endif | ||
135 | |||
136 | all: $(TOOLSDIR)/convbdf $(EXEFILE) $(ROCKS) | ||
137 | |||
138 | $(ROCKS): $(OBJDIR)/libplugin.a | ||
139 | |||
140 | $(TOOLSDIR)/convbdf: | ||
141 | $(MAKE) -C $(TOOLSDIR) | ||
142 | |||
143 | $(EXEFILE): $(OBJDIR)/lang.o $(OBJS) | ||
144 | @echo LD $@ | ||
145 | @$(CC) $(OBJS) -o $(EXEFILE) $(LDFLAGS) | ||
146 | 58 | ||
147 | clean: | 59 | clean: |
148 | $(RM) $(OBJS) *~ core $(EXEFILE) $(CLIENTS) $(OBJDIR)/uisw32-res.o \ | 60 | @echo "cleaning simwin" |
149 | $(OBJDIR)/lang.[cho] $(OBJDIR)/build.lang $(OBJDIR)/*.o \ | 61 | @$(RM) $(OBJS) *~ core $(OUTFILE) $(OBJDIR)/uisw32-res.o \ |
150 | $(OBJDIR)/*.rock $(OBJDIR)/*.def $(OBJDIR)/sysfont.c \ | 62 | $(OBJDIR)/UI256.bmp $(DEPFILE) |
151 | $(OBJDIR)/credits.raw $(OBJDIR)/libplugin.a | 63 | @$(MAKE) -C $(SIMCOMMON) clean |
152 | $(RM) -f $(OBJDIR)/UI256.bmp | ||
153 | $(RM) -r $(DEPS) | ||
154 | 64 | ||
155 | ################## Specific dependencies ################## | 65 | ################## Specific dependencies ################## |
156 | $(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS | ||
157 | perl $(APPDIR)/credits.pl < $< > $@ | ||
158 | |||
159 | $(OBJDIR)/UI256.bmp: UI-$(ARCHOS).bmp | 66 | $(OBJDIR)/UI256.bmp: UI-$(ARCHOS).bmp |
160 | @echo UI | 67 | @echo UI |
161 | @cp $< $@ | 68 | @cp $< $@ |
@@ -163,83 +70,4 @@ $(OBJDIR)/UI256.bmp: UI-$(ARCHOS).bmp | |||
163 | $(OBJDIR)/uisw32-res.o: uisw32.rc $(OBJDIR)/UI256.bmp | 70 | $(OBJDIR)/uisw32-res.o: uisw32.rc $(OBJDIR)/UI256.bmp |
164 | $(WINDRES) -I$(OBJDIR) -i $< -o $@ | 71 | $(WINDRES) -I$(OBJDIR) -i $< -o $@ |
165 | 72 | ||
166 | $(OBJDIR)/credits.o: $(APPDIR)/credits.c $(APPDIR)/credits.h $(OBJDIR)/credits.raw | 73 | -include $(DEPFILE) |
167 | |||
168 | $(OBJDIR)/button.o: button.c | ||
169 | $(OBJDIR)/plugin.o: $(APPDIR)/plugin.c plugin-win32.h | ||
170 | $(OBJDIR)/build.lang: $(APPDIR)/lang/$(LANGUAGE).lang | ||
171 | @echo UPLANG | ||
172 | @perl $(TOOLSDIR)/uplang $(APPDIR)/lang/english.lang $< > $@ | ||
173 | |||
174 | $(OBJDIR)/lang.o: $(OBJDIR)/build.lang | ||
175 | @echo GENLANG | ||
176 | @perl -s $(TOOLSDIR)/genlang -p=$(OBJDIR)/lang $< | ||
177 | @$(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@ | ||
178 | |||
179 | $(OBJDIR)/sysfont.o: $(FIRMWAREDIR)/fonts/clR6x8.bdf | ||
180 | @echo CC $< | ||
181 | @$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $< | ||
182 | @$(CC) $(APPCFLAGS) -c $(OBJDIR)/sysfont.c -o $@ | ||
183 | |||
184 | ################## Plugins ################## | ||
185 | $(OBJDIR)/libplugin.a: $(PLUGINLIBOBJS) | ||
186 | @echo AR $@ | ||
187 | @$(AR) ru $@ $+ | ||
188 | @$(RANLIB) $@ | ||
189 | |||
190 | $(OBJDIR)/%.o: $(PLUGINDIR)/lib/%.c | ||
191 | @echo CC $< | ||
192 | @$(CC) $(CFLAGS) -DPLUGIN -c $< -o $@ | ||
193 | |||
194 | $(OBJDIR)/%.po : $(PLUGINDIR)/%.c | ||
195 | @echo CC $< | ||
196 | @$(CC) $(APPCFLAGS) -DPLUGIN -c $< -o $@ | ||
197 | |||
198 | $(OBJDIR)/%.rock : $(OBJDIR)/%.po $(OBJDIR)/libplugin.a | ||
199 | @echo DLL $@ | ||
200 | @$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $< | ||
201 | @$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/libplugin.a -o $@ | ||
202 | @chmod -x $@ | ||
203 | |||
204 | ################## Patterns for building objects ################## | ||
205 | $(OBJDIR)/%.o: %.c | ||
206 | @echo CC $< | ||
207 | @$(CC) $(CFLAGS) -c $< -o $@ | ||
208 | |||
209 | $(OBJDIR)/%.o: $(SIMCOMMON)/%.c | ||
210 | @echo CC $< | ||
211 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
212 | |||
213 | $(OBJDIR)/%.o: $(MACHINEDIR)/%.c | ||
214 | @echo CC $< | ||
215 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
216 | |||
217 | $(OBJDIR)/%.o: $(DRIVERS)/%.c | ||
218 | @echo CC $< | ||
219 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
220 | |||
221 | $(OBJDIR)/%.o: $(FIRMWAREDIR)/%.c | ||
222 | @echo CC $< | ||
223 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
224 | |||
225 | $(OBJDIR)/%.o: $(COMMON)/%.c | ||
226 | @echo CC $< | ||
227 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
228 | |||
229 | $(OBJDIR)/%.o: $(APPDIR)/%.c | ||
230 | @echo CC $< | ||
231 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
232 | |||
233 | ################## Auto-dependencies ################## | ||
234 | DEPS:=$(OBJDIR)/.deps | ||
235 | |||
236 | $(DEPS)/%.d: %.c | ||
237 | @$(SHELL) -c 'if [ ! -d $(DEPS) ]; then \ | ||
238 | echo Creating the dependency directory: $(DEPS); \ | ||
239 | mkdir -p $(DEPS); fi' | ||
240 | @echo "Updating Dependencies for $<" | ||
241 | @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \ | ||
242 | |sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \ | ||
243 | [ -s $@ ] || rm -f $@' | ||
244 | |||
245 | -include $(SRCS:%.c=$(DEPS)/%.d) | ||
diff --git a/uisimulator/win32/SOURCES b/uisimulator/win32/SOURCES new file mode 100644 index 0000000000..6a52c5ed5e --- /dev/null +++ b/uisimulator/win32/SOURCES | |||
@@ -0,0 +1,10 @@ | |||
1 | button.c | ||
2 | debug-win32.c | ||
3 | dir-win32.c | ||
4 | kernel.c | ||
5 | lcd-win32.c | ||
6 | mpeg-win32.c | ||
7 | panic-win32.c | ||
8 | string-win32.c | ||
9 | thread-win32.c | ||
10 | uisw32.c | ||
diff --git a/uisimulator/x11/Makefile b/uisimulator/x11/Makefile index 7b86ee2f5b..68815fe8d8 100644 --- a/uisimulator/x11/Makefile +++ b/uisimulator/x11/Makefile | |||
@@ -17,252 +17,44 @@ | |||
17 | # | 17 | # |
18 | ############################################################################ | 18 | ############################################################################ |
19 | 19 | ||
20 | RECDIR = $(APPSDIR)/recorder | ||
21 | PLAYDIR = $(APPSDIR)/player | ||
22 | PLUGINDIR = $(APPSDIR)/plugins | ||
23 | SIMCOMMON = ../common | 20 | SIMCOMMON = ../common |
24 | 21 | ||
25 | ISONDIO := $(findstring ONDIO, $(TARGET)) | 22 | DEPFILE = $(OBJDIR)/dep-sim |
26 | ISIRIVER := $(findstring IRIVER, $(TARGET)) | ||
27 | ISPLAYER := $(findstring PLAYER, $(TARGET)) | ||
28 | ifeq ($(ISPLAYER), PLAYER) | ||
29 | MACHINEDIR = $(PLAYDIR) | ||
30 | else | ||
31 | MACHINEDIR = $(RECDIR) | ||
32 | endif | ||
33 | |||
34 | PREVAPPSDIR= .. | ||
35 | |||
36 | # build some sources from these dirs | ||
37 | DRIVERS = $(FIRMDIR)/drivers | ||
38 | COMMON = $(FIRMDIR)/common | ||
39 | |||
40 | # include here: | ||
41 | EXPORT = $(FIRMDIR)/export | ||
42 | 23 | ||
43 | RM = rm -f | 24 | RM = rm -f |
44 | DEBUG = -g | 25 | DEBUG = -g |
45 | 26 | ||
46 | ifndef OBJDIR | ||
47 | no_configure: | ||
48 | @echo "Don't run make here. Run the tools/configure script from your own build" | ||
49 | @echo "directory, then run make there." | ||
50 | @echo | ||
51 | @echo "More help on how to build rockbox can be found here:" | ||
52 | @echo "http://rockbox.haxx.se/docs/how_to_compile.html" | ||
53 | endif | ||
54 | |||
55 | DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ | ||
56 | $(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES) | ||
57 | |||
58 | # Use this for simulator-only files | 27 | # Use this for simulator-only files |
59 | INCLUDES = -I. -I$(EXPORT) -I$(APPSDIR) -I$(MACHINEDIR) -I$(SIMCOMMON) -I$(OBJDIR) -I$(PLUGINDIR)/lib | 28 | INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR) |
60 | |||
61 | # The true Rockbox Applications should use this include path: | ||
62 | APPINCLUDES = $(INCLUDES) | ||
63 | |||
64 | SRCDIRS = . $(DRIVERS) $(FIRMDIR)/export $(APPSDIR) $(MACHINEDIR) | ||
65 | |||
66 | # The true Rockbox Applications should use this include path: | ||
67 | APPINCLUDES = $(INCLUDES) | ||
68 | |||
69 | LIBS = -lpthread | ||
70 | 29 | ||
71 | CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall | 30 | SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \ |
31 | $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - ) | ||
32 | OBJS := $(SRC:%.c=$(OBJDIR)/%.o) | ||
72 | 33 | ||
73 | APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall | 34 | DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ |
74 | 35 | $(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES) | |
75 | UNAME := $(shell uname|sed -e "s/CYGWIN.*/CYGWIN/") | ||
76 | EXEFILE = $(OBJDIR)/rockboxui | ||
77 | ifeq ($(UNAME),Linux) | ||
78 | LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl -ldl | ||
79 | INCLUDES += -I/usr/X11R6/include | ||
80 | LIBDIRS = -L/usr/X11R6/lib | ||
81 | DEFINES += -DHAVE_OSS | ||
82 | else | ||
83 | ifeq ($(UNAME),CYGWIN) | ||
84 | LDFLAGS = -lSM -lICE -lXt -lX11 -lXmu -lSM -lICE -lX11 | ||
85 | INCLUDES += -I/usr/X11R6/include | ||
86 | LIBDIRS = -L/usr/X11R6/lib | ||
87 | DEFINES += -DHAVE_OSS -D_SSIZE_T_ | ||
88 | EXEFILE = $(OBJDIR)/rockboxui.exe | ||
89 | else | ||
90 | ifeq ($(UNAME),FreeBSD) | ||
91 | LIBS = -pthread | ||
92 | LDFLAGS = -lX11 -lm -lXt -lXmu | ||
93 | INCLUDES += -I/usr/X11R6/include | ||
94 | LIBDIRS = -L/usr/X11R6/lib | ||
95 | DEFINES += -DHAVE_OSS | ||
96 | else | ||
97 | LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl -ldl | ||
98 | DEFINES += -DBIG_ENDIAN | ||
99 | LIBDIRS = | ||
100 | endif | ||
101 | endif | ||
102 | endif | ||
103 | |||
104 | ifeq ($(HAVE_MPEG_PLAY),1) | ||
105 | SOUNDSRC = mpegplay.c oss_sound.c | ||
106 | LDFLAGS += $(SOUND_LDFLAGS) | ||
107 | CFLAGS += $(SOUND_CFLAGS) -DHAVE_MPEG_PLAY | ||
108 | else | ||
109 | SOUNDSRC = | ||
110 | endif | ||
111 | |||
112 | ifeq ($(ISPLAYER), PLAYER) | ||
113 | LCDSRSC = lcd-playersim.c lcd-player.c lcd-player-charset.c font-player.c | ||
114 | else | ||
115 | ifeq ($(ISIRIVER),IRIVER) | ||
116 | LCDSRSC = lcd-h100.c sysfont.c font.c | ||
117 | else | ||
118 | LCDSRSC = lcd-recorder.c sysfont.c font.c | ||
119 | endif | ||
120 | endif | ||
121 | COMMONSRCS = io.c stubs.c lcd-common.c sim_icons.c fmradio.c | ||
122 | |||
123 | FIRMSRCS = $(LCDSRSC) id3.c mp3data.c usb.c mpeg.c mp3_playback.c \ | ||
124 | powermgmt.c power.c sprintf.c buffer.c strtok.c random.c \ | ||
125 | timefuncs.c panic.c debug.c strcasestr.c | ||
126 | |||
127 | APPS = main.c tree.c menu.c credits.c main_menu.c icons.c language.c \ | ||
128 | playlist.c wps.c wps-display.c settings.c status.c \ | ||
129 | screens.c sleeptimer.c keyboard.c onplay.c\ | ||
130 | misc.c plugin.c playlist_viewer.c bookmark.c filetypes.c \ | ||
131 | settings_menu.c sound_menu.c playlist_menu.c filetree.c dbtree.c | ||
132 | |||
133 | ifneq ($(ISPLAYER), PLAYER) | ||
134 | APPS += peakmeter.c bmp.c widgets.c radio.c | ||
135 | endif | ||
136 | 36 | ||
137 | SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c \ | 37 | SOURCES = $(SRC) |
138 | button-x11.c thread.c $(APPS) $(MENUS) $(FIRMSRCS) \ | ||
139 | $(COMMONSRCS) $(SOUNDSRC) | ||
140 | 38 | ||
141 | OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) | 39 | DIRS = . |
142 | 40 | ||
143 | ifdef ENABLEDPLUGINS | 41 | CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS) |
144 | ROCKS := $(patsubst $(PLUGINDIR)/%.c,$(OBJDIR)/%.rock,$(wildcard $(PLUGINDIR)/*.c)) | ||
145 | PLUGINLIBOBJS := $(patsubst $(PLUGINDIR)/lib/%.c,$(OBJDIR)/%.o,$(wildcard $(PLUGINDIR)/lib/*.c)) | ||
146 | endif | ||
147 | 42 | ||
148 | all: $(TOOLSDIR)/convbdf $(EXEFILE) $(ROCKS) | 43 | OUTFILE = $(OBJDIR)/libsim.a |
149 | 44 | ||
150 | $(ROCKS): $(OBJDIR)/libplugin.a | 45 | all: $(OUTFILE) |
46 | @echo "MAKE in common sim" | ||
47 | $(MAKE) -C $(SIMCOMMON) | ||
151 | 48 | ||
152 | $(TOOLSDIR)/convbdf: | 49 | include $(TOOLSDIR)/make.inc |
153 | $(MAKE) -C $(TOOLSDIR) | ||
154 | 50 | ||
155 | clean: | 51 | clean: |
156 | $(RM) $(OBJS) *~ core $(EXEFILE) $(CLIENTS) $(OBJDIR)/lang.[cho] \ | 52 | @echo "cleaning sim" |
157 | $(OBJDIR)/build.lang $(OBJDIR)/*.o $(OBJDIR)/sysfont.c \ | 53 | @$(RM) $(OBJS) *~ core $(OUTFILE) $(DEPFILE) |
158 | $(ROCKS) $(OBJDIR)/credits.raw | 54 | @$(MAKE) -C $(SIMCOMMON) clean |
159 | $(RM) -r $(DEPS) | ||
160 | $(RM) -f $(OBJDIR)/libplugin.a $(OBJDIR)/rockbox.zip | ||
161 | |||
162 | ################## Specific dependencies ################## | ||
163 | $(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS | ||
164 | perl $(APPSDIR)/credits.pl < $< > $@ | ||
165 | |||
166 | $(OBJDIR)/uisw32-res.o: uisw32.rc | ||
167 | $(WINDRES) -i $< -o $@ | ||
168 | |||
169 | $(OBJDIR)/credits.o: $(APPSDIR)/credits.c $(APPSDIR)/credits.h $(OBJDIR)/credits.raw | ||
170 | |||
171 | $(OBJDIR)/thread.o: ./thread.c | ||
172 | $(OBJDIR)/plugin.o: $(APPSDIR)/plugin.c | ||
173 | $(OBJDIR)/build.lang: $(APPSDIR)/lang/$(LANGUAGE).lang | ||
174 | @echo "UPLANG" | ||
175 | @perl $(TOOLSDIR)/uplang $(APPSDIR)/lang/english.lang $< > $@ | ||
176 | |||
177 | $(OBJDIR)/lang.o: $(OBJDIR)/build.lang | ||
178 | @echo GENLANG | ||
179 | @perl -s $(TOOLSDIR)/genlang -p=$(OBJDIR)/lang $< | ||
180 | @echo "CC lang.c" | ||
181 | $(CC) $(CFLAGS) -c $(OBJDIR)/lang.c -o $@ | ||
182 | |||
183 | $(OBJDIR)/sysfont.o: $(FIRMDIR)/fonts/clR6x8.bdf | ||
184 | @echo CC $< | ||
185 | @$(TOOLSDIR)/convbdf -c -o $(OBJDIR)/sysfont.c $< | ||
186 | @$(CC) $(APPCFLAGS) -c $(OBJDIR)/sysfont.c -o $@ | ||
187 | |||
188 | ################## Plugins ################## | ||
189 | $(OBJDIR)/libplugin.a: $(PLUGINLIBOBJS) | ||
190 | @echo AR $< | ||
191 | @$(AR) ru $@ $+ | ||
192 | |||
193 | $(OBJDIR)/%.o: $(PLUGINDIR)/lib/%.c | ||
194 | @echo CC $< | ||
195 | @$(CC) $(CFLAGS) -DPLUGIN -c $< -o $@ | ||
196 | |||
197 | $(OBJDIR)/%.rock: $(APPSDIR)/plugins/%.c $(APPSDIR)/plugin.h | ||
198 | @echo CC $< | ||
199 | @$(CC) $(APPCFLAGS) -DPLUGIN -shared $< -L$(OBJDIR) -lplugin -o $@ | ||
200 | ifeq ($(UNAME),CYGWIN) | ||
201 | # 'x' must be kept or you'll have "Win32 error 5" | ||
202 | # $ fgrep 5 /usr/include/w32api/winerror.h | head -1 | ||
203 | # #define ERROR_ACCESS_DENIED 5L | ||
204 | else | ||
205 | @chmod -x $@ | ||
206 | endif | ||
207 | |||
208 | ################## Patterns for building objects ################## | ||
209 | $(OBJDIR)/%.o: ../x11/%.c | ||
210 | @echo CC $< | ||
211 | @$(CC) $(CFLAGS) -c $< -o $@ | ||
212 | |||
213 | $(OBJDIR)/%.o: $(SIMCOMMON)/%.c | ||
214 | @echo CC $< | ||
215 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
216 | |||
217 | $(OBJDIR)/%.o: $(MACHINEDIR)/%.c | ||
218 | @echo CC $< | ||
219 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
220 | |||
221 | $(OBJDIR)/%.o: $(DRIVERS)/%.c | ||
222 | @echo CC $< | ||
223 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
224 | |||
225 | $(OBJDIR)/%.o: $(FIRMDIR)/%.c | ||
226 | @echo CC $< | ||
227 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
228 | |||
229 | $(OBJDIR)/%.o: $(COMMON)/%.c | ||
230 | @echo CC $< | ||
231 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
232 | |||
233 | $(OBJDIR)/%.o: $(APPSDIR)/%.c | ||
234 | @echo CC $< | ||
235 | @$(CC) $(APPCFLAGS) -c $< -o $@ | ||
236 | |||
237 | |||
238 | ################## Auto-dependencies ################## | ||
239 | DEPS:=$(OBJDIR)/.deps | ||
240 | |||
241 | $(DEPS)/%.d: %.c | ||
242 | @$(SHELL) -c 'if [ ! -d $(DEPS) ]; then \ | ||
243 | echo Creating the dependency directory: $(DEPS); \ | ||
244 | mkdir -p $(DEPS); fi' | ||
245 | @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \ | ||
246 | |sed '\''s|\($*\)\.o[ :]*|$(OBJDIR)/\1.o $(<:%.c=%.d) : |g'\'' > $@; \ | ||
247 | [ -s $@ ] || rm -f $@' | ||
248 | |||
249 | -include $(SRCS:%.c=$(DEPS)/%.d) | ||
250 | |||
251 | # these ones are simulator-specific | ||
252 | |||
253 | $(OBJDIR)/%.o: %.c | ||
254 | $(CC) $(CFLAGS) -c $< -o $@ | ||
255 | |||
256 | ifeq ($(UNAME),CYGWIN) | ||
257 | $(EXEFILE): $(OBJS) | ||
258 | @echo LD $@ | ||
259 | @$(CC) -g -o $(EXEFILE) $(OBJS) $(LIBDIRS) $(LDFLAGS) $(LIBS) | ||
260 | else | ||
261 | $(EXEFILE): $(OBJS) | ||
262 | @echo LD $@ | ||
263 | @$(CC) -g -o $(EXEFILE) $(LIBDIRS) $(LDFLAGS) $(OBJS) $(LIBS) | ||
264 | endif | ||
265 | 55 | ||
266 | tags: | 56 | $(OUTFILE): $(OBJS) |
267 | @$(SHELL) -c 'for d in $(SRCDIRS); do { etags -o $(OBJDIR)/TAGS -a $$d/*.[ch]; }; done' | 57 | @echo "AR $@" |
58 | @$(AR) ruv $@ $(OBJS) >/dev/null 2>&1 | ||
268 | 59 | ||
60 | -include $(DEPFILE) | ||
diff --git a/uisimulator/x11/SOURCES b/uisimulator/x11/SOURCES new file mode 100644 index 0000000000..ea60b4e68a --- /dev/null +++ b/uisimulator/x11/SOURCES | |||
@@ -0,0 +1,10 @@ | |||
1 | button-x11.c | ||
2 | lcd-x11.c | ||
3 | #if 0 /* if sound is enabled */ | ||
4 | oss_sound.c | ||
5 | #endif | ||
6 | resources.c | ||
7 | screenhack.c | ||
8 | thread.c | ||
9 | uibasic.c | ||
10 | visual.c | ||