diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-02-18 13:47:17 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-02-18 13:47:17 +0000 |
commit | cdde25b597eb4047e9db27bb8bbcf938e4a43cfe (patch) | |
tree | d25f47817cc8515228c8ea0eb33ab71bfc2159d4 /uisimulator | |
parent | f436476f9f0eeae4640197866ea5b5fa068df7e9 (diff) | |
download | rockbox-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/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 |
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 | |||
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 | ||