summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/Makefile31
-rw-r--r--apps/SOURCES2
-rw-r--r--apps/codecs/libFLAC/Makefile15
-rw-r--r--apps/main_menu.c7
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h2
-rw-r--r--apps/plugins/Makefile41
-rw-r--r--apps/plugins/lib/Makefile7
-rw-r--r--firmware/Makefile3
-rw-r--r--firmware/SOURCES48
-rw-r--r--firmware/common/timefuncs.c1
-rw-r--r--firmware/debug.c1
-rw-r--r--firmware/include/dir.h4
-rw-r--r--firmware/include/stdio.h9
-rw-r--r--firmware/include/time.h11
-rw-r--r--firmware/mpeg.c7
-rwxr-xr-xtools/buildzip.pl6
-rwxr-xr-xtools/configure235
-rw-r--r--uisimulator/FILES3
-rw-r--r--uisimulator/common/Makefile56
-rw-r--r--uisimulator/common/SOURCES8
-rw-r--r--uisimulator/win32/Makefile220
-rw-r--r--uisimulator/win32/SOURCES10
-rw-r--r--uisimulator/x11/Makefile252
-rw-r--r--uisimulator/x11/SOURCES10
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
13LDS := $(FIRMDIR)/app.lds 13LDS := $(FIRMDIR)/app.lds
14ROMLDS := $(FIRMDIR)/rom.lds 14ROMLDS := $(FIRMDIR)/rom.lds
15 15
16ifdef DEBUG
17 DEFINES := -DDEBUG
18 CFLAGS += -g
19endif
20
21ifdef ENABLEDPLUGINS 16ifdef ENABLEDPLUGINS
22ROCKS=rocks 17ROCKS=rocks
23endif 18endif
@@ -26,7 +21,8 @@ ifdef SOFTWARECODECS
26CODECS=build-codecs 21CODECS=build-codecs
27endif 22endif
28 23
29SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) 24SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
25$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
30DIRS = . 26DIRS = .
31 27
32ifdef APPEXTRA 28ifdef APPEXTRA
@@ -44,9 +40,11 @@ LINKROM = $(OBJDIR)/linkrom.lds
44MAXINFILE = $(OBJDIR)/romstart.temp 40MAXINFILE = $(OBJDIR)/romstart.temp
45MAXOUTFILE = $(OBJDIR)/romstart 41MAXOUTFILE = $(OBJDIR)/romstart
46 42
47ifdef DEBUG 43ifdef SIMVER
48all: $(OBJDIR)/rockbox.elf $(CODECS) $(ROCKS) 44# this is a sim build
45all: $(OBJDIR)/$(BINARY) $(CODECS) $(ROCKS)
49else 46else
47# regular target build
50all: $(OBJDIR)/$(BINARY) $(FLASHFILE) $(CODECS) $(ROCKS) $(ARCHOSROM) 48all: $(OBJDIR)/$(BINARY) $(FLASHFILE) $(CODECS) $(ROCKS) $(ARCHOSROM)
51endif 49endif
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
81ifndef 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
102else
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)
110endif
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
173ifdef SIMVER
174 @$(MAKE) -C $(SIMDIR) clean
175endif
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
19sleeptimer.c 19sleeptimer.c
20sound_menu.c 20sound_menu.c
21status.c 21status.c
22#ifndef SIMULATOR
22talk.c 23talk.c
24#endif
23tree.c 25tree.c
24dbtree.c 26dbtree.c
25filetree.c 27filetree.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
14INCLUDES += -I$(APPSDIR)/$(APPEXTRA) 14INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
15endif 15endif
16 16
17FLACOPTS = -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 17NEWGCC=$(shell expr $(GCCNUM) ">" 303)
18
19FLACOPTS = -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
23ifeq ($(NEWGCC), 1)
24 # this is 3.4.X options:
25 FLACOPTS += --param large-function-insns=10000
26endif
27
18CFLAGS = $(GCCOPTS) $(FLACOPTS)\ 28CFLAGS = $(GCCOPTS) $(FLACOPTS)\
19$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} 29$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
20 30
21SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) 31SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
32$(TARGET) $(DEFINES) -E -P -include "config.h" - )
22SOURCES = $(SRC) 33SOURCES = $(SRC)
23OBJS := $(SRC:%.c=$(OBJDIR)/libFLAC/%.o) 34OBJS := $(SRC:%.c=$(OBJDIR)/libFLAC/%.o)
24DEPFILE = $(OBJDIR)/dep-libFLAC 35DEPFILE = $(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
278bool recording_screen(void)
279{
280 /* a dummy */
281 return false;
282}
283#endif
284 277
285static bool recording_settings(void) 278static 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
24LINKFILE := $(OBJDIR)/pluginlink.lds 24LINKFILE := $(OBJDIR)/pluginlink.lds
25DEPFILE = $(OBJDIR)/dep-plugins 25DEPFILE = $(OBJDIR)/dep-plugins
26 26
27SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) \ 27SRC := $(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" - )
29ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock) 29ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
30SOURCES = $(SRC) 30SOURCES = $(SRC)
31ELFS := $(SRC:%.c=$(OBJDIR)/%.elf) 31ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
32OBJS := $(SRC:%.c=$(OBJDIR)/%.o) 32OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
33# as created by the cross-compiler for win32:
34DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
33DIRS = . 35DIRS = .
34 36
35all: $(OBJDIR)/libplugin.a $(ROCKS) $(DEPFILE) 37all: $(OBJDIR)/libplugin.a $(ROCKS) $(DEPFILE)
36 38
39ifndef 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 $< $@
47else
48
49ifeq ($(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 $@
56ifeq ($(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
60else
61 @chmod -x $@
62endif
63
64else # end of x11-simulator
65###################################################
66# This is the win32 simulator version
67DLLTOOLFLAGS = --export-all
68DLLWRAPFLAGS = -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 $@
75endif # end of win32-simulator
76
77endif # end of simulator section
44 78
45include $(TOOLSDIR)/make.inc 79include $(TOOLSDIR)/make.inc
46 80
@@ -56,7 +90,8 @@ $(LINKFILE): $(LDS)
56 90
57clean: 91clean:
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)
18endif 18endif
19 19
20CFLAGS = $(GCCOPTS) \ 20CFLAGS = $(GCCOPTS) \
21$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} 21$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -DPLUGIN
22 22
23SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) 23SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
24SOURCES = $(SRC) 24SOURCES = $(SRC)
25OBJS := $(SRC:%.c=$(OBJDIR)/%.o) 25OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
26DEPFILE = $(OBJDIR)/dep-pluginlib 26DEPFILE = $(OBJDIR)/dep-pluginlib
@@ -31,8 +31,9 @@ OUTPUT = $(OBJDIR)/libplugin.a
31all: $(OUTPUT) 31all: $(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
37include $(TOOLSDIR)/make.inc 38include $(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
12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} 12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
13 13
14SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - ) 14SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
15SOURCES = $(SRC) 15SOURCES = $(SRC)
16OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o 16OBJS2 := $(patsubst %.c, $(OBJDIR)/%.o, $(SRC)) $(OBJDIR)/sysfont.o
17OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2)) 17OBJS = $(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
33include $(TOOLSDIR)/make.inc 34include $(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
1backlight.c 2backlight.c
3#endif
2buffer.c 4buffer.c
3common/atoi.c 5common/atoi.c
4common/ctype.c 6common/ctype.c
7#ifndef SIMULATOR
5common/dir.c 8common/dir.c
9common/file.c
10#endif
6common/disk.c 11common/disk.c
7common/errno.c 12common/errno.c
8common/file.c
9common/memcmp.c 13common/memcmp.c
10common/qsort.c 14common/qsort.c
11common/random.c 15common/random.c
@@ -16,7 +20,7 @@ common/strcat.c
16common/strchr.c 20common/strchr.c
17common/strcmp.c 21common/strcmp.c
18common/strcpy.c 22common/strcpy.c
19#if CONFIG_CPU == SH7034 23#if (CONFIG_CPU == SH7034) && !defined(SIMULATOR)
20common/strlen_a.S 24common/strlen_a.S
21#else 25#else
22common/strlen.c 26common/strlen.c
@@ -33,7 +37,20 @@ common/memset_a.S
33common/memcpy.c 37common/memcpy.c
34common/memset.c 38common/memset.c
35#endif 39#endif
36debug.c 40#ifdef HAVE_LCD_CHARCELLS
41drivers/lcd-player-charset.c
42drivers/lcd-player.c
43#endif
44#ifdef HAVE_LCD_BITMAP
45#if CONFIG_LCD == LCD_S1D15E06
46drivers/lcd-h100.c
47#else
48drivers/lcd-recorder.c
49#endif
50#endif
51drivers/power.c
52drivers/led.c
53#ifndef SIMULATOR
37drivers/adc.c 54drivers/adc.c
38#ifdef HAVE_MMC 55#ifdef HAVE_MMC
39drivers/ata_mmc.c 56drivers/ata_mmc.c
@@ -54,42 +71,35 @@ tuner_philips.c
54#endif 71#endif
55#endif 72#endif
56drivers/i2c.c 73drivers/i2c.c
57#ifdef HAVE_LCD_CHARCELLS
58drivers/lcd-player-charset.c
59drivers/lcd-player.c
60#endif
61#ifdef HAVE_LCD_BITMAP
62#if CONFIG_LCD == LCD_S1D15E06
63drivers/lcd-h100.c
64#else
65drivers/lcd-recorder.c
66#endif
67#endif
68drivers/led.c
69#if CONFIG_HWCODEC != MASNONE 74#if CONFIG_HWCODEC != MASNONE
70drivers/mas.c 75drivers/mas.c
71#endif 76#endif
72drivers/power.c
73#ifdef HAVE_RTC 77#ifdef HAVE_RTC
74drivers/rtc.c 78drivers/rtc.c
75#endif 79#endif
76drivers/serial.c 80drivers/serial.c
81#endif /* !SIMULATOR */
77#ifdef HAVE_LCD_BITMAP 82#ifdef HAVE_LCD_BITMAP
78font.c 83font.c
79#endif 84#endif
80hwcompat.c 85hwcompat.c
81id3.c 86id3.c
87#ifndef SIMULATOR
82kernel.c 88kernel.c
89rolo.c
90thread.c
91crt0.S
92#endif
83mp3_playback.c 93mp3_playback.c
84mp3data.c 94mp3data.c
85mpeg.c 95mpeg.c
96#ifndef WIN32 /* the win32 sim has its own versin of these: */
86panic.c 97panic.c
98debug.c
99#endif
87powermgmt.c 100powermgmt.c
88rolo.c
89system.c 101system.c
90thread.c
91usb.c 102usb.c
92crt0.S
93#if CONFIG_CPU == SH7034 103#if CONFIG_CPU == SH7034
94bitswap.S 104bitswap.S
95descramble.S 105descramble.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, ...)
222void debug_init(void) 222void debug_init(void)
223{ 223{
224} 224}
225extern void *stderr;
225 226
226void debugf(const char *fmt, ...) 227void 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
35struct dirent { 35struct 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 @@
36int snprintf (char *buf, size_t size, const char *fmt, ...); 36int snprintf (char *buf, size_t size, const char *fmt, ...);
37int vsnprintf (char *buf, int size, const char *fmt, __VALIST ap); 37int vsnprintf (char *buf, int size, const char *fmt, __VALIST ap);
38 38
39#ifdef SIMULATOR
40typedef void FILE;
41int 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 */
25typedef long time_t;
26
27/* this define below is used by the mingw headers to prevent duplicate
28 typedefs */
29#define _TIME_T_DEFINED
30time_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
2492NOTE: when we implment these functions for real for software coded targets,
2493these dummies shall remain for the simulator */
2491 2494
2492void bitswap(unsigned char *data, int length) 2495void 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
167my $target = $ARGV[0]; 167my $target = $ARGV[0];
168 168
169my $exe = ""; 169my $exe = $ARGV[1];
170 170
171if($target !~ /sim/i) { 171if(!$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
22prefixtools () {
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
35crosswincc () {
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
46simcc () {
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
22shcc () { 85shcc () {
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
32calmrisccc () { 91calmrisccc () {
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
42coldfirecc () { 97coldfirecc () {
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
95fi 153fi
96} 154}
97 155
98
99simul () {
100
101sed > 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
116export ARCHOS=@ARCHOS@
117export ROOTDIR=@ROOTDIR@
118export FIRMDIR=\$(ROOTDIR)/firmware
119export APPSDIR=\$(ROOTDIR)/apps
120export TOOLSDIR=\$(ROOTDIR)/tools
121export DOCSDIR=\$(ROOTDIR)/docs
122export APPSDIR=@ROOTDIR@/apps
123export SIMDIR=\$(ROOTDIR)/uisimulator/@SIMVER@
124export DEBUG=@DEBUG@
125export KEYPAD=@KEYPAD@
126export OBJDIR=@PWD@
127export SIMVER=@SIMVER@
128export TARGET=@TARGET@
129export LANGUAGE=@LANGUAGE@
130export VERSION=\$(shell date +%y%m%d-%H%M)
131export ENABLEDPLUGINS=@PLUGINS@
132export SOFTWARECODECS=@CODECS@
133export MEMORYSIZE=@MEMORY@
134
135.PHONY:
136
137all: sim
138
139sim:
140 \$(MAKE) -C \$(SIMDIR)
141
142clean:
143 \$(MAKE) -C \$(SIMDIR) clean
144 rm -rf rockbox.zip
145
146tags:
147 @rm -f TAGS
148 make -C \$(SIMDIR) tags
149
150zip:
151 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" sim\$(TARGET)
152
153install:
154 @echo "installing a full setup in your archos dir"
155 @(make zip && cd archos && unzip -oq ../rockbox.zip)
156EOF
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
169picklang() { 156picklang() {
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
238else 225else
239 226
240echo "This script will setup your Rockbox build environment." 227echo "This script will setup your Rockbox build environment."
241echo "Further docs here: http://rockbox.haxx.se/docs/" 228echo "Further docs here: http://www.rockbox.org/"
242echo "" 229echo ""
243 230
244fi 231fi
@@ -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"
505fi 493fi
506 494
495uname=`uname`
496
507if [ "yes" = "$simulator" ]; then 497if [ "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
507fi
508
509# Now, figure out version number of the (gcc) compiler we are about to use
510gccver=`$CC -dumpversion`;
511
512if [ -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."
516else
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
511fi 532fi
512 533
513sed > Makefile \ 534sed > 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
540export ROOTDIR=@ROOTDIR@ 569export ROOTDIR=@ROOTDIR@
541export FIRMDIR=\$(ROOTDIR)/firmware 570export FIRMDIR=\$(ROOTDIR)/firmware
@@ -562,8 +591,17 @@ export LD=@LD@
562export AR=@AR@ 591export AR=@AR@
563export AS=@AS@ 592export AS=@AS@
564export OC=@OC@ 593export OC=@OC@
594export WINDRES=@WINDRES@
595export DLLTOOL=@DLLTOOL@
596export DLLWRAP=@DLLWRAP@
597export RANLIB=@RANLIB@
565export GCCOPTS=@GCCOPTS@ 598export GCCOPTS=@GCCOPTS@
566export LOADADDRESS=@LOADADDRESS@ 599export LOADADDRESS=@LOADADDRESS@
600export SIMVER=@SIMVER@
601export SIMDIR=\$(ROOTDIR)/uisimulator/\$(SIMVER)
602export LDOPTS=@LDOPTS@
603export GCCVER=@GCCVER@
604export 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
586zip: 624zip: all
587 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET) 625 \$(TOOLSDIR)/buildzip.pl -r "\$(ROOTDIR)" \$(TARGET) \$(BINARY)
626EOF
627
628if [ "yes" = "$simulator" ]; then
629
630 cat >> Makefile <<EOF
631
632install:
633 @echo "installing a full setup in your archos dir"
634 @(make zip && cd archos && unzip -oq ../rockbox.zip)
588EOF 635EOF
589 636
637fi
638
590echo "Created Makefile" 639echo "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
14x11/*.[ch] 14x11/*.[ch]
15x11/Makefile 15x11/Makefile
16x11/archos/rockbox112.bmp 16x11/archos/rockbox112.bmp
17common/SOURCES
18win32/SOURCES
19x11/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
20DEPFILE = $(OBJDIR)/dep-commonsim
21
22RM = rm -f
23DEBUG = -g
24
25# Use this for simulator-only files
26INCLUDES = -I. -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR)
27
28SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
29 $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
30OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
31
32DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
33$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
34
35SOURCES = $(SRC)
36
37DIRS = .
38
39CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS)
40
41OUTFILE = $(OBJDIR)/libsim.a
42
43all: $(OUTFILE)
44
45include $(TOOLSDIR)/make.inc
46
47clean:
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 @@
1fmradio.c
2font-player.c
3io.c
4lcd-common.c
5lcd-playersim.c
6mpegplay.c
7sim_icons.c
8stubs.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
20APPDIR = ../../apps
21RECDIR = $(APPDIR)/recorder
22PLAYDIR = $(APPDIR)/player
23PLUGINDIR = $(APPDIR)/plugins
24SIMCOMMON = ../common 20SIMCOMMON = ../common
25 21
26ISONDIO := $(findstring ONDIO, $(TARGET)) 22DEPFILE = $(OBJDIR)/dep-simwin
27ISIRIVER := $(findstring IRIVER, $(TARGET))
28ISPLAYER := $(findstring PLAYER, $(TARGET))
29ifeq ($(ISPLAYER), PLAYER)
30 MACHINEDIR = $(PLAYDIR)
31else
32 MACHINEDIR = $(RECDIR)
33endif
34
35PREVAPPDIR= ..
36FIRMWAREDIR = ../../firmware
37
38# build some sources from these dirs
39DRIVERS = $(FIRMWAREDIR)/drivers
40COMMON = $(FIRMWAREDIR)/common
41
42# include here:
43EXPORT = $(FIRMWAREDIR)/export
44TOOLSDIR = ../../tools
45DOCSDIR = ../../docs
46 23
47RM = rm -f 24RM = rm -f
48DEBUG = -g 25DEBUG = -g
49 26
50ifndef OBJDIR 27INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR)
51no_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"
57endif
58 28
59DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ 29DEFINES = -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
62LDFLAGS = -lgdi32 -luser32 32LDFLAGS = -lgdi32 -luser32
63 33
64# Use this for simulator-only files 34SRC := $(shell cat SOURCES | gcc -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
65INCLUDES = -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 36OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
67# The true Rockbox Applications should use this include path:
68APPINCLUDES = $(INCLUDES)
69 37
70DEFINES += -DWIN32 38SOURCES = $(SRC)
39DIRS = .
71 40
72CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin 41CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall -mno-cygwin
73 42
74APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall -mno-cygwin
75DLLTOOLFLAGS = --export-all 43DLLTOOLFLAGS = --export-all
76DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin 44DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
77 45
78UNAME := $(shell uname|sed -e "s/CYGWIN.*/CYGWIN/") 46OUTFILE = $(OBJDIR)/libsim.a
79EXEFILE := $(OBJDIR)/rockboxui.exe 47
80 48all: $(OUTFILE)
81ifeq ($(UNAME),CYGWIN) 49 @echo "MAKE in common sim"
82 CC = gcc 50 $(MAKE) -C $(SIMCOMMON)
83 WINDRES = windres 51
84 DLLTOOL = dlltool 52include $(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
89else 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
98endif
99
100ifeq ($(ISPLAYER),PLAYER)
101 LCDSRSC = lcd-playersim.c lcd-player.c lcd-player-charset.c font-player.c
102else
103ifeq ($(ISIRIVER),IRIVER)
104 LCDSRSC = lcd-h100.c sysfont.c font.c
105else
106 LCDSRSC = lcd-recorder.c sysfont.c font.c
107endif
108endif
109COMMONSRCS = io.c stubs.c lcd-common.c sim_icons.c fmradio.c
110
111FIRMSRCS = $(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
115APPS = 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
121ifneq ($(ISPLAYER),PLAYER)
122 APPS += peakmeter.c bmp.c widgets.c radio.c
123endif
124
125SRCS = 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
129OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) $(OBJDIR)/uisw32-res.o
130
131ifdef ENABLEDPLUGINS
132 ROCKS := $(patsubst $(PLUGINDIR)/%.c,$(OBJDIR)/%.rock,$(wildcard $(PLUGINDIR)/*.c))
133 PLUGINLIBOBJS := $(patsubst $(PLUGINDIR)/lib/%.c,$(OBJDIR)/%.o,$(wildcard $(PLUGINDIR)/lib/*.c))
134endif
135
136all: $(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
147clean: 59clean:
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 ##################
234DEPS:=$(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 @@
1button.c
2debug-win32.c
3dir-win32.c
4kernel.c
5lcd-win32.c
6mpeg-win32.c
7panic-win32.c
8string-win32.c
9thread-win32.c
10uisw32.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
20RECDIR = $(APPSDIR)/recorder
21PLAYDIR = $(APPSDIR)/player
22PLUGINDIR = $(APPSDIR)/plugins
23SIMCOMMON = ../common 20SIMCOMMON = ../common
24 21
25ISONDIO := $(findstring ONDIO, $(TARGET)) 22DEPFILE = $(OBJDIR)/dep-sim
26ISIRIVER := $(findstring IRIVER, $(TARGET))
27ISPLAYER := $(findstring PLAYER, $(TARGET))
28ifeq ($(ISPLAYER), PLAYER)
29 MACHINEDIR = $(PLAYDIR)
30else
31 MACHINEDIR = $(RECDIR)
32endif
33
34PREVAPPSDIR= ..
35
36# build some sources from these dirs
37DRIVERS = $(FIRMDIR)/drivers
38COMMON = $(FIRMDIR)/common
39
40# include here:
41EXPORT = $(FIRMDIR)/export
42 23
43RM = rm -f 24RM = rm -f
44DEBUG = -g 25DEBUG = -g
45 26
46ifndef OBJDIR
47no_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"
53endif
54
55DEFINES := -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
59INCLUDES = -I. -I$(EXPORT) -I$(APPSDIR) -I$(MACHINEDIR) -I$(SIMCOMMON) -I$(OBJDIR) -I$(PLUGINDIR)/lib 28INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) -I$(FIRMDIR)/export -I$(APPSDIR)
60
61# The true Rockbox Applications should use this include path:
62APPINCLUDES = $(INCLUDES)
63
64SRCDIRS = . $(DRIVERS) $(FIRMDIR)/export $(APPSDIR) $(MACHINEDIR)
65
66# The true Rockbox Applications should use this include path:
67APPINCLUDES = $(INCLUDES)
68
69LIBS = -lpthread
70 29
71CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) -W -Wall 30SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
31 $(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - )
32OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
72 33
73APPCFLAGS = $(DEBUG) $(DEFINES) $(APPINCLUDES) -W -Wall 34DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
74 35$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES)
75UNAME := $(shell uname|sed -e "s/CYGWIN.*/CYGWIN/")
76EXEFILE = $(OBJDIR)/rockboxui
77ifeq ($(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
82else
83ifeq ($(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
89else
90ifeq ($(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
96else
97 LDFLAGS = -lX11 -lm -lXt -lXmu -lnsl -ldl
98 DEFINES += -DBIG_ENDIAN
99 LIBDIRS =
100endif
101endif
102endif
103
104ifeq ($(HAVE_MPEG_PLAY),1)
105 SOUNDSRC = mpegplay.c oss_sound.c
106 LDFLAGS += $(SOUND_LDFLAGS)
107 CFLAGS += $(SOUND_CFLAGS) -DHAVE_MPEG_PLAY
108else
109 SOUNDSRC =
110endif
111
112ifeq ($(ISPLAYER), PLAYER)
113 LCDSRSC = lcd-playersim.c lcd-player.c lcd-player-charset.c font-player.c
114else
115ifeq ($(ISIRIVER),IRIVER)
116 LCDSRSC = lcd-h100.c sysfont.c font.c
117else
118 LCDSRSC = lcd-recorder.c sysfont.c font.c
119endif
120endif
121COMMONSRCS = io.c stubs.c lcd-common.c sim_icons.c fmradio.c
122
123FIRMSRCS = $(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
127APPS = 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
133ifneq ($(ISPLAYER), PLAYER)
134 APPS += peakmeter.c bmp.c widgets.c radio.c
135endif
136 36
137SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c \ 37SOURCES = $(SRC)
138 button-x11.c thread.c $(APPS) $(MENUS) $(FIRMSRCS) \
139 $(COMMONSRCS) $(SOUNDSRC)
140 38
141OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) 39DIRS = .
142 40
143ifdef ENABLEDPLUGINS 41CFLAGS = $(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))
146endif
147 42
148all: $(TOOLSDIR)/convbdf $(EXEFILE) $(ROCKS) 43OUTFILE = $(OBJDIR)/libsim.a
149 44
150$(ROCKS): $(OBJDIR)/libplugin.a 45all: $(OUTFILE)
46 @echo "MAKE in common sim"
47 $(MAKE) -C $(SIMCOMMON)
151 48
152$(TOOLSDIR)/convbdf: 49include $(TOOLSDIR)/make.inc
153 $(MAKE) -C $(TOOLSDIR)
154 50
155clean: 51clean:
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 $@
200ifeq ($(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
204else
205 @chmod -x $@
206endif
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 ##################
239DEPS:=$(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
256ifeq ($(UNAME),CYGWIN)
257$(EXEFILE): $(OBJS)
258 @echo LD $@
259 @$(CC) -g -o $(EXEFILE) $(OBJS) $(LIBDIRS) $(LDFLAGS) $(LIBS)
260else
261$(EXEFILE): $(OBJS)
262 @echo LD $@
263 @$(CC) -g -o $(EXEFILE) $(LIBDIRS) $(LDFLAGS) $(OBJS) $(LIBS)
264endif
265 55
266tags: 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 @@
1button-x11.c
2lcd-x11.c
3#if 0 /* if sound is enabled */
4oss_sound.c
5#endif
6resources.c
7screenhack.c
8thread.c
9uibasic.c
10visual.c