File: Makefile.win32

package info (click to toggle)
exult 0.98rc1-2
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 6,924 kB
  • ctags: 8,928
  • sloc: cpp: 83,768; sh: 7,643; ansic: 4,328; makefile: 890; yacc: 618; lex: 255; xml: 19
file content (373 lines) | stat: -rw-r--r-- 12,649 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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# Exult makefile for use in Windows with mingw 1.0 or later
# It may require a little tweaking. (paths)

# Where is Ultima 7 installed
U7PATH=C:\\Ultima7
#Only used for snapshots
TOOLSPATH=C:\\U7Tools

CC=gcc
# Base of the exult source
SRC=.
VPATH=$(SRC):$(SRC)/audio:$(SRC)/audio/midi_drivers:$(SRC)/conf:$(SRC)/data:$(SRC)/files:$(SRC)/files/zip:$(SRC)/flic: \
$(SRC)/gumps:$(SRC)/imagewin:$(SRC)/objs:$(SRC)/pathfinder:$(SRC)/shapes:$(SRC)/server:$(SRC)/tools: \
$(SRC)/usecode:$(SRC)/usecode/compiler:$(SRC)/usecode/ucxt:$(SRC)/usecode/ucxt/src

### Modify these paths
SDL_CFLAGS=-I$(SRC)/sdl/include
SDL_LIBS=-L$(SRC)/sdl/lib -lSDLmain -lSDL

### Uncomment these 2 lines, and comment out the 2 above if you want to build
### Exult as a console Win32 application. This is unsupported and is somewhat
### of a hack.
#SDL_LIBS=-L$(SRC)/sdl/lib -lSDL -mconsole
#SDL_CFLAGS=-I$(SRC)/sdl/include -DSDL_main=main

### Zip File support. Comment out if ZLib isn't installed
### Modify paths, if required
ZIP_CFLAGS=-I$(SRC)/zlib-1.1.3 -DHAVE_ZIP_SUPPORT 
ZIP_LIBS=-L$(SRC)/zlib-1.1.3 -lZ

# Leave this option empty
EXTRA_OPTIONS=

# NOTE: make's builtin implicit rules are used for .cc => .o
# mingw automatically defines WIN32
CPPFLAGS=-DVERSION=\"0.98rc1\" -DEXULT_DATADIR=\"data\" -DDEBUG \
	-DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -I$(SRC)/imagewin -I$(SRC)/shapes \
	-I$(SRC)/files -I$(SRC)/files/zip -I$(SRC)/gumps -I$(SRC)/objs -I$(SRC)/tools \
	-I$(SRC) -I$(SRC)/audio -I$(SRC)/conf -I$(SRC)/pathfinder -I$(SRC)/headers \
	-I$(SRC)/usecode -I$(SRC)/usecode/ucxt/include -I$(SRC)/usecode/compiler -I$(SRC)/data -I$(SRC)/server \
	$(SDL_CFLAGS) -DHAVE_SNPRINTF -DUSE_EXULTSTUDIO -DHAVE_PNG_H $(ZIP_CFLAGS) $(EXTRA_OPTIONS)
	
# NOTE: if not using MinGW32 remove "-include mingw_kludges.h"
CXXFLAGS=-O2 -Wno-long-long -fvtable-thunks -include mingw_kludges.h
CXX=g++

LFLAGS=-mwindows
LIBS=-lmingw32 $(SDL_LIBS) $(ZIP_LIBS) -lwinmm -lole32 -luuid

EXEC=Exult.exe
MAIN_OBJS=actions.o actorio.o actors.o alloc.o \
	args.o bggame.o browser.o cheat.o  \
	combat.o delobjs.o devgame.o \
	 dir.o drag.o effects.o exult.o exultmenu.o \
	game.o gameclk.o gamedat.o gamemap.o \
	gamerend.o gamewin.o keys.o keyactions.o \
	menulist.o monsters.o mouse.o npcnear.o npctime.o palette.o \
	paths.o readnpcs.o schedule.o segfile.o sigame.o tqueue.o txtscroll.o \
	exultico.o cheat_screen.o shapeid.o version.o windrag.o
# unused: npctest.o

PATH_OBJS=Astar.o PathFinder.o Zombie.o path.o

CONF_OBJS=Configuration.o XMLEntity.o
# unused: xmain.o

MIDI_DRV_OBJS=win_midiout.o
# unused: KMIDI.o Timidity_binary.o forked_player.o be_midi.o win_MCI.o

AUDIO_OBJS=Audio.o conv.o Midi.o Mixer.o SDL_mapping.o pcb.o xmidi.o soundtest.o $(MIDI_DRV_OBJS)
# unused: test.o u7audiotool.o

FLIC_OBJS=playfli.o

FILE_OBJS=U7file.o Flex.o IFF.o Table.o Flat.o utils.o listfiles.o crc.o

# Zipfile support objs
ZIP_OBJS=zip.o unzip.o

GUMPS_OBJS= Actor_gump.o  Book_gump.o  File_gump.o  Gump.o  Gump_button.o \
	gump_utils.o  Gump_widget.o  misc_buttons.o  Paperdoll_gump.o  \
	Paperdoll_gump_info.o Scroll_gump.o Sign_gump.o  Slider_gump.o \
	Spellbook_gump.o Stats_gump.o Text_gump.o  Yesno_gump.o \
	Gamemenu_gump.o Newfile_gump.o Gump_ToggleButton.o \
	AudioOptions_gump.o Face_button.o CombatStats_gump.o \
	Jawbone_gump.o VideoOptions_gump.o Face_stats.o Gump_manager.o \
	Text_button.o GameplayOptions_gump.o Enabled_button.o

IMAGEWIN_OBJS=imagebuf.o imagewin.o iwin8.o ibuf8.o ibuf16.o imagescl.o \
	savepcx.o

SHAPES_OBJS=bodies.o items.o shapeinf.o shapevga.o vgafile.o font.o fontvga.o \
	monstinf.o u7drag.o

OBJS_OBJS=animate.o barge.o chunks.o chunkter.o \
	contain.o egg.o iregobjs.o mappatch.o objs.o \
	spellbook.o virstone.o jawbone.o

USECODE_OBJS=ucinternal.o ucmachine.o ucsched.o intrinsics.o \
	useval.o conversation.o keyring.o ucdisasm.o

SERVER_OBJS=objserial.o servemsg.o server.o servewin32.o

OBJS=$(MAIN_OBJS) $(PATH_OBJS) $(CONF_OBJS) $(AUDIO_OBJS) $(FLIC_OBJS) $(FILE_OBJS) $(GUMPS_OBJS) $(OBJS_OBJS) $(SHAPES_OBJS) $(IMAGEWIN_OBJS) $(USECODE_OBJS) $(ZIP_OBJS) $(SERVER_OBJS)

EXULT_FLX = data/exult.flx data/exult_flx.h
EXULT_FLX_OBJECTS = \
	data/exult_quotes.shp \
	data/exult_credits.shp \
	data/quotes.txt \
	data/credits.txt \
	data/exult_logo.shp \
	data/exult0.pal \
	data/black_gate.shp \
	data/serpent_isle.shp \
	data/meditown.mid \
	data/font.shp \
	data/setup.shp \
	data/play_intro.shp \
	data/full_screen.shp \
	data/cheating.shp \
	data/ok.shp \
	data/cancel.shp \
	data/pointers.shp \
	data/exit.shp \
	data/play_1st_scene.shp \
	data/extras.shp \
	data/midi_conversion.shp \
	data/sfx_conversion.shp \
	data/palette_fades.shp \
	data/scaling_method.shp \
	data/savegump.shp \
	data/sav_downdown.shp \
	data/sav_down.shp \
	data/sav_up.shp \
	data/sav_upup.shp \
	data/sav_slider.shp \
	data/sav_selected.shp \
	data/gameplayoptions.shp \
	data/gamemenu.shp \
	data/audiooptions.shp \
	data/videooptions.shp \
	data/hp_bar.shp \
	data/sfx_icon.shp \
	data/flx.in

EXULT_BG_FLX = data/exult_bg.flx data/exult_bg_flx.h
EXULT_BG_FLX_OBJECTS = \
	data/bg/hoe_of_destruction.shp \
	data/bg/caddellite_helmet.shp \
	data/bg/great_dagger.shp \
	data/bg/magic_boomerang.shp \
	data/bg/gorget.shp \
	data/bg/magicgorget.shp \
	data/bg/cleaver.shp \
	data/bg/faces.shp \
	data/bg/faces2.shp \
	data/bg/amulets.shp \
	data/bg/bgfiredoom.shp \
	data/bg/fellowshipstaff.shp \
	data/bg/BGmap.shp \
	data/bg/defaultkeys.txt \
	data/bg/dupre_face.shp \
	data/bg/fem_av_face.shp \
	data/bg/iolo_face.shp \
	data/bg/male_av_face.shp \
	data/bg/shamino_face.shp \
	data/bg/greaves.shp \
	data/bg/spiked_shield.shp \
	data/bg/mr_faces.shp \
	data/bg/mr_intro.shp \
	data/bg/flx.in

EXULT_SI_FLX = data/exult_si.flx data/exult_si_flx.h 
EXULT_SI_FLX_OBJECTS = \
	data/si/SImap.shp \
	data/si/defaultkeys.txt \
	data/si/flx.in

FLEXES = $(EXULT_FLX) $(EXULT_BG_FLX) $(EXULT_SI_FLX)

$(EXEC) : $(FLEXES) $(OBJS) 
	$(CXX) $(LFLAGS) -o $@ $(OBJS) $(LIBS)

expack.exe : expack.o $(FILE_OBJS) 
	$(CXX) $(LFLAGS) -o expack.exe expack.o $(FILE_OBJS) -mconsole

$(EXULT_FLX): expack.exe $(EXULT_FLX_OBJECTS)
	expack.exe -i data/flx.in

$(EXULT_BG_FLX): expack.exe $(EXULT_BG_FLX_OBJECTS)
	expack.exe -i data/bg/flx.in

$(EXULT_SI_FLX): expack.exe $(EXULT_SI_FLX_OBJECTS)
	expack.exe -i data/si/flx.in

exultico.o: win32/exultico.rc win32/exult.ico
	windres --include-dir win32 win32/exultico.rc exultico.o

IPACK_OBJS=ipack.o U7file.o Flex.o IFF.o Table.o Flat.o utils.o imagebuf.o ibuf8.o ibuf16.o vgafile.o pngio.o

ipack.exe : $(IPACK_OBJS)
	$(CXX) $(LFLAGS) -o ipack.exe $(IPACK_OBJS) -lpng -lz -mconsole

mklink.exe : mklink.o
	$(CXX) $(LFLAGS) -o mklink.exe mklink.o -mconsole

rip.exe : rip.o
	$(CXX) $(LFLAGS) -o rip.exe rip.o -mconsole

shp2pcx.exe : shp2pcx.o
	$(CXX) $(LFLAGS) $(SDL_CFLAGS) -o shp2pcx.exe shp2pcx.o -mconsole

splitshp.exe : splitshp.o
	$(CXX) $(LFLAGS) -o splitshp.exe splitshp.o -mconsole

textpack.exe : textpack.o $(FILE_OBJS) 
	$(CXX) $(LFLAGS) -o textpack.exe textpack.o $(FILE_OBJS) -mconsole

ucdump.exe : ucdump.o
	$(CXX) $(LFLAGS) -o ucdump.exe ucdump.o -mconsole

wud.exe : wud.o uctools.h bgintrinsics.h siintrinsics.h 
	$(CXX) $(LFLAGS) -o wud.exe wud.o -mconsole

wuc.exe : wuc.o
	$(CXX) $(LFLAGS) -o wuc.exe wuc.o -mconsole

UCXT_OBJS=Configuration.o XMLEntity.o utils.o ucdata.o ucxt.o ucfunc.o opcodes.o

ucxt.exe : $(UCXT_OBJS)
	$(CXX) $(LFLAGS) -o ucxt.exe $(UCXT_OBJS) -mconsole

UCC_OBJS=ucparse.o uclex.o ucmain.o ucexpr.o ucfun.o ucloc.o ucstmt.o ucsym.o

ucc.exe : $(UCC_OBJS)
	$(CXX) $(LFLAGS) -o ucc.exe $(UCC_OBJS) -mconsole

ucparse.cc:  
	bison -d usecode/compiler/ucparse.yy -o ucparse.c
	ren ucparse.c ucparse.cc
 
uclex.cc:  
	flex usecode/compiler/uclex.ll 
	ren lex.yy.c uclex.cc

CONFREGRESS_OBJS=Configuration.o XMLEntity.o xmain.o utils.o

conf/confregress.exe  : $(CONFREGRESS_OBJS)
	$(CXX) $(LFLAGS) -o confregress.exe $(CONFREGRESS_OBJS) -mconsole

head2data.exe : head2data.o $(FILE_OBJS)
	$(CXX) $(LFLAGS) -o head2data.exe head2data.o $(FILE_OBJS) -mconsole

head2data.test: 
	head2data data/u7bgintrinsics.data data/u7siintrinsics.data

clean:
	del $(OBJS) $(EXEC)
	del expack.exe expack.o
	del data\exult.flx  data\exult_flx.h data\exult_bg.flx data\exult_bg_flx.h data\exult_si.flx data\exult_si_flx.h


install: $(EXEC)
	strip $(EXEC) -o $(U7PATH)\\$(EXEC)
	if not exist $(U7PATH)\data md $(U7PATH)\data
	copy data\exult.flx $(U7PATH)\data
	copy data\exult_bg.flx $(U7PATH)\data
	copy data\exult_si.flx $(U7PATH)\data

dist:   $(EXEC)
	if not exist $(U7PATH)\Exult md $(U7PATH)\Exult
	strip $(EXEC) -o $(U7PATH)\\Exult\$(EXEC)
	if not exist $(U7PATH)\Exult\Data md $(U7PATH)\Exult\Data
	copy data\exult.flx $(U7PATH)\Exult\Data
	copy data\exult_bg.flx $(U7PATH)\Exult\Data
	copy data\exult_si.flx $(U7PATH)\Exult\Data
	copy AUTHORS $(U7PATH)\Exult\AUTHORS.txt
	copy ChangeLog $(U7PATH)\Exult\ChangeLog.txt
	copy COPYING $(U7PATH)\Exult\COPYING.txt
	copy FAQ $(U7PATH)\Exult\FAQ.txt
	copy docs\faq.html $(U7PATH)\Exult
	if not exist $(U7PATH)\Exult\images md $(U7PATH)\Exult\images
	copy docs\images\back.gif $(U7PATH)\Exult\images
	copy docs\images\exult_logo.gif $(U7PATH)\Exult\images
	copy NEWS $(U7PATH)\Exult\NEWS.txt
	copy README $(U7PATH)\Exult\README.txt
	copy README.1ST $(U7PATH)\Exult\README.1ST.txt
	copy docs\ReadMe.html $(U7PATH)\Exult
	copy README.win32 $(U7PATH)\Exult\README.win32.txt
	copy data\bg\defaultkeys.txt $(U7PATH)\Exult\bgdefaultkeys.txt
	copy data\si\defaultkeys.txt $(U7PATH)\Exult\sidefaultkeys.txt
	copy SDL\README-SDL.txt $(U7PATH)\Exult
	copy SDL\lib\SDL.dll $(U7PATH)\Exult

tools:  expack.exe ipack.exe mklink.exe rip.exe shp2pcx.exe splitshp.exe textpack.exe ucdump.exe wuc.exe wud.exe ucxt.exe ucc.exe head2data.exe head2data.test

toolsclean:
	del expack.o expack.exe $(FILE_OBJS)
	del ipack.o ipack.exe $(IPACK_OBJS)
	del mklink.o mklink.exe 
	del rip.o rip.exe
	del shp2pcx.o shp2pcx.exe
	del splitshp.o splitshp.exe
	del textpack.o textpack.exe
	del ucdump.o ucdump.exe 
	del wuc.o wuc.exe 
	del wud.o wud.exe 
	del $(UCXT_OBJS) ucxt.exe
	del $(UCC_OBJS) ucc.exe ucparse.cc ucparse.h uclex.cc
	del $(CONFREGRESS_OBJS) confregress.exe
	del head2data.o head2data.exe data\u7bgintrinsics.data data\u7siintrinsics.data

toolsinstall: tools
	if not exist $(U7PATH)\tools md $(U7PATH)\tools
	strip expack.exe -o $(U7PATH)\tools\expack.exe
	strip ipack.exe -o $(U7PATH)\tools\ipack.exe
	strip mklink.exe -o $(U7PATH)\tools\mklink.exe
	strip rip.exe -o $(U7PATH)\tools\rip.exe
	strip shp2pcx.exe -o $(U7PATH)\tools\shp2pcx.exe
	strip splitshp.exe -o $(U7PATH)\tools\splitshp.exe
	strip textpack.exe -o $(U7PATH)\tools\textpack.exe
	strip ucdump.exe -o $(U7PATH)\tools\ucdump.exe
	strip wuc.exe -o $(U7PATH)\tools\wuc.exe
	strip wud.exe -o $(U7PATH)\tools\wud.exe
	strip ucxt.exe -o $(U7PATH)\ucxt.exe
	strip ucc.exe -o $(U7PATH)\tools\ucc.exe
	if not exist $(U7PATH)\data md $(U7PATH)\data
	copy usecode\ucxt\data\events.data $(U7PATH)\data
	copy usecode\ucxt\data\flags.data $(U7PATH)\data
	copy usecode\ucxt\data\opcodes.txt $(U7PATH)\data
	copy usecode\ucxt\data\u7misc.data $(U7PATH)\data
	copy data\u7bgintrinsics.data $(U7PATH)\data
	copy data\u7siintrinsics.data $(U7PATH)\data

toolsdist: tools
	if not exist $(TOOLSPATH) md $(TOOLSPATH)
	if not exist $(TOOLSPATH)\tools md $(TOOLSPATH)\tools
	strip expack.exe -o $(TOOLSPATH)\tools\expack.exe
	strip ipack.exe -o $(TOOLSPATH)\tools\ipack.exe
	strip mklink.exe -o $(TOOLSPATH)\tools\mklink.exe
	strip rip.exe -o $(TOOLSPATH)\tools\rip.exe
	strip shp2pcx.exe -o $(TOOLSPATH)\tools\shp2pcx.exe
	strip splitshp.exe -o $(TOOLSPATH)\tools\splitshp.exe
	strip textpack.exe -o $(TOOLSPATH)\tools\textpack.exe
	strip ucdump.exe -o $(TOOLSPATH)\tools\ucdump.exe
	strip wuc.exe -o $(TOOLSPATH)\tools\wuc.exe
	strip wud.exe -o $(TOOLSPATH)\tools\wud.exe
	strip ucxt.exe -o $(TOOLSPATH)\ucxt.exe
	strip ucc.exe -o $(TOOLSPATH)\tools\ucc.exe
	if not exist $(TOOLSPATH)\data md $(TOOLSPATH)\data
	copy usecode\ucxt\data\events.data $(TOOLSPATH)\data
	copy usecode\ucxt\data\flags.data $(TOOLSPATH)\data
	copy usecode\ucxt\data\opcodes.txt $(TOOLSPATH)\data
	copy usecode\ucxt\data\u7misc.data $(TOOLSPATH)\data
	copy data\u7bgintrinsics.data $(TOOLSPATH)\data
	copy data\u7siintrinsics.data $(TOOLSPATH)\data
	copy tools\expack.txt $(TOOLSPATH)\tools
	copy tools\intrins1.txt $(TOOLSPATH)\tools
	copy tools\intrins2.txt $(TOOLSPATH)\tools
	copy tools\ipack.txt $(TOOLSPATH)\tools
	copy tools\u7bgflag.txt $(TOOLSPATH)\tools
	copy tools\u7siflag.txt $(TOOLSPATH)\tools
	copy tools\ucformat.txt $(TOOLSPATH)\tools

all: $(EXEC) tools

allclean: clean toolsclean

allinstall: install toolsinstall

run:
	start $(EXEC)