aboutsummaryrefslogtreecommitdiff
path: root/backends/gp32/build.rules
blob: 44c0a9538d621ee2bdd73528af819a49843e7752 (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
# ScummVM - Scumm Interpreter
# Copyright (C) 2001  Ludvig Strigeus
# Copyright (C) 2001/2004 The ScummVM project
# Copyright (C) 2002 ph0x - GP32 port
# Copyright (C) 2003-4 DJWillis - GP32 port
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
# Module Details	-	ScummVM for the GP32
#						Build.Rules for GP32 Backend.
#
# Port Maintainer	-	DJWillis <gp32@distant-earth.co.uk>

# GPSDK (SDK, Includes and Startup Files) base dir
GPSDK			=	/usr/compat/gp32/share/sdk

# Outputs
EXEEXT			=	.elf
MAPFILE			=	scummvm.map
BIN			=	scummvm.gxb
FXE			=	scummvm.fxe

# Stripped Build? (Smaller ELF, Minimal debug symbol information).
# You MUST comment this out with a # if you wish to debug your code.
# STRIP_DEBUG		=	-Wl,--strip-debug

# Plugins hack
srcdir			=	./

# GP32 Direct Execute Tool (i.e. pclink -e on Windows, gplink run on Linux)
EXECUTE_TOOL	=	pclink -e

# GCC Tool-chain
CC			=	arm-elf-gcc
CXX			=	arm-elf-g++
LD			=	arm-elf-g++
AS			=	arm-elf-as
OBJCOPY			=	arm-elf-objcopy
FXETOOL			=	b2fxec

CFLAGS  		=	-marm \
				-march=armv4t \
	       			-mapcs \
	       			-finline-functions \
	       			-fshort-enums \
	       			-ffast-math \
	       			-fshort-double \
	       			-mstructure-size-boundary=32 \
	       			-mno-thumb-interwork \
				-I$(GPSDK)/include \
				-g \
				#-Wno-multichar \
	       			#-O3 \
	       			#-fomit-frame-pointer			
					
				# Remove the below from the above flags for Debug.
	       			#-O3 \
	       			#-fomit-frame-pointer

CPPFLAGS		=	$(CFLAGS)

DEFINES 		= 	-D__GP32__
DEFINES			+=	-DNONSTANDARD_PORT

# Support Vorbis Tremor Patches.
#DEFINES		+=	-DUSE_TREMOR

# Support LIBMAD Patches.
#DEFINES		+=	-DGP32_MADMP3

# Support for 8:3 save files names (The GP32 uses FAT12/16 (no vFAT) for the file system).
DEFINES			+=	-DSHORT_SAVENAMES

# Support for the unsigned sound mixer.
DEFINES			+=	-DOUTPUT_UNSIGNED_AUDIO

# Support for the GP32 (fmOPL derived) MIDI engine.
#	-	NOT fully implemented yet.
DEFINES			+=	-DUSE_GP32_FMOPL

LDSPECS			=	-specs=gp32_gpsdk.specs

LDFLAGS 		= 	$(STRIP_DEBUG) \
					-Wl,-Map,$(MAPFILE) \
					$(LDSPECS) -Wl,--no-warn-mismatch
				
LIBS			+=	-L$(GPSDK)/lib \
					-lgpmem -lgpos -lgpstdio -lgpstdlib -lgpsound -lgpgraphic  -lgpgraphic16 -lgpfont -lgpfont16 \
					-lm -lc -lgcc

INCLUDES 		+=	-Ibackends/gp32 -I$(GPSDK)/include

MODULES			+=	backends/gp32

#GP32 Debug - Remove from Release builds
#	This builds in the GP32 GDB USB Stub. Don't use it unless you know what your doing.
#	You also need to remove ANY optemisation from the compiler flags.
DEFINES			+=	-DGP32_GDB
OBJS			+=	backends/gp32/debug-gdbstub-usb.o

#GamePark SDK startup.
OBJS			+=	backends/gp32/startup.o

#Main ScummVM for the GP32 Backend
OBJS			+=	backends/gp32/gp32.o \
				backends/gp32/gp-fs.o \
				backends/gp32/cpuspeed.o \
					
				#backends/gp32/dmaaudio_asm.o \
				#backends/gp32/dmaaudio.o \

#install: all
					#$(EXECUTE_TOOL) $(BIN)

$(FXE): $(BIN)
					$(FXETOOL) -f -a "DJWillis/ScummVM Team" -t "ScummVM for the GP32" -b scummvm.bmp $< $@
	
$(BIN): scummvm$(EXEEXT)
					$(OBJCOPY) -O binary $< $@