aboutsummaryrefslogtreecommitdiff
path: root/Makefile.wiz
blob: 5370fb3ac513e2a4fdbf7b264ebb9ed44bb5c757 (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
srcdir      ?= .

DEFINES     := -DHAVE_CONFIG_H
LDFLAGS     :=
INCLUDES    := -I. -I$(srcdir) -I$(srcdir)/engines
LIBS        :=
OBJS        :=
DEPDIR      := .deps

CXX := arm-open2x-linux-g++
CXXFLAGS := -mcpu=arm926ej-s -mtune=arm926ej-s -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -g -mcpu=arm926ej-s -mtune=arm926ej-s -mcpu=arm926ej-s -mtune=arm926ej-s -ansi -W -Wno-unused-parameter -Wconversion -pedantic
LD := arm-open2x-linux-g++
LIBS +=  -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib -lvorbisidec -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib -lmad -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib -lz -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib -Wl,-rpath,/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib -lSDL -lpthread
RANLIB := arm-open2x-linux-ranlib
STRIP := arm-open2x-linux-strip
AR := arm-open2x-linux-ar cru
AS := arm-open2x-linux-as
ASFLAGS :=  -mfloat-abi=soft
WINDRES := arm-open2x-linux-windres
WINDRESFLAGS := 
WIN32PATH=C:/scummvm
AOS4PATH=Games:ScummVM
STATICLIBPATH=/sw

BACKEND := gp2xwiz
MODULES +=  backends/platform/gp2xwiz
MODULE_DIRS += 
EXEEXT := .wiz
NASM := 
NASMFLAGS := 

prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
datarootdir = ${prefix}/share
datadir = ${datarootdir}/scummvm
docdir = ${datarootdir}/doc/scummvm
libdir = ${exec_prefix}/lib
mandir = ${datarootdir}/man

HAVE_GCC = 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
# VERBOSE_BUILD = 1
# USE_MT32EMU = 1
# USE_RGB_COLOR = 1
USE_SCALERS = 1
# USE_HQ_SCALERS = 1
USE_INDEO3 = 1
# USE_VORBIS = 1
USE_TREMOR = 1
# USE_FLAC = 1
USE_MAD = 1
USE_ZLIB = 1
# USE_MPEG2 = 1
# USE_NASM = 1
HAVE_GCC3 = 1
CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP

DYNAMIC_MODULES := 1
VERBOSE_BUILD := 1

ifeq ($(DYNAMIC_MODULES),1)
ENABLED = DYNAMIC_PLUGIN
PLUGIN_PREFIX :=
PLUGIN_SUFFIX := .plugin
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
CXXFLAGS        += -DDYNAMIC_MODULES
PLUGIN_LDFLAGS  += --nostartfiles -Wl,-q,--just-symbols,scummvm.wiz,-Tbackends/platform/gp2xwiz/plugin.ld,--retain-symbols-file,backends/platform/gp2xwiz/plugin.syms -lstdc++ -lc
PRE_OBJS_FLAGS  := -Wl,-whole-archive
POST_OBJS_FLAGS := -Wl,-no-whole-archive
#LIBS           += -ldl
else
ENABLED = STATIC_PLUGIN
endif

ENABLE_SCUMM = $(ENABLED)
ENABLE_SCUMM_7_8 = $(ENABLED)
ENABLE_HE = $(ENABLED)
ENABLE_AGI = $(ENABLED)
ENABLE_AGOS = $(ENABLED)
ENABLE_AGOS2 = $(ENABLED)
ENABLE_CINE = $(ENABLED)
ENABLE_CRUISE = $(ENABLED)
ENABLE_DRACI = $(ENABLED)
ENABLE_DRASCULA = $(ENABLED)
ENABLE_GOB = $(ENABLED)
ENABLE_GROOVIE = $(ENABLED)
ENABLE_GROOVIE2 = $(ENABLED)
ENABLE_KYRA = $(ENABLED)
ENABLE_LOL = $(ENABLED)
ENABLE_LURE = $(ENABLED)
ENABLE_M4 = $(ENABLED)
ENABLE_MADE = $(ENABLED)
ENABLE_MOHAWK = $(ENABLED)
ENABLE_PARALLACTION = $(ENABLED)
ENABLE_QUEEN = $(ENABLED)
ENABLE_SAGA = $(ENABLED)
ENABLE_IHNM = $(ENABLED)
ENABLE_SAGA2 = $(ENABLED)
ENABLE_SCI = $(ENABLED)
ENABLE_SCI32 = $(ENABLED)
ENABLE_SKY = $(ENABLED)
ENABLE_SWORD1 = $(ENABLED)
ENABLE_SWORD2 = $(ENABLED)
ENABLE_TEENAGENT = $(ENABLED)
ENABLE_TINSEL = $(ENABLED)
ENABLE_TOUCHE = $(ENABLED)
ENABLE_TUCKER = $(ENABLED)

INCLUDES +=  -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
OBJS += 
DEFINES += -DNDEBUG -DUNIX -DUNIX -DGP2XWIZ -DNDEBUG -DENABLE_VKEYBD -DDATA_PATH=\"${datarootdir}/scummvm\" -DPLUGIN_DIRECTORY=\"${exec_prefix}/lib/scummvm\"
LDFLAGS += -L/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib -lm

port_mk = ports.mk 

ifeq "$(HAVE_GCC)" "1"
	CXXFLAGS:= -Wall $(CXXFLAGS)
	# Turn off some annoying and not-so-useful warnings
	CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
	# Enable even more warnings...
	CXXFLAGS+= -Wpointer-arith -Wcast-qual -Wcast-align
	CXXFLAGS+= -Wshadow -Wimplicit -Wnon-virtual-dtor -Wwrite-strings

	# Currently we disable this gcc flag, since it will also warn in cases,
	# where using GCC_PRINTF (means: __attribute__((format(printf, x, y))))
	# is not possible, thus it would fail compiliation with -Werror without
	# being helpful.
	#CXXFLAGS+= -Wmissing-format-attribute

	# Disable RTTI and exceptions, and enable checking of pointers returned by "new"
	CXXFLAGS+= -fno-rtti -fno-exceptions -fcheck-new
endif

ifeq "$(HAVE_CLANG)" "1"
	CXXFLAGS+= -Wno-conversion -Wno-shorten-64-to-32 -Wno-sign-compare -Wno-four-char-constants
endif

#######################################################################
# Default commands - put the necessary replacements in config.mk      #
#######################################################################

CAT     ?= cat
CP      ?= cp
ECHO    ?= printf
INSTALL ?= install
MKDIR   ?= mkdir -p
RM      ?= rm -f
RM_REC  ?= $(RM) -r
ZIP     ?= zip -q

#######################################################################
# Misc stuff - you should never have to edit this                     #
#######################################################################

EXECUTABLE  := scummvm$(EXEEXT)

include $(srcdir)/Makefile.common

# check if configure has been run or has been changed since last run
config.h config.mk: $(srcdir)/configure
ifeq "$(findstring config.mk,$(MAKEFILE_LIST))" "config.mk"
	@echo "Running $(srcdir)/configure with the last specified parameters"
	@sleep 2
	LDFLAGS="$(SAVED_LDFLAGS)" CXX="$(SAVED_CXX)" \
			CXXFLAGS="$(SAVED_CXXFLAGS)" CPPFLAGS="$(SAVED_CPPFLAGS)" \
			ASFLAGS="$(SAVED_ASFLAGS)" WINDRESFLAGS="$(SAVED_WINDRESFLAGS)" \
			$(srcdir)/configure $(SAVED_CONFIGFLAGS)
else
	$(error You need to run $(srcdir)/configure before you can run make. Check $(srcdir)/configure --help for a list of parameters)
endif

ifneq ($(origin port_mk), undefined)
include $(srcdir)/$(port_mk)
endif