summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-02-18 13:47:17 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-02-18 13:47:17 +0000
commitcdde25b597eb4047e9db27bb8bbcf938e4a43cfe (patch)
treed25f47817cc8515228c8ea0eb33ab71bfc2159d4 /uisimulator
parentf436476f9f0eeae4640197866ea5b5fa068df7e9 (diff)
downloadrockbox-cdde25b597eb4047e9db27bb8bbcf938e4a43cfe.tar.gz
rockbox-cdde25b597eb4047e9db27bb8bbcf938e4a43cfe.zip
Unified build system to use SOURCES for sim builds too, a single Makefile-look
made by configure and various related adjustments. This has not yet been tested on cygwin. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6001 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-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
7 files changed, 133 insertions, 426 deletions
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