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
|
$NetBSD: patch-aa,v 1.7 2002/07/14 07:44:44 kristerw Exp $
--- Makefile.orig Tue Sep 18 08:03:58 2001
+++ Makefile Sat Jul 13 22:15:09 2002
@@ -1,14 +1,14 @@
-ZSNESFX=1
-ZSNESC4=1
-ASMCPU=1
+#ZSNESFX=1
+#ZSNESC4=1
+#ASMCPU=1
#SPC700ASM=1
NETPLAY=1
UNZIP=1
#GLIDE=1
#OPENGL=1
#GUI=1
-THREAD_SOUND=1
-ASMKREED=1
+#THREAD_SOUND=1
+#ASMKREED=1
ifdef ZSNESFX
FXOBJ=i386/fxemu2b.o i386/fxemu2.o i386/fxemu2c.o i386/fxtable.o i386/sfxproc.o i386/zsnes.o
@@ -34,7 +34,10 @@
C4NO_DEPENDS=zsnes_c4
endif
+ifdef NETBSD_USE_DGA
LINUXDEFINES=-DUSE_DGA_EXTENSION -DUSE_VIDMODE_EXTENSION
+DGALIBS=-lXxf86dga -lXxf86vm
+endif
ifdef SPC700ASM
SOUNDOBJ=spctool/spc700.o spctool/dsp.o spctool.o spctool/soundmod.o spc.o
@@ -58,6 +61,16 @@
KREEDOBJ=2xsai.o
endif
+ifdef USBJOY
+ifdef USBHID_H
+USBJOYDEFINES=-DJOYSTICK_SUPPORT -DHAVE_USBHID_H
+EXTRALIBS+=-lusbhid
+else
+USBJOYDEFINES=-DJOYSTICK_SUPPORT
+EXTRALIBS+=-lusb
+endif
+endif
+
OBJECTS=$(CPUOBJ) $(SOUNDOBJ) apudebug.o $(FXOBJ) $(C4OBJ) \
cpu.o sa1.o debug.o sdd1.o tile.o srtc.o \
gfx.o memmap.o snaporig.o clip.o dsp1.o \
@@ -81,9 +94,10 @@
UNZIPDEFINES=-DUNZIP_SUPPORT
endif
+EXTRALIBS += -lossaudio
ifdef THREAD_SOUND
-CPUDEFINES += -DUSE_THREADS
-EXTRALIBS += -lpthread
+CPUDEFINES += -DUSE_THREADS -I${BUILDLINK_DIR}/include
+EXTRALIBS += -Wl,-R${LOCALBASE}/lib -L${BUILDLINK_DIR}/lib -lpthread
endif
ifdef GLIDE
@@ -113,9 +127,13 @@
CC = gcc
NASM = nasm
-INCLUDES=-I/usr/X11R6/include -I/usr/local/include
+INCLUDES=-I${X11BASE}/include
+ifdef USING_I386
OPTIMISE= -O6 -mpentium -fomit-frame-pointer -fno-exceptions -Wall -W -pedantic -pipe
+else
+OPTIMISE=-fno-exceptions -Wall -W -pedantic -fomit-frame-pointer
+endif
#OPTIMISE=-g -fno-exceptions
#-DMITSHM
@@ -124,10 +142,8 @@
-Ii386 \
-I. \
-Iunzip \
--DJOYSTICK_SUPPORT \
-DZLIB \
-DVAR_CYCLES \
--DDEBUGGER \
-DCPU_SHUTDOWN \
-DSPC700_SHUTDOWN \
-DOLD_COLOUR_BLENDING \
@@ -142,7 +158,7 @@
$(OPENGLDEFINES) \
$(GUIDEFINES) \
$(KREEDDEFINES) \
--DNO_INLINE_SET_GET
+$(USBJOYDEFINES)
#-DSOUND
#-DDEBUGGER
@@ -154,9 +170,9 @@
CFLAGS=$(CCFLAGS)
.SUFFIXES: .o .cpp .c .cc .h .m .i .S .asm .obj
-LDLIBS = -L/usr/X11R6/lib
+LDLIBS = -Wl,-R${X11BASE}/lib -L${X11BASE}/lib
-all: offsets snes9x ssnes9x
+all: offsets snes9x
#ggisnes9x
#xf86snes9x
@@ -182,7 +198,7 @@
./offsets >i386/offsets.h
snes9x: $(OBJECTS) unix/x11.o $(GLIDEOBJS) $(OPENGLOBJS) $(GUIOBJS) $(KREEDOBJ)
- $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) $(OPENGLOBJS) $(KREEDOBJ) unix/x11.o $(GUIOBJS) $(LDLIBS) $(GLIDELIBS) $(OPENGLLIBS) $(GUILIBS) -lXxf86dga -lXxf86vm -lXext -lX11 $(EXTRALIBS) -lz -lm
+ $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) $(OPENGLOBJS) $(KREEDOBJ) unix/x11.o $(GUIOBJS) $(LDLIBS) $(GLIDELIBS) $(OPENGLLIBS) $(GUILIBS) $(DGALIBS) -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
@@ -212,7 +228,7 @@
$(CCC) $(INCLUDES) -c -E $(CCFLAGS) $*.S -o $@
.asm.o:
- $(NASM) -f elf $(FXDEFINES) -i. -ii386 -o $@ $*.asm
+ $(NASM) -f ${FILEFORMAT} $(FXDEFINES) -i. -ii386 -o $@ $*.asm
.obj.o:
cp $*.obj $*.o
|