File: makefile

package info (click to toggle)
stella 0.7-2
  • links: PTS
  • area: non-free
  • in suites: hamm, slink
  • size: 864 kB
  • ctags: 1,158
  • sloc: cpp: 6,615; ansic: 492; makefile: 224; asm: 31
file content (247 lines) | stat: -rw-r--r-- 8,413 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
241
242
243
244
245
246
247
###############################################################################
##
##    SSSS    tt          lll  lll              
##   SS  SS   tt           ll   ll                
##   SS     tttttt  eeee   ll   ll   aaaa    "An Atari 2600 VCS Emulator"
##    SSSS    tt   ee  ee  ll   ll      aa      
##       SS   tt   eeeeee  ll   ll   aaaaa   Copyright (c) 1995,1996,1997
##   SS  SS   tt   ee      ll   ll  aa  aa         Bradford W. Mott
##    SSSS     ttt  eeeee llll llll  aaaaa    
##
###############################################################################
##
## makefile
##
## Bradford W. Mott
## January 11,1997
##
## Joel Sutton - FreeBSD target (Tuesday April 29, 1997)
## David Shaw - BSDI target
##
###############################################################################
##
## The following options are used during compiling.  You may need to
## define some of these on the CXXFLAGS line if you're not running on a
## supported system
##
##   -DDEFINE_BOOL_TYPE if your C++ compiler doesn't support the bool type
##
##   -DEXCEPTION_FIX if your C++ compiler doesn't fully support exceptions
##       (This should be used with g++ 2.7.2 since its exception support 
##        doesn't allow optimizing)
##
##   -DTHROTTLE if you don't want the frame rate to exceed 60 FPS
##  
##   -DSHOW_TIMING if your want some timing information displayed when
##       you exit the program
##
##   -DM6507_FAST_ACCESS if you want the 6507 emulation to try and
##       access instructions faster (this is not 100% compatible,
##       but it seems to be working for most games)
##
##   -DLSB_FIRST if your machine has the least significant byte first
##       and you defined M6507_FAST_ACCESS this will help speedup the
##       6507 emulation (for all Intel processors this can be turned on)
##
##   -DDEBUG if you want a 6507 trace written to "M6507.debug" (Slow!)
##
##   -DDEBUG_ACCESSES if you want bad memory accesses displayed
##
##   -DUNIX_OS if you're compiling on a unix machine
##
##   -DMSDOS_OS if you're compiling on an msdos machine
##
##   -DLINUX_JOYSTICK to include linux joystick driver support
##       (requires you to install the joystick kernel module)
##
###############################################################################
CXX      = gcc
LD       = g++

CXXFLAGS = -O -Wall -DEXCEPTION_FIX
#CXXFLAGS = -O -ansi -Wall -DEXCEPTION_FIX -DSHOW_TIMING

## The following flags are used to compile M6507Hi.cxx.  It seems 
## that some compilers can't handle optimizing that file so I had
## to hack around it.  You'll need to use the version that doesn't
## do optimization for DJGPP.
M6507HIFLAGS = $(CXXFLAGS)
#M6507HIFLAGS = -Wall -DEXCEPTION_FIX

LDFLAGS  = 
LDLIBS   = 

default:
	@echo ""
	@echo "To build Stella type: 'make <version>'"
	@echo ""
	@echo "where <version> is one of:"
	@echo ""
	@echo "  linux-i386-x         Linux/i386 X-Windows version"
	@echo "  linux-i386-x-joy     Linux/i386 X-Windows version & Joystick"
	@echo "  linux-i386-svga      Linux/i386 SVGALIB version"
	@echo "  linux-i386-svga-joy  Linux/i386 SVGALIB version & Joystick"
	@echo "  linux-x              Linux X-Windows version"
	@echo "  linux-x-joy          Linux X-Windows version & Joystick"
	@echo "  linux-svga           Linux SVGALIB version"
	@echo "  linux-svga-joy       Linux SVGALIB version & Joystick"
	@echo "  freebsd-x            FreeBSD X-Windows version"
	@echo "  freebsd-oss          FreeBSD X-Windows version with oss sound"
	@echo "  bsdi30-x             BSDI 3.0 X windows version"
	@echo "  bsdi21-x             BSDI 2.1 X windows version"
	@echo "  unix-x               Generic unix X windows version"
	@echo "  msdos                MS-DOS version (using DJGPP)"
	@echo ""
	@echo "Hopefully new versions will be added soon!"
	@echo ""

linux-i386-x:
	make xstella \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLSB_FIRST" \
          LDFLAGS="-L/usr/X11R6/lib" \
          LDLIBS="-lX11 -lXext" \
          OBJS="SndUnix.o TermX11.o main.o"

linux-i386-x-joy:
	make xstella \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLSB_FIRST -DLINUX_JOYSTICK" \
          LDFLAGS="-L/usr/X11R6/lib" \
          LDLIBS="-lX11 -lXext" \
          OBJS="SndUnix.o TermX11.o main.o"

linux-i386-svga:
	make stella \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLSB_FIRST" \
          LDLIBS="-lvga" \
          OBJS="SndUnix.o TermSVGA.o main.o"

linux-i386-svga-joy:
	make stella \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLSB_FIRST -DLINUX_JOYSTICK" \
          LDLIBS="-lvga" \
          OBJS="SndUnix.o TermSVGA.o main.o"

linux-x:
	make xstella \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS" \
          LDFLAGS="-L/usr/X11R6/lib" \
          LDLIBS="-lX11 -lXext" \
          OBJS="SndUnix.o TermX11.o main.o"

linux-x-joy:
	make xstella \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLINUX_JOYSTICK" \
          LDFLAGS="-L/usr/X11R6/lib" \
          LDLIBS="-lX11 -lXext" \
          OBJS="SndUnix.o TermX11.o main.o"

linux-svga:
	make stella \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS" \
          LDLIBS="-lvga" \
          OBJS="SndUnix.o TermSVGA.o main.o"

linux-svga-joy:
	make stella \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLINUX_JOYSTICK" \
          LDLIBS="-lvga" \
          OBJS="SndUnix.o TermSVGA.o main.o"

freebsd-x:
	make xstella \
        CXXFLAGS="${CXXFLAGS} -I/usr/X11R6/include/" \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLSB_FIRST" \
          LDFLAGS="-L/usr/X11R6/lib" \
          LDLIBS="-lX11 -lXext" \
          OBJS="SndUnix.o TermX11.o main.o"

freebsd-oss:
	make xstella \
        CXXFLAGS="${CXXFLAGS} -I/usr/X11R6/include/" \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLSB_FIRST" \
          LDFLAGS="-L/usr/X11R6/lib" \
          LDLIBS="-lX11 -lXext" \
          OBJS="SndUnix.o TermX11.o main.o"
	cd sound ; make oss

bsdi30-x:
	make xstella \
          CXX="shlicc++" LD="shlicc++" \
          CXXFLAGS="-O3 -Wall -DEXCEPTION_FIX -I/usr/X11R6/include" \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLSB_FIRST" \
          LDFLAGS="-L/usr/X11R6/lib" \
          LDLIBS="-lX11" \
          OBJS="SndUnix.o TermX11.o main.o"

bsdi21-x:
	make xstella \
          CXXFLAGS="-O3 -Wall -DEXCEPTION_FIX -I/usr/X11R6/include" \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLSB_FIRST" \
          LDFLAGS="-L/usr/X11R6/lib" \
          LDLIBS="-lX11 -lipc" \
          OBJS="SndUnix.o TermX11.o main.o"

unix-x:
	make xstella \
          OPTIONS="-DUNIX_OS -DTHROTTLE -DM6507_FAST_ACCESS" \
          LDLIBS="-lX11 -lXext" \
          OBJS="SndUnix.o TermX11.o main.o"

msdos:
	make stella.exe \
          LD="gxx" \
          M6507HIFLAGS="-Wall -DEXCEPTION_FIX" \
          OPTIONS="-DMSDOS_OS -DTHROTTLE -DM6507_FAST_ACCESS -DLSB_FIRST" \
          OBJS="SndDOS.o TermDOS.o main.o TIASound.o"

###############################################################################
## List of "core" object files
###############################################################################
CORE_OBJECTS = BasTerm.o \
               Cart.o Cart2K.o Cart3F.o Cart4K.o CartAR.o CartE0.o \
               CartE7.o CartF4SC.o CartF6.o CartF6SC.o CartF8.o \
               CartF8SC.o CartFASC.o \
               Console.o Control.o Device.o Joystick.o Paddle.o \
               M6507.o M6507Hi.o M6507Lo.o M6532.o Props.o System.o TIA.o \
               Random.o Snd.o VCS.o VCSScrpt.o

xstella: $(CORE_OBJECTS) $(OBJS)
	$(LD) -o xstella $(CORE_OBJECTS) $(OBJS) $(LDFLAGS) $(LDLIBS)

stella: $(CORE_OBJECTS) $(OBJS)
	$(LD) -o stella $(CORE_OBJECTS) $(OBJS) $(LDFLAGS) $(LDLIBS)

stella.exe: $(CORE_OBJECTS) $(OBJS)
	$(LD) -o a.out *.o $(LDFLAGS) $(LDLIBS)
	strip a.out
	copy /B \djgpp\bin\pmodstub.exe + a.out stella.exe
	del a.out
	del a.exe

TIASound.o: sound/TIASound.c
	$(CXX) -c -DWIN32 $(CXXFLAGS) sound/TIASound.c

M6507Hi.o: M6507Hi.cxx M6507.hxx
	$(CXX) -c $(M6507HIFLAGS) $(OPTIONS) M6507Hi.cxx

M6507.ins: M6507.m4
	m4 M6507.m4 > M6507.ins

M6507.cxx: M6507.ins

VCS.def: stella.vcs
	echo -n \" > VCS.def
	sed 's/\"/\\\"/g' stella.vcs >> VCS.def
	echo -n \" >> VCS.def

VCS.cxx: VCS.def


clean:
	rm -f *.o stella xstella stella.exe

.SUFFIXES: .cxx

.cxx.o:
	$(CXX) -c $(CXXFLAGS) $(OPTIONS) $*.cxx