File: Makefile

package info (click to toggle)
snes9x 1.26-1
  • links: PTS
  • area: non-free
  • in suites: potato
  • size: 2,712 kB
  • ctags: 9,605
  • sloc: cpp: 40,776; asm: 27,081; ansic: 6,572; makefile: 314
file content (240 lines) | stat: -rw-r--r-- 6,426 bytes parent folder | download
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
ZSNESFX=1
ASMCPU=1
#SPC700ASM=1
NETPLAY=1
UNZIP=1
GLIDE=1
#GUI=1
THREAD_SOUND=1

ifdef ZSNESFX
FXOBJ=i386/fxemu2b.o i386/fxemu2.o i386/fxemu2c.o i386/fxtable.o i386/sfxproc.o i386/zsnes.o
FXDEFINES=-DZSNES_FX -DEXECUTE_SUPERFX_PER_LINE
FXDEPENDS=zsnes_fx
FXNO_DEPENDS=c_fx
else
FXOBJ=fxinst.o fxemu.o fxdbg.o
FXDEFINES=-DEXECUTE_SUPERFX_PER_LINE
FXDEPENDS=c_fx
FXNO_DEPENDS=zsnes_fx
endif

LINUXDEFINES=-DUSE_DGA_EXTENSION -DUSE_VIDMODE_EXTENSION

ifdef ASMCPU
ifdef SPC700ASM
CPUOBJ=i386/cpuops.o i386/cpuexec.o i386/spc700.o sa1cpu.o
CPUDEFINES=
else
CPUOBJ=i386/cpuops.o i386/cpuexec.o spc700.o i386/sa1ops.o
CPUDEFINES=-DSPC700_C
endif
else
CPUOBJ=cpuops.o cpuexec.o spc700.o sa1cpu.o
CPUDEFINES=
endif

OBJECTS=$(CPUOBJ) cpu.o sa1.o debug.o tile.o \
	gfx.o memmap.o snaporig.o clip.o dsp1.o \
	ppu.o dma.o snes9x.o snapshot.o apu.o soundux.o \
        cheats.o data.o unix/unix.o unix/config.o $(FXOBJ) globals.o

ifdef GUI
GUIOBJS = unix/snes9x_gui.o unix/moc_snes9x_gui.o
GUILIBS = -L$(QTDIR)/lib -lqt
GUIDEFINES = -I$(QTDIR)/include
endif

ifdef NETPLAY
OBJECTS += netplay.o
NETPLAYDEFINES=-DNETPLAY_SUPPORT
SERVER_OBJECTS=server.o
endif

ifdef UNZIP
OBJECTS += loadzip.o unzip/unzip.o unzip/explode.o unzip/unreduce.o unzip/unshrink.o
UNZIPDEFINES=-DUNZIP_SUPPORT
endif

ifdef THREAD_SOUND
CPUDEFINES += -DUSE_THREADS
EXTRALIBS += -lpthread
endif

ifdef GLIDE
GLIDEOBJS = unix/glide.o
GLIDEDEFINES = -DUSE_GLIDE -I/usr/include/glide
GLIDELIBS = -lglide2x
GLIDEDEPENDS=use_glide
GLIDENO_DEPENDS=no_glide
else
GLIDEDEPENDS=no_glide
GLIDENO_DEPENDS=use_glide
endif

MOC = $(QTDIR)/bin/moc
CCC = g++ -fno-rtti
CC = gcc
NASM = nasm

INCLUDES=-I/usr/X11R6/include -I/usr/local/include

OPTIMISE=-O6 -mpentium -fomit-frame-pointer -fno-exceptions
#OPTIMISE=-g -fno-exceptions 
#-DMITSHM 

CCFLAGS = $(OPTIMISE) -DMITSHM \
-Ii386 \
-I. \
-Iunzip \
-DJOYSTICK_SUPPORT \
-DZLIB \
-DNO_INLINE_SET_GET \
-DVAR_CYCLES \
-DDEBUGGER \
-DCPU_SHUTDOWN \
-DSPC700_SHUTDOWN \
$(LINUXDEFINES) \
$(FXDEFINES) \
$(CPUDEFINES) \
$(NETPLAYDEFINES) \
$(UNZIPDEFINES) \
$(GLIDEDEFINES) \
$(GUIDEFINES)

#-DSOUND
#-DDEBUGGER
#-DNO_INLINE_SET_GET
#-DVAR_CYCLES
#-DCPU_SHUTDOWN
#-DSPC700_SHUTDOWN

CFLAGS=$(CCFLAGS)

.SUFFIXES: .o .cpp .c .cc .h .m .i .S .asm
LDLIBS = -L/usr/X11R6/lib frame.o

ifdef NETPLAY
all: offsets snes9x ssnes9x s9xserver
else
all: offsets snes9x ssnes9x
endif

#ggisnes9x
#xf86snes9x

$(FXDEPENDS):
	touch $(FXDEPENDS)
	$(RM) $(FXNO_DEPENDS)

$(GLIDEDEPENDS):
	touch $(GLIDEDEPENDS)
	$(RM) $(GLIDENO_DEPENDS)

offsets: offsets.o
	$(CCC) $(INCLUDES) -o $@ offsets.o
	./offsets >i386/offsets.h

snes9x: $(OBJECTS) unix/x11.o $(GLIDEOBJS) $(GUIOBJS)
	$(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) unix/x11.o $(GUIOBJS) $(LDLIBS) $(GLIDELIBS) $(GUILIBS) -lXxf86dga -lXxf86vm -lXext -lX11 $(EXTRALIBS) -lz -lm

ssnes9x: $(OBJECTS) unix/svga.o $(GLIDEOBJS) 
	$(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) unix/svga.o $(LDLIBS) $(GLIDELIBS) -lvga -lvgagl -lz $(EXTRALIBS) -lm

gsnes9x: $(OBJECTS) unix/ggi.o
	$(CCC) $(INCLUDES) -o $@ $(OBJECTS) unix/ggi.o $(LDLIBS) -lggi -lz $(EXTRALIBS) -lm

s9xserver: $(SERVER_OBJECTS)
	$(CCC) $(INCLUDES) -o $@ $(SERVER_OBJECTS) 

.cpp.o:
	$(CCC) $(INCLUDES) -c $(CCFLAGS) $*.cpp -o $@

.c.o:
	$(CC) $(INCLUDES) -c $(CCFLAGS) $*.c -o $@

.cpp.S:
	$(CCC) $(INCLUDES) -S $(CCFLAGS) $*.cpp -o $@

.cpp.i:
	$(CCC) $(INCLUDES) -E $(CCFLAGS) $*.cpp -o $@

.S.o:
	$(CCC) $(INCLUDES) -c $(CCFLAGS) $*.S -o $@

.S.i:
	$(CCC) $(INCLUDES) -c -E $(CCFLAGS) $*.S -o $@

.asm.o:
	$(NASM) -f elf -i. -ii386 -o $@ $*.asm

unix/moc_snes9x_gui.cpp: unix/snes9x_gui.h
	$(MOC) unix/snes9x_gui.h -o $@

clean:
	rm -f $(OBJECTS) offsets.o unix/svga.o unix/x11.o unix/ggi.o unix/xf86.o unix/glide.o

#release: CCFLAGS += -DNO_DEBUGGER

release: clean all

ppu.o: $(FXDEPENDS)
cpu.o: $(FXDEPENDS)
memmap.o: $(FXDEPENDS)
globals.o: $(FXDEPENDS)
i386/cpuexec.o: $(FXDEPENDS)
snapshot.o: $(FXDEPENDS)
snaporig.o: $(FXDEPENDS)

unix/unix.o: $(GLIDEDEPENDS)
unix/x11.o: $(GLIDEDEPENDS)
unix/glide.o: $(GLIDEDEPENDS)
gfx.o: $(GLIDEDEPENDS)

i386/cpuexec.o: i386/asmstruc.h i386/offsets.h
i386/cpuops.o: i386/asmstruc.h i386/asmops.h i386/getset.S i386/asmaddr.h \
		i386/offsets.h
i386/spc700.o: i386/asmstruc.h i386/spcops.h i386/offsets.h
i386/sa1ops.o: i386/offsets.h i386/sa1struc.h i386/sa1addr.h i386/sa1ops.h \
		i386/sa1gs.S
cpuexec.o: cpuexec.h cpuops.h snes9x.h snapshot.h gfx.h sa1.h \
	memmap.h ppu.h debug.h port.h display.h apu.h spc700.h apu.h
cpuops.o: cpuops.h memmap.h snes9x.h spc700.h apu.h \
	cpuaddr.h cpumacro.h debug.h port.h cpuexec.h
debug.o: cpuops.h cpuexec.h snes9x.h sa1.h \
	memmap.h ppu.h debug.h missing.h port.h display.h apu.h
ppu.o: snes9x.h memmap.h ppu.h missing.h port.h cpuexec.h \
	apu.h spc700.h fxemu.h fxinst.h sa1.h
dsp1.o: snes9x.h port.h dsp1.h
snapshot.o: snapshot.h memmap.h snes9x.h 65c816.h ppu.h \
	cpuexec.h display.h apu.h spc700.h soundux.h sa1.h
snes96.o: port.h snes9x.h memmap.h
memmap.o: cpuexec.h snes9x.h memmap.h ppu.h port.h cheats.h getset.h apu.h \
	  spc700.h sa1.h
unix.o: cpuexec.h snes9x.h port.h snapshot.h display.h apu.h gfx.h cheats.h
x11.o: display.h snes9x.h memmap.h debug.h ppu.h snapshot.h gfx.h
ggi.o: display.h snes9x.h memmap.h debug.h ppu.h snapshot.h gfx.h 
svga.o: display.h snes9x.h memmap.h debug.h ppu.h snapshot.h gfx.h soundux.h
gfx.o: memmap.h snes9x.h ppu.h gfx.h display.h port.h
tile.o: memmap.h snes9x.h ppu.h display.h gfx.h tile.h 3d.h
spc700.o: spc700.h apu.h apumem.h snes9x.h memmap.h
sa1.o: snes9x.h memmap.h ppu.h cpuexec.h dma.h sa1.h cpuops.cpp 65c816.h
sa1cpu.o: snes9x.h memmap.h ppu.h cpuexec.h dma.h sa1.h cpuops.cpp 65c816.h
apu.o: spc700.h apu.h apumem.h snes9x.h soundux.h
soundux.o: snes9x.h soundux.h apu.h
dma.o: ppu.h dma.h memmap.h getset.h snes9x.h port.h apu.h spc700.h
cheats.o: cheats.h snes9x.h port.h memmap.h
fxemu.o: fxemu.h fxinst.h
fxinst.o: fxemu.h fxinst.h
fxdbg.o: fxemu.h fxinst.h
offsets.o: port.h snes9x.h memmap.h ppu.h apu.h cpuexec.h 65c816.h sa1.h
globals.o: memmap.h spc700.h apu.h cpuexec.h ppu.h cheats.h snes9x.h gfx.h \
	   missing.h dma.h dsp1.h soundux.h sa1.h
xf86.o: display.h snes9x.h memmap.h debug.h ppu.h snapshot.h gfx.h
server.o: snes9x.h port.h memmap.h netplay.h
netplay.o: snes9x.h port.h memmap.h netplay.h
snaporig.o: cpuexec.h
unix/x11.o: snes9x.h port.h
unix/glide.o: snes9x.h port.h 3d.h
unix/x11.o: unix/snes9x_gui.h
unix/snes9x_gui.o: unix/snes9x_gui.h