File: Makefile

package info (click to toggle)
xevil 1.5.1e-2.2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 4,580 kB
  • ctags: 2,655
  • sloc: cpp: 17,863; makefile: 223; sh: 1
file content (291 lines) | stat: -rw-r--r-- 9,038 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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
#### Makefile for XEvil.   
# Steve Hardt  
# hardts@mit.edu (valid until Nov. 1996)
# hardts@netscape.com
# hardts@alum.mit.edu
# http://graphics.lcs.mit.edu/~hardts

#### Defines that are applicable to makes on all architectures
SHELL		=	/bin/sh
TARGETS		=	xevil #xshow
DEBUG_OPT	=	-g#  #-DPRINT_ERRORS  
LINK_OPT	=	#-O

#SRC_DIR and WORK_DIR are only used for `make workdir`
SRC_DIR		= 	/mit/hardts/src/X/xevil1.4.9
WORK_DIR 	=	/tmp/hardts3

FILES		= 	*README*  \
			xevil.6 Makefile *.C *.h \
			bitmaps NOTES app-defaults CLASSES run

OBJS		=	physical.o actual.o game.o main.o intel.o locator.o world.o \
			ui.o coord.o area.o utils.o 
ARCHITECTURES	=	athena-sun4 athena-sun5 alpha decmips ds decstation \
			freebsd hp700 iris4d \
			jsc-sun4 i386-linux alpha-linux rsaix sun4 sun5 \
			vision-sun4 
STRIP		=	strip


#### Other macros are defined in the Specific Architectures section below.



#### Attempt to guesss the host architecture using the HOSTYPE and hostype
# variables.  Then call self with the architecture name.
default:
	@if [ $${HOSTTYPE-bob} != bob ] ; then \
		archit=$$HOSTTYPE ; \
	elif [ $${hosttype-bob} != bob ] ; then \
		archit=$$hosttype ; \
	else  \
		archit=unknown ; \
	fi ; \
	if [ $$archit != unknown ] ; then \
		echo Making for $$archit ; \
		$(MAKE) $$archit ; \
	else \
		echo "Could not figure out host architecture." ; \
		echo "Type 'make <architecture>' where <architecture> is one of" ; \
		echo "{$(ARCHITECTURES)}" ; \
	fi ;



#### Specific architectures.  
## Feel free to modify one of these to accomodate your machine's configuration.
alpha:
	@$(MAKE) CC="g++" LIBS="-lX11 -lm -ldnet_stub" \
	CFLAGS="-DUSE_RANDOM -DRANDOM_NEEDS_PROTOTYPES -DPROTECTED_IS_PUBLIC -DSELECT_NEEDS_PROTOTYPES -DMATH_H_IS_CC" \
	LINK_FLAGS="-static" \
	$(TARGETS)


athena-sun4:
	@$(MAKE) CC="g++" LIBS="-lX11 -lm -lsocket -lnsl" \
CFLAGS="-DUSE_RANDOM -DRANDOM_NEEDS_PROTOTYPES -DXEVIL_KEYSET=UIsun4 -DPROTECTED_IS_PUBLIC" \
INCL_DIRS="-I/usr/openwin/include -I/mit/gnu/lib" \
LIBS_DIRS="-L/usr/openwin/lib" \
$(TARGETS)
## NOTE: The -lsocket and -lnsl libraries are not necessary on many systems.

athena-sun5:
	@$(MAKE) CC="g++" LIBS="-lX11 -lm -lsocket -lnsl" \
CFLAGS="-DXEVIL_KEYSET=UIsun4 -DPROTECTED_IS_PUBLIC" \
INCL_DIRS="-I/usr/openwin/include -I/mit/gnu/lib" \
LIBS_DIRS="-L/usr/openwin/lib" \
$(TARGETS)
## NOTE: The -lsocket and -lnsl libraries are not necessary on many systems.



decmips:
	@$(MAKE) CC="g++" LIBS="-lX11 -lm" \
INCL_DIRS="-I/mit/gnu/lib" \
CFLAGS="-DUSE_RANDOM -DRANDOM_NEEDS_PROTOTYPES -DSELECT_NEEDS_PROTOTYPES" \
$(TARGETS)

decstation:
	@$(MAKE) decmips

ds:
	@$(MAKE) decmips


# The -DMSEC_PER_CLOCK=8 is kind of a hack, take it out if the game speed of 
# XEvil is all screwed up.
freebsd:
	@$(MAKE) CC="c++" \
CFLAGS="-DUSE_RANDOM -DPROTECTED_IS_PUBLIC -DMSEC_PER_CLOCK=8" \
INCL_DIRS=-I/usr/X11R6/include LIBS_DIRS=-L/usr/X11R6/lib \
LIBS="-lX11 -lm" $(TARGETS)



hp700:
	@$(MAKE) CC="g++" LIBS="-lX11 -lm" INCL_DIRS="" CFLAGS="-DUSE_RANDOM -DRANDOM_NEEDS_PROTOTYPES -DMATH_H_IS_CC -DPROTECTED_IS_PUBLIC" \
$(TARGETS)


iris:
	@$(MAKE) CC="CC" CFLAGS="-32 -DXEVIL_KEYSET=UIiris -DNO_PRAGMAS" \
INCL_DIRS="" LIBS_DIRS="" LIBS="-lX11 -lm" LINK_FLAGS="-32" $(TARGETS)



iris4d:
	@$(MAKE) iris



jsc-sun4:
	@$(MAKE) CC="g++" LIBS="-lX11 -lm" \
CFLAGS="-DUSE_RANDOM -DCLOCKS_PER_SEC=1000000L" \
INCL_DIRS=-I/usr/local/X11R5/sun4/include \
LIBS_DIRS=-L/usr/local/X11R5/sun4/lib $(TARGETS)


debian-linux:
	@$(MAKE) DEBUG_OPT="$(DEBUG_OPT)" CC="g++" \
		CFLAGS="-DUSE_RANDOM -DPROTECTED_IS_PUBLIC" \
		INCL_DIRS="" \
		LIBS_DIRS="-L/usr/X11R6/lib" LIBS="-lX11 -lm" $(TARGETS)

i386-linux:
	@$(MAKE) CC="g++" CFLAGS="-DUSE_RANDOM -DPROTECTED_IS_PUBLIC" \
INCL_DIRS="" LIBS_DIRS="-L/usr/X11R6/lib" LIBS="-lX11 -lm" $(TARGETS)


alpha-linux:
	@$(MAKE) CC="g++" CFLAGS="-DUSE_RANDOM -DPROTECTED_IS_PUBLIC" \
INCL_DIRS="" LIBS_DIRS="-L/usr/X11R6/lib" LIBS="-lX11 -lm" $(TARGETS)


rsaix: 
	@$(MAKE) CC="g++" CFLAGS="-DUSE_RANDOM -DRANDOM_NEEDS_PROTOTYPES -DUSE_SELECT_H -DXEVIL_KEYSET=UIrsaix -DPROTECTED_IS_PUBLIC" \
LIBS="-lX11 -lm" INCL_DIRS="-I/usr/athena/include -I/mit/gnu/lib" \
LIBS_DIRS="-L/usr/athena/lib/shared" \
$(TARGETS)



sun4:
	@$(MAKE) CC="g++" LIBS="-lX11 -lm" \
CFLAGS="-DCLOCKS_PER_SEC=1000000L -DUSE_RANDOM -DRANDOM_NEEDS_PROTOTYPES -DXEVIL_KEYSET=UIsun4 -DPROTECTED_IS_PUBLIC -DSELECT_NEEDS_PROTOTYPES" \
$(TARGETS)



sun5:
	@$(MAKE) CC="g++" LIBS="-lX11 -lm" \
CFLAGS="-DUSE_RANDOM -DRANDOM_NEEDS_PROTOTYPES -DXEVIL_KEYSET=UIsun4 -DPROTECTED_IS_PUBLIC" \
INCL_DIRS="-I/usr/openwin/include" LIBS_DIRS="-L/usr/openwin/lib" \
$(TARGETS)



vision-sun4:
	@$(MAKE) CC="g++" LIBS="-lX11 -lm" \
CFLAGS="-DCLOCKS_PER_SEC=1000000L -DUSE_RANDOM -DRANDOM_NEEDS_PROTOTYPES -DXEVIL_KEYSET=UIsun4 -DPROTECTED_IS_PUBLIC" \
INCL_DIRS="-I/usr/openwin/include" \
$(TARGETS)



#### Executables
xevil: $(OBJS)
	$(CC) $(LINK_FLAGS) $(LINK_OPT) $(LIBS_DIRS) -o  xevil $(OBJS) $(LIBS)
#	$(STRIP) xevil

# This is a simple program to show a bitmap and mask with arbitrary foreground
# and background colors.  I used it to test many of the bitmaps.  It is not
# needed to compile or run xevil.
xshow: xshow.C
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) $(LIBS_DIRS) -o xshow xshow.C $(LIBS)



#### XEvil modules
utils.o: utils.C utils.h 
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o utils.o -c utils.C 

coord.o: coord.C utils.h coord.h 
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o coord.o -c coord.C 

area.o: area.C utils.h coord.h area.h 
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o area.o -c area.C 

world.o: world.C utils.h coord.h area.h world.h \
	bitmaps/world/world.bitmaps
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o world.o -c world.C 

intel.o: intel.C utils.h coord.h area.h world.h id.h intel.h actual.h\
	locator.h physical.h 
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o intel.o -c intel.C

locator.o: locator.C utils.h coord.h area.h world.h id.h intel.h \
	physical.h locator.h actual.h
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o locator.o -c locator.C

ui.o: ui.C utils.h coord.h area.h world.h id.h intel.h \
	physical.h locator.h ui.h bitmaps/ui/ui.bitmaps
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o ui.o -c ui.C 

physical.o: physical.C utils.h coord.h area.h world.h id.h intel.h \
	locator.h physical.h
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o physical.o -c physical.C 

actual.o: actual.C utils.h coord.h area.h world.h id.h intel.h \
	locator.h physical.h actual.h \
	bitmaps/altar_of_sin/altar_of_sin.bitmaps bitmaps/bomb/bomb.bitmaps \
	bitmaps/chainsaw/chainsaw.bitmaps bitmaps/enforcer/enforcer.bitmaps \
	bitmaps/f_thrower/f_thrower.bitmaps bitmaps/fireball/fireball.bitmaps \
	bitmaps/frog/frog.bitmaps bitmaps/frog_gun/frog_gun.bitmaps \
	bitmaps/frog_shell/frog_shell.bitmaps bitmaps/hero/hero.bitmaps \
	bitmaps/lance/lance.bitmaps bitmaps/lancer/lancer.bitmaps \
	bitmaps/laser/laser.bitmaps \
	bitmaps/m_gun/m_gun.bitmaps bitmaps/med_kit/med_kit.bitmaps \
	bitmaps/ninja/ninja.bitmaps bitmaps/pistol/pistol.bitmaps \
	bitmaps/rock/rock.bitmaps bitmaps/shell/shell.bitmaps \
	bitmaps/swap_shell/swap_shell.bitmaps bitmaps/swapper/swapper.bitmaps \
	bitmaps/alien/alien.bitmaps \
	bitmaps/weight/weight.bitmaps \
	bitmaps/launcher/launcher.bitmaps \
	bitmaps/missile/missile.bitmaps bitmaps/grenades/grenades.bitmaps \
	bitmaps/grenade/grenade.bitmaps \
	bitmaps/chopper_boy/chopper_boy.bitmaps \
	bitmaps/n_protection/n_protection.bitmaps \
	bitmaps/n_shield/n_shield.bitmaps \
	bitmaps/t_protection/t_protection.bitmaps \
	bitmaps/t_shield/t_shield.bitmaps \
	bitmaps/transmogifier/transmogifier.bitmaps bitmaps/xit/xit.bitmaps \
	bitmaps/flag/flag.bitmaps bitmaps/doppel/doppel.bitmaps \
	bitmaps/home/home.bitmaps bitmaps/trapdoor/trapdoor.bitmaps \
	bitmaps/lemming/lemming.bitmaps bitmaps/fire_demon/fire_demon.bitmaps \
	bitmaps/stars/stars.bitmaps bitmaps/star/star.bitmaps \
	bitmaps/walker/walker.bitmaps bitmaps/hugger/hugger.bitmaps
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o actual.o -c actual.C 

game.o: game.C utils.h coord.h area.h world.h id.h intel.h \
	physical.h actual.h locator.h ui.h game.h
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o game.o -c game.C 

# NOTE: Does not need actual.h
main.o: main.C utils.h coord.h area.h world.h id.h intel.h \
	physical.h locator.h ui.h game.h
	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o main.o -c main.C 


#.SUFFIXES: .C .o
#.C.o: $*.C
#	$(CC) $(DEBUG_OPT) $(CFLAGS) $(INCL_DIRS) -o $*.o -c $*.C 


## Remove executables and all junk.
clean:
	/bin/rm -f $(TARGETS) $(OBJS) core test test.o xshow.o xshow


## Make a distribution file.
dist:
	tar chf xevil`date +%m.%d.%y`.tar $(FILES)
	compress xevil`date +%m.%d.%y`.tar


## Make a shadow tree for the XEvil source.
workdir:
	@if test ! -d $(WORK_DIR); then \
		mkdir $(WORK_DIR); \
	else \
		echo $(WORK_DIR) already exists; \
	fi; \
	for filee in $(FILES); do \
		/bin/rm -f $(WORK_DIR)/$$filee; \
		ln -s $(SRC_DIR)/$$filee $(WORK_DIR); \
	done
install:
	install xevil $(DESTDIR)/usr/games