-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.xenon
247 lines (198 loc) · 7.5 KB
/
Makefile.xenon
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
SHELL = /bin/bash
ifeq ($(strip $(DEVKITXENON)),)
$(error "Please set DEVKITXENON in your environment. export DEVKITXENON=<path to>devkitPPC")
endif
include $(DEVKITXENON)/rules
srcdir = .
top_srcdir = .
prefix = /usr/local/xenon
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datarootdir = ${prefix}/share
datadir = ${datarootdir}
sysconfdir = ${prefix}/etc
sharedstatedir = ${prefix}/com
localstatedir = ${prefix}/var
libdir = ${exec_prefix}/lib
infodir = ${datarootdir}/info
mandir = ${datarootdir}/man
includedir = ${prefix}/include
oldincludedir = ${prefix}/usr/include
DESTDIR =
pkgdatadir = $(datadir)/pentagram
pkglibdir = $(libdir)/pentagram
pkgincludedir = $(includedir)/pentagram
top_builddir = .
ACLOCAL = aclocal
AUTOCONF = autoconf
AUTOHEADER = autoheader
INSTALL := /usr/bin/install -c
INSTALL_PROGRAM := ${INSTALL} -s
INSTALL_DATA := ${INSTALL} -m 644
bindir := ${exec_prefix}/bin
datapath := ${datarootdir}/pentagram
LDSCRIPT := -n -T $(DEVKITXENON)/app.lds
CP := cp
CXX := xenon-g++
CC := xenon-gcc
MKDIR := mkdir -p
RM := rm -f
EXEEXT :=
EMPTY_FILE := /dev/null
CC_FOR_BUILD := xenon-gcc
BUILDEXEEXT :=
MACHDEP := -DXENON -m32 -Ofast -mcpu=cell -mtune=cell -fno-tree-vectorize \
-fno-tree-slp-vectorize -ftree-vectorizer-verbose=1 -fuse-linker-plugin \
-maltivec -mabi=altivec -fno-pic -mpowerpc64 -mhard-float \
-L$(DEVKITXENON)/xenon/lib/32 -u read -u _start -u exc_base
DEPDIR := .deps
SDL_CFLAGS := -MP -m32 -I/usr/local/xenon/usr/include/SDL -D_GNU_SOURCE=1 \
-D_REENTRANT
CPPFLAGS := -MP -m32 -g -Ofast -mcpu=cell -mtune=cell -fno-tree-vectorize \
-fno-tree-slp-vectorize -ftree-vectorizer-verbose=1 -fuse-linker-plugin \
-maltivec -mabi=altivec -fno-pic -mpowerpc64 -mhard-float \
-DSAFE_CONSOLE_STREAMS -DXENON -DLIBXENON -DHAVE_CONFIG_H \
-DDATA_PATH=\"${datarootdir}/pentagram\" -Ilibxenon_miss \
-I/usr/local/xenon/xenon/include/ -Ixenon/libxenon_miss \
-I/usr/local/xenon/usr/include/
CXXFLAGS := -MP -m32 -g -Ofast -mcpu=cell -mtune=cell -fno-tree-vectorize \
-fno-tree-slp-vectorize -ftree-vectorizer-verbose=1 -fuse-linker-plugin \
-maltivec -mabi=altivec -fno-pic -mpowerpc64 -mhard-float \
-DSAFE_CONSOLE_STREAMS -DXENON -DLIBXENON -Ixenon/libxenon_miss \
-I/usr/local/xenon/xenon/include/ -I/usr/local/xenon/usr/include/
CFLAGS := -MP -g -Ofast $(INCLUDE) -m32 -mcpu=cell -mtune=cell \
-fno-tree-vectorize -fno-tree-slp-vectorize -ftree-vectorizer-verbose=1 \
-fuse-linker-plugin -maltivec -mabi=altivec -fno-pic -mpowerpc64 \
-mhard-float -DSAFE_CONSOLE_STREAMS -DXENON -DLIBXENON -Ixenon/libxenon_miss \
-I/usr/local/xenon/xenon/include/ -I/usr/local/xenon/usr/include/
LDFLAGS := $(MACHDEP) -L/usr/local/xenon/usr/lib $(LDSCRIPT)
SYS_LIBS :=
CON_LIBS :=
GUI_LIBS := -lSDL_ttf -lSDL -lfreetype -lpng -lfat -lbz2 -lz -lxenon -lglob -lc -lm
WARNINGS := -Wall
GIMPTOOL =
GIMP_INCLUDES =
GIMP_LIBS =
GIMP_PLUGIN_PREFIX =
#GIMP_PLUGIN_MODULES = tools/gimp-plugin
GIMP_PLUGIN_MODULES =
USE_BUILTIN_DATA := yes
HOST_SYSTEM = XENON
SYSTEM :=
SYSTEM_MODULES :=
ifeq ($(HOST_SYSTEM),MACOSX)
SYSTEM = $(SYSTEM_MACOSX)
SYSTEM_MODULES := system/macosx
endif
# List of all submodules
# The order is important, be careful if you change it
#MODULES := tools/data2c convert convert/u8 convert/crusader misc \
# data filesys filesys/zip \
# tools tools/disasm tools/compile tools/flexpack tools/fold \
# tools/shapeconv $(GIMP_PLUGIN_MODULES)\
# kernel games graphics graphics/fonts graphics/scalers audio \
# audio/midi audio/midi/timidity usecode world world/actors gumps \
# gumps/widgets conf system $(SYSTEM_MODULES) .
XENONFIX := tools/data2c convert convert/u8 convert/crusader misc \
data filesys filesys/zip \
tools tools/disasm tools/compile tools/flexpack tools/fold \
tools/shapeconv
MODULES := $(GIMP_PLUGIN_MODULES) kernel games graphics \
graphics/fonts graphics/scalers audio audio/midi \
audio/midi/timidity usecode world world/actors gumps \
gumps/widgets conf system $(SYSTEM_MODULES) .
# Default target. The other dependencies are added by the module.mk files
all: misc/config.h
# GCC 3.4+ precompiled header
ifeq (no,yes)
PCHEADER := misc/pent_include.h.gch
clean-pch:
-$(RM) $(PCHEADER)
else
PCHEADER :=
clean-pch:
endif
# create built-in data file if required
ifeq (yes,yes)
filesys/data.o: xenon/libxenon_miss/data.h
clean-datah:
#-$(RM) data/data.h
else
clean-datah:
endif
# config.h will be in $(top_builddir)/misc (and so will the precompiled header)
CPPFLAGS += -I$(top_builddir)/misc
# look for include files in each of the modules
CPPFLAGS += $(patsubst %,-I$(top_srcdir)/%,$(MODULES),$(XENONFIX)) -I.
# list of all .deps subdirs
DEPDIRS = $(patsubst %,%/$(top_builddir)/$(DEPDIR),$(MODULES))
# Clean all object files & binaries
clean: clean-pch clean-datah
@rm -fr $(OUTPUT).elf
@rm -fr $(OUTPUT).elf32
# Clean *all*
distclean: clean
-$(RM) -r $(DEPDIRS)
-$(RM) $(top_builddir)/misc/config.h $(top_builddir)/misc/config.h.stamp
# reset variables
LSRC :=
LGUIPRODUCTS :=
LCONPRODUCTS :=
# Include list of objects
include $(top_srcdir)/objects.mk
# Include additional rules for each module
include $(patsubst %,$(top_srcdir)/%/module.mk,$(MODULES))
# cancel any built-in .cpp->.o rules
#%.o: %.cpp
TARGET := $(notdir $(CURDIR))
#export OUTPUT := $(CURDIR)/$(OUTPUT).elf
$(OUTPUT).elf32: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)
# custom compile rule which calculates dependencies
%.o: %.cpp $(PCHEADER)
@$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(WARNINGS) $(CPPFLAGS) $(CXXFLAGS) $(SDL_CFLAGS) -c -o $@ $<
%.o: %.c $(PCHEADER)
@$(MKDIR) $(*D)/$(DEPDIR)
$(CC) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(WARNINGS) $(CPPFLAGS) $(CXXFLAGS) $(SDL_CFLAGS) -c -o $@ $<
# cancel any built-in .m->.o rules
%.o: %.m
# custom compile rule which calculates dependencies
%.o: %.m $(PCHEADER)
@$(MKDIR) $(*D)/$(DEPDIR)
$(CC) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(WARNINGS) $(CPPFLAGS) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
# custom compile rule for the precompiled header
%.h.gch: %.h
@$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).h.gch.d",-MQ,"$@",-MP $(WARNINGS) $(CPPFLAGS) $(CXXFLAGS) $(SDL_CFLAGS) -x c++-header -c -o $@ $<
%.elf:
xenon-objcopy -O elf32-powerpc --adjust-vma 0x80000000 $(CURDIR)/pentagram $(CURDIR)/pentagram.elf32
xenon-strip pentagram.elf32
# rule to rebuild Makefile if necessary
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= CONFIG_FILES=$@ \
$(SHELL) ./config.status
# rules to rebuild config.h if necessary
misc/config.h: misc/config.h.stamp
misc/config.h.stamp: $(srcdir)/misc/config.h.in $(top_builddir)/config.status
@$(RM) misc/config.h.stamp
cd $(top_builddir) && \
CONFIG_HEADERS=misc/config.h CONFIG_LINKS= CONFIG_FILES= \
$(SHELL) ./config.status
# including config.h.stamp lets make rescan all dependencies if
# config.h may have been changed.
-include misc/config.h.stamp
# rules to rebuild configure, config.status, aclocal.m4, config.h.in
$(top_builddir)/config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.ac $(top_srcdir)/aclocal.m4
cd $(srcdir) && $(AUTOCONF)
$(top_srcdir)/aclocal.m4: $(srcdir)/configure.ac $(srcdir)/acinclude.m4
cd $(srcdir) && $(ACLOCAL)
$(srcdir)/misc/config.h.in: $(top_srcdir)/configure.ac $(top_srcdir)/aclocal.m4
cd $(top_srcdir) && $(AUTOHEADER)
touch $(srcdir)/misc/config.h.in
.PHONY: all clean distclean clean-pch clean-datah