aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/wince/Makefile
blob: 7f8d45b3de8ea217069e47802eb5296f52582f48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# ScummVM Makefile for Windows CE port
# Uses the cegcc toolchain. For build info check out the wiki: http://wiki.scummvm.org

########################################################################
## Do you want a debug build or not?

#WINCE_DEBUG_BUILD = 1
#UNOPTIMIZED_BUILD = 1

########################################################################
## Do you want a build using plugins?

#DYNAMIC_MODULES = 1
# TODO: You'll need to change STATIC_PLUGIN to DYNAMIC_PLUGIN below

########################################################################
## Enable whichever engines you want here

ENABLE_SCUMM = STATIC_PLUGIN
ENABLE_SCUMM_7_8 = 1
ENABLE_HE = 1
ENABLE_SKY = STATIC_PLUGIN
ENABLE_QUEEN = STATIC_PLUGIN
ENABLE_GOB = STATIC_PLUGIN
ENABLE_LURE = STATIC_PLUGIN
ENABLE_CINE = STATIC_PLUGIN
ENABLE_SAGA = STATIC_PLUGIN
ENABLE_IHNM = 1
#ENABLE_SAGA2 = 1
ENABLE_KYRA = STATIC_PLUGIN
ENABLE_AGI = STATIC_PLUGIN
ENABLE_AGOS = STATIC_PLUGIN
ENABLE_SWORD1 = STATIC_PLUGIN
ENABLE_SWORD2 = STATIC_PLUGIN
ENABLE_TOUCHE = STATIC_PLUGIN
ENABLE_PARALLACTION = STATIC_PLUGIN
ENABLE_DRASCULA = STATIC_PLUGIN
ENABLE_GROOVIE = STATIC_PLUGIN
ENABLE_TUCKER = STATIC_PLUGIN
ENABLE_TINSEL = STATIC_PLUGIN
ENABLE_CRUISE = STATIC_PLUGIN
ENABLE_MADE = STATIC_PLUGIN
#ENABLE_SCI = STATIC_PLUGIN
#ENABLE_M4 = STATIC_PLUGIN

########################################################################
## Pick which libraries you want to use here

USE_MAD           = 1
#USE_TREMOR        = 1
USE_TREMOLO       = 1
#USE_FLAC          = 1
USE_ZLIB          = 1

########################################################################
## For remote deployment (copying the built files onto a device
## automatically), we need to know various things, like which
## tools to use. I use pput and pdel from
##     http://www.xs4all.nl/~itsme/projects/xda/tools.html
## and I keep my installation on the storage card, but other people
## may prefer other things.

REMOTE_COPY      = pput
REMOTE_DELETE    = pdel
REMOTE_DIRECTORY = \Storage Card\Program Files\Scummvm

########################################################################
## You're probably not going to want to change these defines...

USE_SCALERS = 1
USE_HQ_SCALERS = 1
USE_ARM_SOUND_ASM = 1
USE_ARM_SMUSH_ASM = 1
USE_ARM_GFX_ASM   = 1
USE_ARM_COSTUME_ASM = 1
USE_ARM_SCALER_ASM = 1

########################################################################
##    Hopefully you shouldn't need to change anything below here.     ##
########################################################################


srcdir    = ../../..
VPATH     = $(srcdir)

CXX    = arm-wince-mingw32ce-g++
LD     = arm-wince-mingw32ce-g++
AR     = arm-wince-mingw32ce-ar cru
RANLIB = arm-wince-mingw32ce-ranlib
STRIP  = arm-wince-mingw32ce-strip
WINDRES= arm-wince-mingw32ce-windres
MKDIR  = mkdir -p
RM     = rm -f
RM_REC = rm -rf
ECHO   = echo -n
CAT    = cat
AS     = arm-wince-mingw32ce-as

########################################################################
## Set up defines, includes, cflags etc

DEFINES := -D_WIN32_WCE=300 -D__ARM__ -D_ARM_ -DUNICODE -DSCUMM_NEED_ALIGNMENT
DEFINES += -DFPM_DEFAULT

DEFINES += -DNONSTANDARD_PORT
DEFINES += -DWIN32
DEFINES += -Dcdecl= -D__cdecl__= -Wno-multichar

INCLUDES := -I$(srcdir) -I. -I$(srcdir)/engines -Imissing/gcc -Ilibs/include -Ilibs/include/sdl -ICEgui -ICEkeys

CFLAGS :=
ifndef UNOPTIMIZED_BUILD
CFLAGS += -O3 -fno-inline-functions -march=armv4 -mtune=xscale
endif

LDFLAGS := -Wl,-Map,scummvm.exe.map -Wl,--stack,65536
LIBS := -Llibs/lib -lSDL

ifdef WINCE_DEBUG_BUILD
DEFINES += -DDEBUG -DUSE_WINDBG
CFLAGS += -g
LDFLAGS += -debug
endif

ifdef USE_ZLIB
DEFINES += -DUSE_ZLIB
LIBS += -lzlib
endif

ifdef USE_MAD
DEFINES += -DUSE_MAD
LIBS += -lmad
endif

ifdef USE_TREMOR
DEFINES += -DUSE_TREMOR -DUSE_VORBIS
LIBS += -ltremorce
endif

ifdef USE_TREMOLO
DEFINES += -DUSE_TREMOR -DUSE_VORBIS -DUSE_TREMOLO
INCLUDES += -Ilibs/include/tremolo
LIBS += -llibTremolo
endif

ifdef USE_FLAC
DEFINES += -DUSE_FLAC
LIBS += -lFLAC
endif

ifdef USE_SCALERS
DEFINES += -DUSE_SCALERS
endif

ifdef USE_HQ_SCALERS
DEFINES += -DUSE_HQ_SCALERS
endif

ifdef USE_ARM_SMUSH_ASM
DEFINES += -DUSE_ARM_SMUSH_ASM
endif

ifdef USE_ARM_GFX_ASM
DEFINES += -DUSE_ARM_GFX_ASM
endif

ifdef USE_ARM_COSTUME_ASM
DEFINES += -DUSE_ARM_COSTUME_ASM
endif

ifdef USE_ARM_SCALER_ASM
DEFINES += -DUSE_ARM_SCALER_ASM
endif

########################################################################
# Targets follow here

EXECUTABLE = scummvm.exe
CXXFLAGS := $(CFLAGS)
OBJS :=
MODULE_DIRS += ./
DEPDIR = .deps

OBJS += CEActionsPocket.o CEDevice.o CEScaler.o \
        CEActionsSmartphone.o CELauncherDialog.o wince-sdl.o
OBJS += CEgui/GUIElement.o CEgui/Panel.o CEgui/SDL_ImageResource.o \
        CEgui/ItemAction.o CEgui/PanelItem.o CEgui/Toolbar.o \
        CEgui/ItemSwitch.o CEgui/PanelKeyboard.o CEgui/ToolbarHandler.o
OBJS += CEkeys/EventsBuffer.o
OBJS += $(srcdir)/gui/Actions.o $(srcdir)/gui/Key.o $(srcdir)/gui/KeysDialog.o
OBJS += ../sdl/sdl.o ../sdl/graphics.o ../sdl/events.o ../sdl/hardwarekeys.o
OBJS += missing/missing.o
OBJS += smartLandScale.o
ifndef DYNAMIC_MODULES
OBJS += PocketSCUMM.o
endif

ifdef DYNAMIC_MODULES
EXECUTABLE		 = scummvm.dll
PLUGIN_PREFIX		:=
PLUGIN_SUFFIX		:= .dll
PLUGIN_EXTRA_DEPS	 = $(EXECUTABLE)
CXXFLAGS		+= -DDYNAMIC_MODULES
PLUGIN_LDFLAGS		:= -shared -L. -lscummvm -Llibs/lib
PRE_OBJS_FLAGS		:= -Wl,--whole-archive
POST_OBJS_FLAGS		:= -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a -shared
endif

include $(srcdir)/Makefile.common

########################################################################
## Our top level target, and what we deploy depends on whether we are
## building the plugin version or not...
ifdef DYNAMIC_MODULES

all: dist-plugins

deploy: deploy-plugins deploy-exe

else

all: dist

deploy: deploy-exe

endif

dist: PocketSCUMM.o $(EXECUTABLE)

dist-plugins: $(EXECUTABLE) plugins PocketSCUMM.o plugins-stub

plugins-stub: stub.o
	$(CXX) stub.o PocketSCUMM.o -L. -lscummvm -o scummvm.exe

PocketSCUMM.o: PocketSCUMM.rc
	$(WINDRES) $*.rc $@

all-clean: clean
	$(RM) PocketSCUMM.o stub.o

deploy-plugins: dist-plugins
	@echo Deploying DLLs
	-$(REMOTE_MKDIR) "$(REMOTE_DIRECTORY)"
	-$(REMOTE_DELETE) "$(REMOTE_DIRECTORY)\*.dll"
	$(REMOTE_COPY) plugins/*.dll "$(REMOTE_DIRECTORY)"
	$(REMOTE_COPY) scummvm.dll "$(REMOTE_DIRECTORY)"

deploy-exe: dist
	@echo Deploying modern theme - errors are normal here!
	-$(REMOTE_MKDIR) "$(REMOTE_DIRECTORY)"
	@-$(REMOTE_COPY) ../../../gui/themes/modern.ini "$(REMOTE_DIRECTORY)"
	@-$(REMOTE_COPY) ../../../gui/themes/modern.zip "$(REMOTE_DIRECTORY)"
	@echo Deploying EXE
	-$(REMOTE_DELETE) "$(REMOTE_DIRECTORY)\scummvm.exe"
	$(REMOTE_COPY) scummvm.exe "$(REMOTE_DIRECTORY)"