diff options
Diffstat (limited to 'uisimulator/win32')
-rw-r--r-- | uisimulator/win32/Makefile | 220 | ||||
-rw-r--r-- | uisimulator/win32/SOURCES | 10 |
2 files changed, 34 insertions, 196 deletions
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 | ||