1#	SCCS Id: @(#)Makefile.GCC	      3.4     $Date: 2003/06/15 15:56:45 $
2#	Copyright (c) NetHack PC Development Team 1996-2003.
3#	PC NetHack 3.4 Makefile for djgpp V2
4#
5#	Gnu gcc compiler for msdos (djgpp)
6#	Requires Gnu Make utility (V3.79.1 or greater) supplied with djgpp
7#
8#	For questions or comments: devteam@nethack.org
9#
10#	In addition to your C compiler,
11#
12#       if you want to change     you will need a
13#       files with suffix         workalike for
14#	  .y	                     yacc
15#	  .l	                     lex
16#
17#	Note that flex (lex) and bison (yacc) are included with the
18#	djgpp distribution and work quite well.	 This makefile assumes
19#	you have them installed correctly.
20
21# Game Installation Variables
22# NOTE: Make sure GAMEDIR exists before make is started.
23
24GAME = nethack
25# The GNU Make has a problem if you include a drive spec below (unfortunately).
26GAMEDIR =../binary
27
28#
29# Directories, gcc likes unix style directory specs
30#
31
32OBJ  = o
33DAT  = ../dat
34DOC  = ../doc
35INCL = ../include
36MSYS = ../sys/msdos
37SRC  = ../src
38SSHR = ../sys/share
39UTIL = ../util
40WIN  = ../win/tty
41WSHR = ../win/share
42
43#
44#  Executables.
45
46CC    = gcc
47LINK  = gcc
48MAKEBIN  = make
49
50#
51# Special libraries and how to link them in.
52
53LIBS = -lpc
54
55# If TERMLIB is defined in pcconf.h, comment out the upper line and
56# uncomment the lower.	Note that you must build the termc library
57# and place it in djgpp's lib directory.  See termcap.zip for details
58
59TERMLIB =
60#TERMLIB = -ltermc
61
62LIBRARIES = $(LIBS) $(TERMLIB)
63
64#
65#  Yacc/Lex ... if you got 'em.
66#
67# If you have yacc/lex or a work-alike set YACC_LEX to Y
68#
69YACC_LEX = Y
70ifeq ($(YACC_LEX),Y)
71DO_YACC = YACC_ACT
72DO_LEX  = LEX_ACT
73endif
74
75# If YACC_LEX is Y above, set the following to values appropriate for
76# your tools.
77#
78YACC   = bison -y
79LEX    = flex
80YTABC  = y_tab.c
81YTABH  = y_tab.h
82#If your tool produces y.tab.c and y.tab.h DOS might require
83#the following instead.
84#YTABC  = ytab~1.c
85#YTABH  = ytab~1.h
86LEXYYC = lexyy.c
87
88#
89# Uncomment the line below if you want to store all the level files,
90# help files, etc. in a single library file.
91
92USE_DLB = Y
93
94# djgpp includes ls.exe and touch.exe in fil41b.zip from the v2gnu
95# folder so be sure to include that when downloading djgpp. Doing
96# so will make changing this unnecessary.
97
98LS = ls -1		# ls.exe from djgpp distribution
99#LS = dir /l/b		# DOS command
100
101# To build a binary without any graphics
102# suitable for blind players,
103# set SUPPRESS_GRAPHICS to Y
104# (Note: binary will require ANSI.SYS driver or equivalent loaded)
105# SUPPRESS_GRAPHICS = Y
106SUPPRESS_GRAPHICS =
107
108#===============================================
109#======= End of Modification Section ===========
110#===============================================
111################################################
112#                                              #
113# Nothing below here should have to be changed.#
114#                                              #
115################################################
116
117GAMEFILE = $(GAMEDIR)/$(GAME).exe
118
119# Changing this conditional block is not recommended
120ifeq ($(USE_DLB),Y)
121DLBFLG = -DDLB
122else
123DLBFLG =
124endif
125
126#
127#  Flags.
128#
129ifeq ($(SUPPRESS_GRAPHICS),Y)
130TERMLIB =
131# Build NetHack suitable for blind players
132
133# Debugging
134#cflags = -pg -c -I../include $(DLBFLG) -DSUPPRESS_GRAPHICS
135#LFLAGS = -pg
136
137cflags = -c -O -I../include $(DLBFLG) -DSUPPRESS_GRAPHICS
138LFLAGS =
139
140else
141
142# Debugging
143#cflags = -pg -c -I../include $(DLBFLG) -DUSE_TILES
144#LFLAGS = -pg
145
146#    Normal
147cflags = -c -O -I../include $(DLBFLG) -DUSE_TILES
148LFLAGS =
149endif
150
151#==========================================
152#================ RULES ==================
153#==========================================
154
155.SUFFIXES: .exe .o .tib .til .uu .c .y .l
156
157#==========================================
158# Rules for files in src
159#==========================================
160
161$(OBJ)/%.o : /%.c
162	$(CC) $(cflags) -o$@ $<
163
164$(OBJ)/%.o : $(SRC)/%.c
165	$(CC) $(cflags) -o$@ $<
166
167#==========================================
168# Rules for files in sys/share
169#==========================================
170
171$(OBJ)/%.o : $(SSHR)/%.c
172	$(CC) $(cflags) -o$@ $<
173
174#==========================================
175# Rules for files in sys/msdos
176#==========================================
177
178$(OBJ)/%.o : $(MSYS)/%.c
179	$(CC) $(cflags) -I../sys/msdos -o$@ $<
180
181#==========================================
182# Rules for files in util
183#==========================================
184
185$(OBJ)/%.o : $(UTIL)/%.c
186	$(CC) $(cflags) -o$@ $<
187
188#==========================================
189# Rules for files in win/share
190#==========================================
191
192$(OBJ)/%.o : $(WSHR)/%.c
193	$(CC) $(cflags) -I../win/share -o$@ $<
194
195#{$(WSHR)}.txt{$(DAT)}.txt:
196#	copy $< $@
197
198#==========================================
199# Rules for files in win/tty
200#==========================================
201
202$(OBJ)/%.o : $(TTY)/%.c
203	$(CC) $(cflags) -o$@ $<
204
205#==========================================
206#================ MACROS ==================
207#==========================================
208# This section creates shorthand macros for many objects
209# referenced later on in the Makefile.
210#
211#
212# Shorten up the location for some files
213#
214
215O  = $(OBJ)/
216
217U  = $(UTIL)/
218
219#==========================================
220#  Utility Objects.
221#==========================================
222
223VGAOBJ      = $(O)vidvga.o
224
225MAKESRC	    = makedefs.c
226
227SPLEVSRC    = lev_yacc.c  lev_$(LEX).c	 lev_main.c  panic.c
228
229DGNCOMPSRC  = dgn_yacc.c  dgn_$(LEX).c	 dgn_main.c
230
231MAKEOBJS    = $(O)makedefs.o  $(O)monst.o	 $(O)objects.o
232
233SPLEVOBJS   = $(O)lev_yacc.o  $(O)lev_$(LEX).o	$(O)lev_main.o  $(O)alloc.o	\
234		$(O)monst.o	    $(O)objects.o	    $(O)panic.o  \
235		$(O)drawing.o	$(O)decl.o	$(O)stubvid.o
236
237DGNCOMPOBJS = $(O)dgn_yacc.o  $(O)dgn_$(LEX).o	$(O)dgn_main.o  $(O)alloc.o	 \
238		$(O)panic.o
239
240RECOVOBJS   = $(O)recover.o
241
242
243#==========================================
244#  Tile related object files.
245#==========================================
246
247ifeq ($(SUPPRESS_GRAPHICS),Y)
248TILOBJ       =
249TEXTIO       =
250TEXTIO2      =
251PLANAR_TIB   =
252OVERVIEW_TIB =
253TILEUTIL     =
254TILEFILES    =
255TILEFILES2   =
256GIFREADERS   =
257GIFREAD2     =
258PPMWRITERS   =
259PPMWRIT2     =
260
261else
262
263TILOBJ      = $(O)tile.o $(O)pctiles.o $(VGAOBJ)
264
265TEXTIO      = $(O)tiletext.o $(O)tiletxt.o $(O)drawing.o $(O)decl.o $(O)monst.o \
266		$(O)objects.o $(O)stubvid.o
267
268TEXTIO2     = $(O)tiletex2.o $(O)tiletxt2.o $(O)drawing.o $(O)decl.o $(O)monst.o \
269		$(O)objects.o $(O)stubvid.o
270
271PLANAR_TIB  = $(DAT)/NetHack1.tib
272
273OVERVIEW_TIB = $(DAT)/NetHacko.tib
274
275TILEUTIL    = $(TILOBJ) $(U)tile2bin.exe $(U)til2bin2.exe $(PLANAR_TIB) $(OVERVIEW_TIB)
276
277TILEFILES   = $(WSHR)/monsters.txt $(WSHR)/objects.txt $(WSHR)/other.txt
278
279TILEFILES2  = $(WSHR)/monthin.txt $(WSHR)/objthin.txt $(WSHR)/oththin.txt
280
281GIFREADERS  = $(O)gifread.o $(O)alloc.o $(O)panic.o
282
283GIFREAD2    = $(O)gifread2.o $(O)alloc.o $(O)panic.o
284
285PPMWRITERS  = $(O)ppmwrite.o $(O)alloc.o $(O)panic.o
286
287PPMWRIT2    = $(O)ppmwrit2.o $(O)alloc.o $(O)panic.o
288endif
289
290
291DLBOBJ = $(O)dlb.o
292
293#  Object files for the game itself.
294
295
296VOBJ01 = $(O)allmain.o  $(O)alloc.o   $(O)apply.o    $(O)artifact.o $(O)attrib.o
297VOBJ02 = $(O)ball.o     $(O)bones.o   $(O)botl.o     $(O)cmd.o      $(O)dbridge.o
298VOBJ03 = $(O)decl.o     $(O)detect.o  $(O)display.o  $(O)do.o       $(O)do_name.o
299VOBJ04 = $(O)do_wear.o  $(O)dog.o     $(O)dogmove.o  $(O)dokick.o   $(O)dothrow.o
300VOBJ05 = $(O)drawing.o  $(O)dungeon.o $(O)eat.o      $(O)end.o      $(O)engrave.o
301VOBJ06 = $(O)exper.o    $(O)explode.o $(O)extralev.o $(O)files.o    $(O)fountain.o
302VOBJ07 = $(O)getline.o  $(O)hack.o    $(O)hacklib.o  $(O)invent.o   $(O)lock.o
303VOBJ08 = $(O)mail.o     $(O)main.o    $(O)makemon.o  $(O)mapglyph.o $(O)mcastu.o $(O)mhitm.o
304VOBJ09 = $(O)mhitu.o    $(O)minion.o  $(O)mkmap.o    $(O)mklev.o    $(O)mkmaze.o
305VOBJ10 = $(O)mkobj.o    $(O)mkroom.o  $(O)mon.o      $(O)mondata.o  $(O)monmove.o
306VOBJ11 = $(O)monst.o    $(O)monstr.o  $(O)mplayer.o  $(O)mthrowu.o  $(O)muse.o
307VOBJ12 = $(O)music.o    $(O)o_init.o  $(O)objects.o  $(O)objnam.o   $(O)options.o
308VOBJ13 = $(O)pickup.o   $(O)pline.o   $(O)polyself.o $(O)potion.o   $(O)quest.o
309VOBJ14 = $(O)questpgr.o $(O)pager.o   $(O)pray.o     $(O)priest.o   $(O)read.o
310VOBJ15 = $(O)rect.o     $(O)restore.o $(O)rip.o      $(O)rnd.o      $(O)role.o
311VOBJ16 = $(O)rumors.o   $(O)save.o    $(O)shk.o      $(O)shknam.o   $(O)sit.o
312VOBJ17 = $(O)sounds.o   $(O)sp_lev.o  $(O)spell.o    $(O)steal.o    $(O)steed.o
313VOBJ18 = $(O)termcap.o  $(O)timeout.o $(O)topl.o     $(O)topten.o   $(O)track.o
314VOBJ19 = $(O)trap.o     $(O)u_init.o  $(O)uhitm.o    $(O)vault.o    $(O)vision.o
315VOBJ20 = $(O)vis_tab.o  $(O)weapon.o  $(O)were.o     $(O)wield.o    $(O)windows.o
316VOBJ21 = $(O)wintty.o   $(O)wizard.o  $(O)worm.o     $(O)worn.o     $(O)write.o
317VOBJ22 = $(O)zap.o      $(O)light.o   $(O)dlb.o      $(O)dig.o      $(O)teleport.o
318VOBJ23 = $(O)region.o
319
320SOBJ   = $(O)msdos.o    $(O)sound.o   $(O)sys.o      $(O)tty.o	    $(O)unix.o \
321	 $(O)video.o    $(O)vidtxt.o  $(O)pckeys.o
322
323VVOBJ  = $(O)version.o
324
325VOBJ  = $(VOBJ01) $(VOBJ02) $(VOBJ03) $(VOBJ04) $(VOBJ05) \
326	$(VOBJ06) $(VOBJ07) $(VOBJ08) $(VOBJ09) $(VOBJ10) \
327	$(VOBJ11) $(VOBJ12) $(VOBJ13) $(VOBJ14) $(VOBJ15) \
328	$(VOBJ16) $(VOBJ17) $(VOBJ18) $(VOBJ19) $(VOBJ20) \
329	$(VOBJ21) $(VOBJ22) $(VOBJ23)
330
331ALLOBJ = $(VOBJ) $(SOBJ) $(TILOBJ) $(VVOBJ)
332
333#==========================================
334# Header file macros
335#==========================================
336
337PATCHLEV_H = $(INCL)/patchlev.h
338DGN_FILE_H = $(INCL)/align.h	$(INCL)/dgn_file.h
339DUNGEON_H  = $(INCL)/align.h	$(INCL)/dungeon.h
340EMIN_H	   = $(DUNGEON_H)	$(INCL)/emin.h
341EPRI_H	   = $(DUNGEON_H)	$(INCL)/align.h	    $(INCL)/epri.h
342ESHK_H	   = $(DUNGEON_H)	$(INCL)/eshk.h
343MONDATA_H  = $(INCL)/align.h	$(INCL)/mondata.h
344MONST_H	   = $(INCL)/align.h	$(INCL)/monst.h
345PERMONST_H = $(INCL)/monattk.h	$(INCL)/monflag.h   $(INCL)/align.h   \
346	    $(INCL)/permonst.h
347REGION_H   = $(INCL)/region.h
348RM_H	   = $(INCL)/align.h	$(INCL)/rm.h
349SKILLS_H   = $(INCL)/skills.h
350SP_LEV_H   = $(INCL)/align.h	$(INCL)/sp_lev.h
351VAULT_H	   = $(DUNGEON_H)	$(INCL)/vault.h
352YOUPROP_H  = $(PERMONST_H)	$(MONDATA_H)	    $(INCL)/prop.h    \
353	    $(INCL)/pm.h       $(INCL)/youprop.h
354YOU_H	   = $(MONST_H)		$(YOUPROP_H)	    $(INCL)/align.h   \
355	     $(INCL)/attrib.h	$(INCL)/you.h
356DISPLAY_H  = $(MONDATA_H)	$(INCL)/vision.h    $(INCL)/display.h
357PCCONF_H   = $(INCL)/micro.h	$(INCL)/system.h    $(INCL)/pcconf.h \
358	    $(MSYS)/pcvideo.h
359CONFIG_H   = $(GLOBAL_H)	$(INCL)/tradstdc.h  $(INCL)/config1.h \
360	    $(INCL)/config.h
361DECL_H	   = $(YOU_H)		$(INCL)/spell.h	    $(INCL)/color.h   \
362	     $(INCL)/obj.h	$(INCL)/onames.h    $(INCL)/pm.h      \
363	      $(INCL)/decl.h
364GLOBAL_H   = $(PCCONF_H)	$(INCL)/coord.h	    $(INCL)/global.h
365HACK_H	   = $(CONFIG_H)	$(DUNGEON_H)	    $(DECL_H)	      \
366	       $(DISPLAY_H)	  $(INCL)/monsym.h    $(INCL)/mkroom.h	\
367	      $(INCL)/objclass.h $(INCL)/trap.h	     $(INCL)/flag.h    \
368	      $(RM_H)		 $(INCL)/vision.h    $(INCL)/wintype.h \
369	      $(INCL)/engrave.h	 $(INCL)/rect.h	  \
370	       $(INCL)/trampoli.h $(INCL)/hack.h $(REGION_H)
371DLB_H      = $(INCL)/dlb.h
372
373ifeq ($(SUPPRESS_GRAPHICS),Y)
374TILE_H     =
375else
376TILE_H	   = $(WSHR)/tile.h $(MSYS)/pctiles.h
377endif
378
379ifeq ($(USE_DLB),Y)
380DLB = dlb
381DLBOBJS = $(O)dlb_main.o $(O)dlb.o $(O)alloc.o $(O)panic.o
382else
383DLB =
384DLBOBJS =
385endif
386
387ifdef DJGPP
388DJ1 = $(dir $(DJGPP))
389CWSDPMI = $(subst /,\,$(DJ1))bin\CWSDPMI.*
390endif
391
392#==========================================
393#  Primary Targets.
394#==========================================
395
396#  The default target.
397
398all :   install
399
400install: $(GAMEFILE) $(O)install.tag
401	@echo Done.
402
403default: $(GAMEFILE)
404
405util: $(O)utility.tag
406
407$(O)utility.tag: $(INCL)/date.h $(INCL)/trap.h    $(INCL)/onames.h	       \
408	$(INCL)/pm.h	  monstr.c   vis_tab.c	\
409	$(U)lev_comp.exe $(U)dgn_comp.exe $(TILEUTIL)
410	$(subst /,\,echo utilities made > $@)
411
412tileutil: $(U)gif2txt.exe $(U)txt2ppm.exe
413	@echo Optional tile development utilities are up to date.
414
415recover: $(U)recover.exe
416	@$(subst /,\,if exist $(U)recover.exe copy $(U)recover.exe $(GAMEDIR))
417	@$(subst /,\,if exist $(DOC)/recover.txt copy $(DOC)/recover.txt $(GAMEDIR))
418
419$(O)install.tag: $(O)dat.tag $(GAMEFILE)
420ifeq ($(USE_DLB),Y)
421	@$(subst /,\,copy $(DAT)/nhdat $(GAMEDIR))
422	@$(subst /,\,copy $(DAT)/license $(GAMEDIR))
423else
424	@$(subst /,\,copy $(DAT)/*. $(GAMEDIR))
425	@$(subst /,\,copy $(DAT)/*.dat $(GAMEDIR))
426	@$(subst /,\,copy $(DAT)/*.lev $(GAMEDIR))
427	@$(subst /,\,copy $(MSYS)/msdoshlp.txt $(GAMEDIR))
428	@$(subst /,\,if exist $(GAMEDIR)/makefile. del $(GAMEDIR)/makefile.)
429endif
430ifdef TERMLIB
431	@$(subst /,\,copy $(SSHR)/termcap $(GAMEDIR))
432endif
433	@$(subst /,\,if exist $(DAT)/*.tib copy $(DAT)/*.tib $(GAMEDIR))
434	@$(subst /,\,copy $(SSHR)/NetHack.cnf  $(GAMEDIR)/defaults.nh)
435	@$(subst /,\,copy $(MSYS)/NHAccess.nh  $(GAMEDIR))
436	@$(subst /,\,copy $(DOC)/guidebo*.txt  $(GAMEDIR))
437	@$(subst /,\,if exist $(DOC)/nethack.txt copy $(DOC)/nethack.txt $(GAMEDIR))
438ifdef CWSDPMI
439	@$(subst /,\,if exist $(CWSDPMI) copy $(CWSDPMI) $(GAMEDIR))
440else
441	@$(subst /,\,echo Could not find a copy of CWSDPMI.EXE to put into $(GAMEDIR))
442endif
443	@$(subst /,\,echo install done > $@)
444
445#==========================================
446#  The main target.
447#==========================================
448
449$(GAMEFILE): $(O)obj.tag $(PATCHLEV_H) $(O)utility.tag $(ALLOBJ) $(O)$(GAME).lnk
450	$(LINK) $(LFLAGS) -o$(GAME).exe @$(O)$(GAME).lnk $(LIBRARIES)
451	@$(subst /,\,stubedit $(GAME).exe minstack=2048K)
452	@$(subst /,\,copy $(GAME).exe $(GAMEFILE))
453	@$(subst /,\,del $(GAME).exe)
454
455$(O)$(GAME).lnk: $(ALLOBJ)
456	 echo $(VOBJ01) > $(subst /,\,$@)
457	 echo $(VOBJ02) >> $(subst /,\,$@)
458	 echo $(VOBJ03) >> $(subst /,\,$@)
459	 echo $(VOBJ04) >> $(subst /,\,$@)
460	 echo $(VOBJ05) >> $(subst /,\,$@)
461	 echo $(VOBJ06) >> $(subst /,\,$@)
462	 echo $(VOBJ07) >> $(subst /,\,$@)
463	 echo $(VOBJ08) >> $(subst /,\,$@)
464	 echo $(VOBJ09) >> $(subst /,\,$@)
465	 echo $(VOBJ10) >> $(subst /,\,$@)
466	 echo $(VOBJ11) >> $(subst /,\,$@)
467	 echo $(VOBJ12) >> $(subst /,\,$@)
468	 echo $(VOBJ13) >> $(subst /,\,$@)
469	 echo $(VOBJ14) >> $(subst /,\,$@)
470	 echo $(VOBJ15) >> $(subst /,\,$@)
471	 echo $(VOBJ16) >> $(subst /,\,$@)
472	 echo $(VOBJ17) >> $(subst /,\,$@)
473	 echo $(VOBJ18) >> $(subst /,\,$@)
474	 echo $(VOBJ19) >> $(subst /,\,$@)
475	 echo $(VOBJ20) >> $(subst /,\,$@)
476	 echo $(VOBJ21) >> $(subst /,\,$@)
477	 echo $(VOBJ22) >> $(subst /,\,$@)
478	 echo $(VOBJ23) >> $(subst /,\,$@)
479	 echo $(SOBJ)   >> $(subst /,\,$@)
480	 echo $(TILOBJ) >> $(subst /,\,$@)
481	 echo $(VVOBJ)  >> $(subst /,\,$@)
482
483
484#==========================================
485#  Housekeeping.
486#==========================================
487
488clean:
489	$(subst /,\,if exist $(O)*.o del $(O)*.o)
490	$(subst /,\,if exist $(O)dat.tag del $(O)dat.tag)
491	$(subst /,\,if exist $(O)install.tag del $(O)install.tag)
492	$(subst /,\,if exist $(O)$(GAME).lnk del $(O)$(GAME).lnk)
493	$(subst /,\,if exist $(O)obj.tag del $(O)obj.tag)
494	$(subst /,\,if exist $(O)sp_lev.tag del $(O)sp_lev.tag)
495	$(subst /,\,if exist $(O)thintile.tag del $(O)thintile.tag)
496	$(subst /,\,if exist $(O)utility.tag del $(O)utility.tag)
497
498spotless: clean
499
500	$(subst /,\,if exist $(U)lev_flex.c del $(U)lev_flex.c)
501	$(subst /,\,if exist $(U)lev_lex.c del $(U)lev_lex.c)
502	$(subst /,\,if exist $(U)lev_yacc.c del $(U)lev_yacc.c)
503	$(subst /,\,if exist $(U)dgn_flex.c del $(U)dgn_flex.c)
504	$(subst /,\,if exist $(U)dgn_lex.c del $(U)dgn_lex.c)
505	$(subst /,\,if exist $(U)dgn_yacc.c del $(U)lev_yacc.c)
506	$(subst /,\,if exist $(U)makedefs.exe del $(U)makedefs.exe)
507	$(subst /,\,if exist $(U)lev_comp.exe del $(U)lev_comp.exe)
508	$(subst /,\,if exist $(U)dgn_comp.exe del $(U)dgn_comp.exe)
509	$(subst /,\,if exist $(U)recover.exe del $(U)recover.exe)
510	$(subst /,\,if exist $(U)tilemap.exe del $(U)tilemap.exe)
511	$(subst /,\,if exist $(U)tile2bin.exe del $(U)tile2bin.exe)
512	$(subst /,\,if exist $(U)til2bin2.exe del $(U)til2bin2.exe)
513	$(subst /,\,if exist $(U)thintile.exe del $(U)thintile.exe)
514	$(subst /,\,if exist $(U)dlb_main.exe del $(U)dlb_main.exe)
515	$(subst /,\,if exist $(INCL)/vis_tab.h del $(INCL)/vis_tab.h)
516	$(subst /,\,if exist $(INCL)/onames.h del $(INCL)/onames.h)
517	$(subst /,\,if exist $(INCL)/pm.h del $(INCL)/pm.h)
518	$(subst /,\,if exist $(INCL)/date.h del $(INCL)/date.h)
519	$(subst /,\,if exist $(INCL)/dgn_comp.h del $(INCL)/dgn_comp.h)
520	$(subst /,\,if exist $(INCL)/lev_comp.h del $(INCL)/lev_comp.h)
521	$(subst /,\,if exist $(SRC)/monstr.c del $(SRC)/monstr.c)
522	$(subst /,\,if exist $(SRC)/vis_tab.c del $(SRC)/vis_tab.c)
523	$(subst /,\,if exist $(SRC)/tile.c del $(SRC)/tile.c)
524	$(subst /,\,if exist $(DAT)/options del $(DAT)/options)
525	$(subst /,\,if exist $(DAT)/data del $(DAT)/data)
526	$(subst /,\,if exist $(DAT)/rumors del $(DAT)/rumors)
527	$(subst /,\,if exist $(DAT)/dungeon.pdf del $(DAT)/dungeon.pdf)
528	$(subst /,\,if exist $(DAT)/dungeon del $(DAT)/dungeon)
529	$(subst /,\,if exist $(DAT)/oracles del $(DAT)/oracles)
530	$(subst /,\,if exist $(DAT)/quest.dat del $(DAT)/quest.dat)
531	$(subst /,\,if exist $(DAT)/dlb.lst del $(DAT)/dlb.lst)
532	$(subst /,\,if exist $(DAT)/nhdat del $(DAT)/nhdat)
533	$(subst /,\,if exist $(DAT)/*.lev del $(DAT)/*.lev)
534	$(subst /,\,if exist $(PLANAR_TIB) del $(PLANAR_TIB))
535	$(subst /,\,if exist $(OVERVIEW_TIB) del $(OVERVIEW_TIB))
536	$(subst /,\,if exist $(WSHR)/monthin.txt del $(WSHR)/monthin.txt)
537	$(subst /,\,if exist $(WSHR)/objthin.txt del $(WSHR)/objthin.txt)
538	$(subst /,\,if exist $(WSHR)/oththin.txt del $(WSHR)/oththin.txt)
539
540#==========================================
541# Create directory for holding object files
542#==========================================
543
544$(O)obj.tag:
545	-$(subst /,\,@if not exist $(OBJ)/*.* mkdir $(OBJ))
546	@$(subst /,\,@echo directory created > $@)
547
548#===========================================
549# Work around some djgpp long file name woes
550#===========================================
551
552$(PATCHLEV_H):
553	@$(subst /,\,if not exist $@ copy $(INCL)/patchlevel.h $(INCL)/patchlev.h)
554
555#==========================================
556#=========== SECONDARY TARGETS ============
557#==========================================
558#
559#  The following include files depend on makedefs to be created.
560#
561#  date.h should be remade every time any of the source or include
562#  files is modified.
563
564
565$(INCL)/date.h : $(U)makedefs.exe
566	-$(subst /,\,$(U)makedefs -v)
567
568$(INCL)/onames.h: $(U)makedefs.exe
569	-$(subst /,\,$(U)makedefs -o)
570
571$(INCL)/pm.h: $(U)makedefs.exe
572	-$(subst /,\,$(U)makedefs -p)
573
574monstr.c: $(U)makedefs.exe
575	-$(subst /,\,$(U)makedefs -m)
576
577$(INCL)/vis_tab.h: $(U)makedefs.exe
578	-$(subst /,\,$(U)makedefs -z)
579
580vis_tab.c: $(U)makedefs.exe
581	-$(subst /,\,$(U)makedefs -z)
582
583#==========================================
584#  Makedefs Stuff
585#==========================================
586
587$(U)makedefs.exe:  $(MAKEOBJS)
588	$(LINK) $(LFLAGS) -o$@ $(MAKEOBJS)
589
590$(O)makedefs.o:  $(CONFIG_H)	$(PERMONST_H)	   $(INCL)/objclass.h \
591		$(INCL)/monsym.h   $(INCL)/qtext.h $(U)makedefs.c
592
593#==========================================
594#  Level Compiler Dependencies
595#==========================================
596
597$(U)lev_comp.exe:  $(SPLEVOBJS)
598	$(LINK) $(LFLAGS) -o$@ $(SPLEVOBJS)
599
600ifeq ($(YACC_LEX),Y)
601
602$(O)lev_yacc.o:  $(HACK_H)	 $(SP_LEV_H)	$(U)lev_yacc.c
603	$(CC) $(cflags) -o$@ $(U)lev_yacc.c
604
605else
606
607$(O)lev_yacc.o:  $(HACK_H)	 $(SP_LEV_H) $(INCL)/lev_comp.h $(U)lev_yacc.c
608	$(CC) $(cflags) -o$@ $(U)lev_yacc.c
609
610endif
611
612$(O)lev_$(LEX).o:  $(HACK_H)   $(SP_LEV_H)	  $(INCL)/lev_comp.h \
613	$(U)lev_$(LEX).c
614	$(CC) $(cflags) -o$@ $(U)lev_$(LEX).c
615
616$(O)lev_main.o:  $(HACK_H) $(INCL)/sp_lev.h $(INCL)/date.h $(U)lev_main.c
617
618ifeq  "$(DO_YACC)" "YACC_ACT"
619
620$(INCL)/lev_comp.h: $(U)lev_yacc.c
621
622$(U)lev_yacc.c $(INCL)/lev_comp.h : $(U)lev_comp.y
623	@$(subst /,\,chdir $(UTIL))
624	@$(subst /,\,$(YACC) -d lev_comp.y)
625	@$(subst /,\,copy $(YTABC) lev_yacc.c)
626	@$(subst /,\,copy $(YTABH) $(INCL)/lev_comp.h)
627	@$(subst /,\,@del $(YTABC))
628	@$(subst /,\,@del $(YTABH))
629	@$(subst /,\,chdir $(SRC))
630else
631
632$(U)lev_yacc.c: $(SSHR)/lev_yacc.c
633	@echo ---
634	@echo For now, we will copy the prebuilt
635	@echo lev_comp.c from $(SSHR) into $(U) and use that.
636	@$(subst /,\,copy $(SSHR)/lev_yacc.c $(U)lev_yacc.c)
637	@$(subst /,\,echo.>>$(U)lev_yacc.c)
638
639$(INCL)/lev_comp.h : $(SSHR)/lev_comp.h
640	@echo ---
641	@echo For now, we will copy the prebuilt lev_comp.h
642	@echo from $(SSHR) into $(INCL) and use that.
643	@$(subst /,\,copy $(SSHR)/lev_comp.h $(INCL)/lev_comp.h)
644	@$(subst /,\,echo.>>$(INCL)/lev_comp.h)
645
646endif
647
648$(U)lev_$(LEX).c: $(U)lev_comp.l
649ifeq  "$(DO_LEX)" "LEX_ACT"
650	@$(subst /,\,chdir $(UTIL))
651	@$(subst /,\,$(LEX) $(FLEXSKEL) lev_comp.l)
652	@$(subst /,\,if exist $@ del $@)
653	@$(subst /,\,copy $(LEXYYC) $@)
654	@$(subst /,\,del $(LEXYYC))
655	@$(subst /,\,chdir $(SRC))
656else
657	@echo ---
658	@echo For now, we will copy the prebuilt lev_lex.c
659	@echo from $(SSHR) into $(U) and use it.
660	@$(subst /,\,copy $(SSHR)/lev_lex.c $@)
661	@$(subst /,\,echo.>>$@)
662endif
663
664#==========================================
665#  Dungeon Dependencies
666#==========================================
667
668$(U)dgn_comp.exe:  $(DGNCOMPOBJS)
669	$(LINK) $(LFLAGS) -o$@ $(DGNCOMPOBJS)
670
671ifeq  "$(DO_YACC)" "YACC_ACT"
672$(U)dgn_yacc.c $(INCL)/dgn_comp.h : $(U)dgn_comp.y
673	@$(subst /,\,chdir $(UTIL))
674	@$(subst /,\,$(YACC) -d dgn_comp.y)
675	@$(subst /,\,copy $(YTABC) dgn_yacc.c)
676	@$(subst /,\,copy $(YTABH) $(INCL)/dgn_comp.h)
677	@$(subst /,\,@del $(YTABC))
678	@$(subst /,\,@del $(YTABH))
679	@$(subst /,\,chdir $(SRC))
680else
681$(U)dgn_yacc.c: $(SSHR)/dgn_yacc.c
682	@echo ---
683	@echo For now, we will copy the prebuilt $(U)dgn_yacc.c and
684	@echo dgn_comp.h from $(SSHR) into $(U) and use that.
685	@$(subst /,\,copy $(SSHR)/dgn_yacc.c $(U)dgn_yacc.c)
686	@$(subst /,\,echo.>>$(U)dgn_yacc.c)
687
688$(INCL)/dgn_comp.h: $(SSHR)/dgn_comp.h
689	@echo ---
690	@echo For now, we will copy the prebuilt dgn_comp.h
691	@echo from $(SSHR) into $(INCL) and use that.
692	@$(subst /,\,copy $(SSHR)/dgn_comp.h $(INCL)/dgn_comp.h)
693	@$(subst /,\,echo.>>$(INCL)/dgn_comp.h)
694
695endif
696
697ifeq  "$(DO_LEX)" "LEX_ACT"
698
699$(U)dgn_$(LEX).c: $(U)dgn_comp.l $(INCL)/dgn_comp.h
700	@$(subst /,\,chdir $(UTIL))
701	@$(subst /,\,$(LEX) $(FLEXSKEL) dgn_comp.l)
702	@$(subst /,\,if exist $@ del $@)
703	@$(subst /,\,copy $(LEXYYC) $@)
704	@$(subst /,\,del $(LEXYYC))
705	@$(subst /,\,chdir $(SRC))
706else
707
708$(U)dgn_$(LEX).c: $(SSHR)/dgn_lex.c $(INCL)/dgn_comp.h
709	@echo ---
710	@echo For now, we will copy the prebuilt dgn_lex.c
711	@echo from $(SSHR) into $(U) and use it.
712	@$(subst /,\,copy $(SSHR)/dgn_lex.c $@)
713	@$(subst /,\,echo.>>$@)
714
715endif
716
717#==========================================
718#  Recover Utility
719#==========================================
720
721$(U)recover.exe:   $(RECOVOBJS)
722	$(LINK) $(LFLAGS) -o$@ $(O)recover.o
723
724$(O)recover.o:   $(CONFIG_H) $(U)recover.c
725	$(CC) $(cflags) -o$@ $(U)recover.c
726
727#==========================================
728#  Header file moves required for tile support
729#==========================================
730
731ifeq ($(SUPPRESS_GRAPHICS),Y)
732
733else
734#
735#  Tile Mapping
736#
737
738$(SRC)/tile.c: $(U)tilemap.exe
739	@$(subst /,\,$(U)tilemap.exe)
740	@echo A new $@ has been created
741
742$(U)tilemap.exe: $(O)tilemap.o
743	$(LINK) $(LFLAGS) -o$@ $(O)tilemap.o
744
745$(O)tilemap.o: $(WSHR)/tilemap.c $(HACK_H) $(TILE_H)
746	$(CC) $(cflags) -I$(WSHR) -I$(MSYS) -o$@ $(WSHR)/tilemap.c
747
748
749#==========================================
750#   Tile Utilities
751#  Required for tile support
752#==========================================
753
754$(DAT)/NetHack1.tib: $(TILEFILES) $(U)tile2bin.exe
755	@echo Creating binary tile files (this may take some time)
756	@$(subst /,\,chdir $(DAT))
757	@$(subst /,\,$(U)tile2bin.exe)
758	@$(subst /,\,chdir $(SRC))
759
760$(DAT)/NetHacko.tib: $(O)thintile.tag $(TILEFILES2) $(U)til2bin2.exe
761	@echo Creating overview binary tile files (this may take some time)
762	@$(subst /,\,chdir $(DAT))
763	@$(subst /,\,$(U)til2bin2.exe)
764	@$(subst /,\,chdir $(SRC))
765
766$(U)tile2bin.exe: $(O)tile2bin.o $(TEXTIO)
767	$(LINK) $(LFLAGS) -o$@ $(O)tile2bin.o $(TEXTIO)
768
769$(U)til2bin2.exe: $(O)til2bin2.o $(TEXTIO2)
770	$(LINK) $(LFLAGS) -o$@ $(O)til2bin2.o $(TEXTIO2)
771
772$(U)thintile.exe: $(O)thintile.o
773	$(LINK) $(LFLAGS) -o$@ $(O)thintile.o
774
775$(O)thintile.o:  $(HACK_H) $(WSHR)/tile.h $(WSHR)/thintile.c
776	$(CC) $(cflags) -o$@ $(WSHR)/thintile.c
777
778$(O)thintile.tag: $(U)thintile.exe $(TILEFILES)
779	@$(subst /,\,$(U)thintile.exe)
780	@$(subst /,\,echo thintiles created >$@)
781
782$(O)tile2bin.o:  $(HACK_H) $(TILE_H) $(MSYS)/pctiles.h $(MSYS)/pcvideo.h $(MSYS)/tile2bin.c
783	$(CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(MSYS)/tile2bin.c
784
785$(O)til2bin2.o:  $(HACK_H) $(TILE_H) $(MSYS)/pctiles.h $(MSYS)/pcvideo.h $(MSYS)/tile2bin.c
786	$(CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILE_X=8 -DOVERVIEW_FILE -o$@ $(MSYS)/tile2bin.c
787
788$(O)tiletext.o:  $(CONFIG_H) $(TILE_H) $(WSHR)/tiletext.c
789	$(CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(WSHR)/tiletext.c
790
791$(O)tiletex2.o:  $(CONFIG_H) $(TILE_H) $(WSHR)/tiletext.c
792	$(CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILE_X=8 -o$@ $(WSHR)/tiletext.c
793
794$(O)tiletxt.o: $(CONFIG_H) $(TILE_H) $(WSHR)/tilemap.c
795	$(CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILETEXT -o$@ $(WSHR)/tilemap.c
796
797$(O)tiletxt2.o: $(CONFIG_H) $(TILE_H) $(WSHR)/tilemap.c
798	$(CC) $(cflags) -I$(MSYS) -I$(WSHR) -DTILETEXT -DTILE_X=8 -o$@ $(WSHR)/tilemap.c
799#
800# Optional GIF Utilities (for development)
801#
802
803$(U)gif2txt.exe: $(GIFREADERS) $(TEXTIO)
804	$(LINK) $(LFLAGS) -o$@ $(GIFREADERS) $(TEXTIO)
805
806$(U)gif2txt2.exe: $(GIFREAD2) $(TEXTIO2)
807	$(LINK) $(LFLAGS) -o$@ $(GIFREAD2) $(TEXTIO2)
808
809$(U)txt2ppm.exe: $(PPMWRITERS) $(TEXTIO)
810	$(LINK) $(LFLAGS) -o$@ $(PPMWRITERS) $(TEXTIO)
811
812$(U)txt2ppm2.exe: $(PPMWRIT2) $(TEXTIO2)
813	$(LINK) $(LFLAGS) -o$@ $(PPMWRIT2) $(TEXTIO2)
814
815$(O)gifread.o: $(CONFIG_H) $(WSHR)/tile.h $(WSHR)/gifread.c
816
817$(O)gifread2.o: $(CONFIG_H) $(WSHR)/tile.h $(WSHR)/gifread.c
818	$(CC) $(cflags) -DTILE_X=8 -o$@ $(WSHR)/gifread.c
819
820ppmwrite.c: $(WSHR)/ppmwrite.c
821	@$(subst /,\,copy $(WSHR)/ppmwrite.c .)
822
823$(O)ppmwrite.o: $(CONFIG_H)	$(WSHR)/tile.h
824
825$(O)ppmwrit2.o:  $(CONFIG_H) $(WSHR)/tile.h ppmwrite.c
826	$(CC) $(cflags) -DTILE_X=8 -o$@ ppmwrite.c
827
828#
829#  Optional tile viewer (development sources only)
830#
831
832$(U)viewtib.exe: $(O)viewtib.o
833	$(LINK) $(LFLAGS) -o$@ $(O)viewtib.o $(LIBRARIES)
834
835$(O)viewtib.o: $(MSYS)/viewtib.c
836
837endif
838
839#==========================================
840#  Other Util Dependencies.
841#==========================================
842
843$(O)alloc.o: $(CONFIG_H)	 alloc.c
844	$(CC) $(cflags) -o$@ alloc.c
845
846$(O)drawing.o: $(CONFIG_H) drawing.c $(MSYS)/pcvideo.h
847	$(CC) $(cflags) -I$(MSYS) -o$@ drawing.c
848
849$(O)decl.o: $(CONFIG_H) decl.c
850	$(CC) $(cflags) -o$@ decl.c
851
852$(O)monst.o: $(CONFIG_H)	     $(PERMONST_H)	$(ESHK_H)	   \
853	$(EPRI_H)	      $(VAULT_H)	 $(INCL)/monsym.h   \
854	$(INCL)/color.h	 monst.c
855	$(CC) $(cflags) -o$@ monst.c
856
857$(O)objects.o: $(CONFIG_H)	      $(INCL)/obj.h	 $(INCL)/objclass.h \
858	$(INCL)/prop.h	    $(INCL)/color.h    objects.c
859	$(CC) $(cflags) -o$@ objects.c
860
861$(O)panic.o:   $(CONFIG_H)	  $(U)panic.c
862
863#============================================================
864# make data.base an 8.3 filename to prevent an make warning
865#============================================================
866
867DATABASE = $(DAT)/data.bas
868
869
870$(O)dat.tag: $(DAT)/nhdat
871	@$(subst /,\,echo dat done >$@)
872
873$(DAT)/data: $(O)utility.tag	$(DATABASE)
874	@$(subst /,\,$(U)makedefs.exe -d)
875
876$(DAT)/rumors:	     $(O)utility.tag    $(DAT)/rumors.tru	$(DAT)/rumors.fal
877	@$(subst /,\,$(U)makedefs.exe -r)
878
879$(DAT)/quest.dat: $(O)utility.tag  $(DAT)/quest.txt
880	@$(subst /,\,$(U)makedefs.exe -q)
881
882$(DAT)/oracles:	     $(O)utility.tag    $(DAT)/oracles.txt
883	@$(subst /,\,$(U)makedefs.exe -h)
884
885$(O)sp_lev.tag: $(O)utility.tag $(DAT)/bigroom.des  $(DAT)/castle.des \
886	$(DAT)/endgame.des $(DAT)/gehennom.des $(DAT)/knox.des \
887	$(DAT)/medusa.des  $(DAT)/oracle.des   $(DAT)/tower.des \
888	$(DAT)/yendor.des  $(DAT)/arch.des     $(DAT)/barb.des \
889	$(DAT)/caveman.des   $(DAT)/healer.des   $(DAT)/knight.des \
890	$(DAT)/monk.des      $(DAT)/priest.des   $(DAT)/ranger.des \
891	$(DAT)/rogue.des     $(DAT)/samurai.des  $(DAT)/tourist.des \
892	$(DAT)/valkyrie.des  $(DAT)/wizard.des
893	@$(subst /,\,cd $(DAT))
894	@$(subst /,\,$(U)lev_comp bigroom.des)
895	@$(subst /,\,$(U)lev_comp castle.des)
896	@$(subst /,\,$(U)lev_comp endgame.des)
897	@$(subst /,\,$(U)lev_comp gehennom.des)
898	@$(subst /,\,$(U)lev_comp knox.des)
899	@$(subst /,\,$(U)lev_comp mines.des)
900	@$(subst /,\,$(U)lev_comp medusa.des)
901	@$(subst /,\,$(U)lev_comp oracle.des)
902	@$(subst /,\,$(U)lev_comp sokoban.des)
903	@$(subst /,\,$(U)lev_comp tower.des)
904	@$(subst /,\,$(U)lev_comp yendor.des)
905	@$(subst /,\,$(U)lev_comp arch.des)
906	@$(subst /,\,$(U)lev_comp barb.des)
907	@$(subst /,\,$(U)lev_comp caveman.des)
908	@$(subst /,\,$(U)lev_comp healer.des)
909	@$(subst /,\,$(U)lev_comp knight.des)
910	@$(subst /,\,$(U)lev_comp monk.des)
911	@$(subst /,\,$(U)lev_comp priest.des)
912	@$(subst /,\,$(U)lev_comp ranger.des)
913	@$(subst /,\,$(U)lev_comp rogue.des)
914	@$(subst /,\,$(U)lev_comp samurai.des)
915	@$(subst /,\,$(U)lev_comp tourist.des)
916	@$(subst /,\,$(U)lev_comp valkyrie.des)
917	@$(subst /,\,$(U)lev_comp wizard.des)
918	@$(subst /,\,cd $(SRC))
919	@$(subst /,\,echo sp_levs done > $@)
920
921$(DAT)/dungeon:	  $(O)utility.tag  $(DAT)/dungeon.def
922	@$(subst /,\,$(U)makedefs.exe -e)
923	@$(subst /,\,cd $(DAT))
924	@$(subst /,\,$(U)dgn_comp.exe dungeon.pdf)
925	@$(subst /,\,cd $(SRC))
926
927#==========================================
928# DLB stuff
929#==========================================
930
931#note that dir below assumes bin/dir.exe from djgpp distribution
932#
933$(DAT)/nhdat:	$(U)dlb_main.exe $(DAT)/data $(DAT)/rumors $(DAT)/dungeon \
934	    $(DAT)/oracles $(DAT)/quest.dat $(O)sp_lev.tag
935	@$(subst /,\,echo dat done >$(O)dat.tag)
936	@$(subst /,\,cd $(DAT))
937	@$(subst /,\,copy $(MSYS)/msdoshlp.txt .)
938	@$(subst /,\,echo data >dlb.lst)
939	@$(subst /,\,echo dungeon >>dlb.lst)
940	@$(subst /,\,echo oracles >>dlb.lst)
941	@$(subst /,\,echo options >>dlb.lst)
942	@$(subst /,\,echo quest.dat >>dlb.lst)
943	@$(subst /,\,echo rumors >>dlb.lst)
944	@$(subst /,\,echo help >>dlb.lst)
945	@$(subst /,\,echo hh >>dlb.lst)
946	@$(subst /,\,echo cmdhelp >>dlb.lst)
947	@$(subst /,\,echo history >>dlb.lst)
948	@$(subst /,\,echo opthelp >>dlb.lst)
949	@$(subst /,\,echo wizhelp >>dlb.lst)
950	@$(subst /,\,echo license >>dlb.lst)
951	@$(subst /,\,echo msdoshlp.txt >>dlb.lst)
952	$(LS) $(subst /,\,*.lev) >>dlb.lst
953	@$(subst /,\,$(U)dlb_main cvIf dlb.lst nhdat)
954	@$(subst /,\,cd $(SRC))
955
956$(U)dlb_main.exe: $(DLBOBJS)
957	$(LINK) $(LFLAGS) -o$@ $(DLBOBJS)
958
959$(O)dlb_main.o: $(U)dlb_main.c $(INCL)/config.h $(DLB_H)
960	$(CC) $(cflags) -o$@ $(U)dlb_main.c
961
962#==========================================
963# Game Dependencies
964#==========================================
965
966# sys/share
967$(O)main.o:	 $(HACK_H) $(DLB_H) $(SSHR)/pcmain.c
968	$(CC) $(cflags) -o$@ $(SSHR)/pcmain.c
969
970$(O)tty.o:	 $(HACK_H) $(INCL)/wintty.h $(SSHR)/pctty.c
971	$(CC) $(cflags) -o$@ $(SSHR)/pctty.c
972
973$(O)unix.o:	 $(HACK_H) $(SSHR)/pcunix.c
974	$(CC) $(cflags) -o$@ $(SSHR)/pcunix.c
975
976$(O)sys.o : $(HACK_H) $(SSHR)/pcsys.c
977	$(CC) $(cflags) -o$@ $(SSHR)/pcsys.c
978
979# sys/msdos
980$(O)msdos.o : $(HACK_H)  $(MSYS)/msdos.c
981#	$(CC) $(cflags) -o$@ $(MSYS)/msdos.c
982
983$(O)pckeys.o : $(HACK_H)  $(MSYS)/pckeys.c
984#	$(CC) $(cflags) -o$@ $(MSYS)/pckeys.c
985
986$(O)pctiles.o : $(HACK_H)  $(MSYS)/pctiles.c $(MSYS)/portio.h
987	$(CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(MSYS)/pctiles.c
988
989$(O)sound.o : $(HACK_H)  $(MSYS)/sound.c $(MSYS)/portio.h
990#	$(CC) $(cflags) -o$@ $(MSYS)/sound.c
991
992$(O)video.o : $(HACK_H)  $(MSYS)/pcvideo.h $(MSYS)/portio.h $(MSYS)/video.c
993#	$(CC) $(cflags) -o$@ -I$(MSYS) $(MSYS)/video.c
994
995$(O)vidvga.o : $(HACK_H)  $(MSYS)/pcvideo.h $(MSYS)/portio.h $(TILE_H) $(MSYS)/vidvga.c
996	$(CC) $(cflags) -I$(MSYS) -I$(WSHR) -o$@ $(MSYS)/vidvga.c
997
998$(O)vidtxt.o : $(HACK_H)  $(MSYS)/pcvideo.h $(MSYS)/portio.h $(TILE_H) $(MSYS)/vidtxt.c
999#	$(CC) $(cflags) -o$@ -I$(MSYS) $(MSYS)/vidtxt.c
1000
1001$(O)stubvid.o : $(HACK_H) $(MSYS)/pcvideo.h $(MSYS)/video.c
1002	$(CC) $(cflags) -I$(MSYS) -DSTUBVIDEO -o$@ $(MSYS)/video.c
1003
1004
1005# src dependencies
1006
1007#
1008# The rest are stolen from sys/unix/Makefile.src,
1009# with the following changes:
1010#  o -c (which is included in cflags) substituted with -o$@ ,
1011#  o an explicit build instruction for dlb.o because it requires
1012#    a .h file in ../sys/msdos.
1013#  o the PATCHLEV_H macro is substitued for $(INCL)/patchlevel.h
1014#    to work around a long filename issue.
1015#  o $(CFLAGS) changed to $(cflags)
1016# Other than that, these dependencies are untouched.
1017# That means that there is some irrelevant stuff
1018# in here, but maintenance should be easier.
1019#
1020$(O)tos.o: ../sys/atari/tos.c $(HACK_H) $(INCL)/tcap.h
1021	$(CC) $(cflags) -o$@ ../sys/atari/tos.c
1022$(O)pcmain.o: ../sys/share/pcmain.c $(HACK_H) $(INCL)/dlb.h \
1023		#$(INCL)/win32api.h
1024	$(CC) $(cflags) -o$@ ../sys/share/pcmain.c
1025$(O)pcsys.o: ../sys/share/pcsys.c $(HACK_H)
1026	$(CC) $(cflags) -o$@ ../sys/share/pcsys.c
1027$(O)pctty.o: ../sys/share/pctty.c $(HACK_H)
1028	$(CC) $(cflags) -o$@ ../sys/share/pctty.c
1029$(O)pcunix.o: ../sys/share/pcunix.c $(HACK_H)
1030	$(CC) $(cflags) -o$@ ../sys/share/pcunix.c
1031$(O)random.o: ../sys/share/random.c $(HACK_H)
1032	$(CC) $(cflags) -o$@ ../sys/share/random.c
1033$(O)ioctl.o: ../sys/share/ioctl.c $(HACK_H) $(INCL)/tcap.h
1034	$(CC) $(cflags) -o$@ ../sys/share/ioctl.c
1035$(O)unixtty.o: ../sys/share/unixtty.c $(HACK_H)
1036	$(CC) $(cflags) -o$@ ../sys/share/unixtty.c
1037$(O)unixmain.o: ../sys/unix/unixmain.c $(HACK_H) $(INCL)/dlb.h
1038	$(CC) $(cflags) -o$@ ../sys/unix/unixmain.c
1039$(O)unixunix.o: ../sys/unix/unixunix.c $(HACK_H)
1040	$(CC) $(cflags) -o$@ ../sys/unix/unixunix.c
1041$(O)unixres.o: ../sys/unix/unixres.c $(CONFIG_H)
1042	$(CC) $(cflags) -o$@ ../sys/unix/unixres.c
1043$(O)bemain.o: ../sys/be/bemain.c $(HACK_H) $(INCL)/dlb.h
1044	$(CC) $(cflags) -o$@ ../sys/be/bemain.c
1045$(O)getline.o: ../win/tty/getline.c $(HACK_H) $(INCL)/func_tab.h
1046	$(CC) $(cflags) -o$@ ../win/tty/getline.c
1047$(O)termcap.o: ../win/tty/termcap.c $(HACK_H) $(INCL)/tcap.h
1048	$(CC) $(cflags) -o$@ ../win/tty/termcap.c
1049$(O)topl.o: ../win/tty/topl.c $(HACK_H) $(INCL)/tcap.h
1050	$(CC) $(cflags) -o$@ ../win/tty/topl.c
1051$(O)wintty.o: ../win/tty/wintty.c $(HACK_H) $(INCL)/dlb.h \
1052		$(PATCHLEV_H) $(INCL)/tcap.h
1053	$(CC) $(cflags) -o$@ ../win/tty/wintty.c
1054$(O)Window.o: ../win/X11/Window.c $(INCL)/xwindowp.h $(INCL)/xwindow.h \
1055		$(CONFIG_H)
1056	$(CC) $(cflags) -o$@ ../win/X11/Window.c
1057$(O)dialogs.o: ../win/X11/dialogs.c $(CONFIG_H)
1058	$(CC) $(cflags) -o$@ ../win/X11/dialogs.c
1059$(O)winX.o: ../win/X11/winX.c $(HACK_H) $(INCL)/winX.h $(INCL)/dlb.h \
1060		$(PATCHLEV_H) ../win/X11/nh72icon \
1061		../win/X11/nh56icon ../win/X11/nh32icon
1062	$(CC) $(cflags) -o$@ ../win/X11/winX.c
1063$(O)winmap.o: ../win/X11/winmap.c $(INCL)/xwindow.h $(HACK_H) $(INCL)/dlb.h \
1064		$(INCL)/winX.h $(INCL)/tile2x11.h
1065	$(CC) $(cflags) -o$@ ../win/X11/winmap.c
1066$(O)winmenu.o: ../win/X11/winmenu.c $(HACK_H) $(INCL)/winX.h
1067	$(CC) $(cflags) -o$@ ../win/X11/winmenu.c
1068$(O)winmesg.o: ../win/X11/winmesg.c $(INCL)/xwindow.h $(HACK_H) $(INCL)/winX.h
1069	$(CC) $(cflags) -o$@ ../win/X11/winmesg.c
1070$(O)winmisc.o: ../win/X11/winmisc.c $(HACK_H) $(INCL)/func_tab.h \
1071		$(INCL)/winX.h
1072	$(CC) $(cflags) -o$@ ../win/X11/winmisc.c
1073$(O)winstat.o: ../win/X11/winstat.c $(HACK_H) $(INCL)/winX.h
1074	$(CC) $(cflags) -o$@ ../win/X11/winstat.c
1075$(O)wintext.o: ../win/X11/wintext.c $(HACK_H) $(INCL)/winX.h $(INCL)/xwindow.h
1076	$(CC) $(cflags) -o$@ ../win/X11/wintext.c
1077$(O)winval.o: ../win/X11/winval.c $(HACK_H) $(INCL)/winX.h
1078	$(CC) $(cflags) -o$@ ../win/X11/winval.c
1079$(O)tile.o: tile.c $(HACK_H)
1080$(O)gnaskstr.o: ../win/gnome/gnaskstr.c ../win/gnome/gnaskstr.h \
1081		../win/gnome/gnmain.h
1082	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnaskstr.c
1083$(O)gnbind.o: ../win/gnome/gnbind.c ../win/gnome/gnbind.h ../win/gnome/gnmain.h \
1084		../win/gnome/gnaskstr.h ../win/gnome/gnyesno.h
1085	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnbind.c
1086$(O)gnglyph.o: ../win/gnome/gnglyph.c ../win/gnome/gnglyph.h $(INCL)/tile2x11.h
1087	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnglyph.c
1088$(O)gnmain.o: ../win/gnome/gnmain.c ../win/gnome/gnmain.h ../win/gnome/gnsignal.h \
1089		../win/gnome/gnbind.h ../win/gnome/gnopts.h $(HACK_H) \
1090		$(INCL)/date.h
1091	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnmain.c
1092$(O)gnmap.o: ../win/gnome/gnmap.c ../win/gnome/gnmap.h ../win/gnome/gnglyph.h \
1093		../win/gnome/gnsignal.h $(HACK_H)
1094	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnmap.c
1095$(O)gnmenu.o: ../win/gnome/gnmenu.c ../win/gnome/gnmenu.h ../win/gnome/gnmain.h \
1096		../win/gnome/gnbind.h
1097	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnmenu.c
1098$(O)gnmesg.o: ../win/gnome/gnmesg.c ../win/gnome/gnmesg.h ../win/gnome/gnsignal.h
1099	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnmesg.c
1100$(O)gnopts.o: ../win/gnome/gnopts.c ../win/gnome/gnopts.h ../win/gnome/gnglyph.h \
1101		../win/gnome/gnmain.h ../win/gnome/gnmap.h $(HACK_H)
1102	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnopts.c
1103$(O)gnplayer.o: ../win/gnome/gnplayer.c ../win/gnome/gnplayer.h \
1104		../win/gnome/gnmain.h $(HACK_H)
1105	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnplayer.c
1106$(O)gnsignal.o: ../win/gnome/gnsignal.c ../win/gnome/gnsignal.h \
1107		../win/gnome/gnmain.h
1108	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnsignal.c
1109$(O)gnstatus.o: ../win/gnome/gnstatus.c ../win/gnome/gnstatus.h \
1110		../win/gnome/gnsignal.h ../win/gnome/gn_xpms.h \
1111		../win/gnome/gnomeprv.h
1112	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnstatus.c
1113$(O)gntext.o: ../win/gnome/gntext.c ../win/gnome/gntext.h ../win/gnome/gnmain.h \
1114		../win/gnome/gn_rip.h
1115	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gntext.c
1116$(O)gnworn.o: ../win/gnome/gnworn.c ../win/gnome/gnworn.h ../win/gnome/gnglyph.h \
1117		../win/gnome/gnsignal.h ../win/gnome/gnomeprv.h
1118	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnworn.c
1119$(O)gnyesno.o: ../win/gnome/gnyesno.c ../win/gnome/gnbind.h ../win/gnome/gnyesno.h
1120	$(CC) $(cflags) $(GNOMEINC) -o$@ ../win/gnome/gnyesno.c
1121$(O)wingem.o: ../win/gem/wingem.c $(HACK_H) $(INCL)/func_tab.h $(INCL)/dlb.h \
1122		$(PATCHLEV_H) $(INCL)/wingem.h
1123	$(CC) $(cflags) -o$@ ../win/gem/wingem.c
1124$(O)wingem1.o: ../win/gem/wingem1.c $(INCL)/gem_rsc.h $(INCL)/load_img.h \
1125		$(INCL)/gr_rect.h $(INCL)/wintype.h $(INCL)/wingem.h
1126	$(CC) $(cflags) -o$@ ../win/gem/wingem1.c
1127$(O)load_img.o: ../win/gem/load_img.c $(INCL)/load_img.h
1128	$(CC) $(cflags) -o$@ ../win/gem/load_img.c
1129$(O)gr_rect.o: ../win/gem/gr_rect.c $(INCL)/gr_rect.h
1130	$(CC) $(cflags) -o$@ ../win/gem/gr_rect.c
1131$(O)tile.o: tile.c $(HACK_H)
1132$(O)qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) $(INCL)/func_tab.h \
1133		$(INCL)/dlb.h $(PATCHLEV_H) $(INCL)/tile2x11.h \
1134		$(INCL)/qt_win.h $(INCL)/qt_clust.h $(INCL)/qt_kde0.h \
1135		$(INCL)/qt_xpms.h qt_win.moc qt_kde0.moc qttableview.moc
1136	$(CXX) $(CXXFLAGS) -o$@ ../win/Qt/qt_win.cpp
1137$(O)qt_clust.o: ../win/Qt/qt_clust.cpp $(INCL)/qt_clust.h
1138	$(CXX) $(CXXFLAGS) -o$@ ../win/Qt/qt_clust.cpp
1139$(O)qttableview.o: ../win/Qt/qttableview.cpp $(INCL)/qttableview.h
1140	$(CXX) $(CXXFLAGS) -o$@ ../win/Qt/qttableview.cpp
1141$(O)monstr.o: monstr.c $(CONFIG_H)
1142$(O)vis_tab.o: vis_tab.c $(CONFIG_H) $(INCL)/vis_tab.h
1143$(O)allmain.o: allmain.c $(HACK_H)
1144$(O)alloc.o: alloc.c $(CONFIG_H)
1145$(O)apply.o: apply.c $(HACK_H) $(INCL)/edog.h
1146$(O)artifact.o: artifact.c $(HACK_H) $(INCL)/artifact.h $(INCL)/artilist.h
1147$(O)attrib.o: attrib.c $(HACK_H)
1148$(O)ball.o: ball.c $(HACK_H)
1149$(O)bones.o: bones.c $(HACK_H) $(INCL)/lev.h
1150$(O)botl.o: botl.c $(HACK_H)
1151$(O)cmd.o: cmd.c $(HACK_H) $(INCL)/func_tab.h
1152$(O)dbridge.o: dbridge.c $(HACK_H)
1153$(O)decl.o: decl.c $(HACK_H)
1154$(O)detect.o: detect.c $(HACK_H) $(INCL)/artifact.h
1155$(O)dig.o: dig.c $(HACK_H) $(INCL)/edog.h
1156$(O)display.o: display.c $(HACK_H)
1157$(O)dlb.o: dlb.c $(CONFIG_H) $(INCL)/dlb.h
1158	$(CC) $(cflags) -I../sys/msdos -o$@ dlb.c
1159$(O)do.o: do.c $(HACK_H) $(INCL)/lev.h
1160$(O)do_name.o: do_name.c $(HACK_H)
1161$(O)do_wear.o: do_wear.c $(HACK_H)
1162$(O)dog.o: dog.c $(HACK_H) $(INCL)/edog.h
1163$(O)dogmove.o: dogmove.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/edog.h
1164$(O)dokick.o: dokick.c $(HACK_H) $(INCL)/eshk.h
1165$(O)dothrow.o: dothrow.c $(HACK_H)
1166$(O)drawing.o: drawing.c $(HACK_H) $(INCL)/tcap.h
1167$(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)/dgn_file.h $(INCL)/dlb.h
1168$(O)eat.o: eat.c $(HACK_H)
1169$(O)end.o: end.c $(HACK_H) $(INCL)/eshk.h $(INCL)/dlb.h
1170$(O)engrave.o: engrave.c $(HACK_H) $(INCL)/lev.h
1171$(O)exper.o: exper.c $(HACK_H)
1172$(O)explode.o: explode.c $(HACK_H)
1173$(O)extralev.o: extralev.c $(HACK_H)
1174$(O)files.o: files.c $(HACK_H) $(INCL)/dlb.h
1175$(O)fountain.o: fountain.c $(HACK_H)
1176$(O)hack.o: hack.c $(HACK_H)
1177$(O)hacklib.o: hacklib.c $(HACK_H)
1178$(O)invent.o: invent.c $(HACK_H)
1179$(O)light.o: light.c $(HACK_H) $(INCL)/lev.h
1180$(O)lock.o: lock.c $(HACK_H)
1181$(O)mail.o: mail.c $(HACK_H) $(INCL)/mail.h
1182$(O)makemon.o: makemon.c $(HACK_H) $(INCL)/epri.h $(INCL)/emin.h \
1183		$(INCL)/edog.h
1184$(O)mapglyph.o: mapglyph.c $(HACK_H)
1185$(O)mcastu.o: mcastu.c $(HACK_H)
1186$(O)mhitm.o: mhitm.c $(HACK_H) $(INCL)/artifact.h $(INCL)/edog.h
1187$(O)mhitu.o: mhitu.c $(HACK_H) $(INCL)/artifact.h $(INCL)/edog.h
1188$(O)minion.o: minion.c $(HACK_H) $(INCL)/emin.h $(INCL)/epri.h
1189$(O)mklev.o: mklev.c $(HACK_H)
1190$(O)mkmap.o: mkmap.c $(HACK_H) $(INCL)/sp_lev.h
1191$(O)mkmaze.o: mkmaze.c $(HACK_H) $(INCL)/sp_lev.h $(INCL)/lev.h
1192$(O)mkobj.o: mkobj.c $(HACK_H)
1193$(O)mkroom.o: mkroom.c $(HACK_H)
1194$(O)mon.o: mon.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/edog.h
1195$(O)mondata.o: mondata.c $(HACK_H) $(INCL)/eshk.h $(INCL)/epri.h
1196$(O)monmove.o: monmove.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/artifact.h \
1197		$(INCL)/epri.h
1198$(O)monst.o: monst.c $(CONFIG_H) $(INCL)/permonst.h $(INCL)/align.h \
1199		$(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/monsym.h \
1200		$(INCL)/dungeon.h $(INCL)/eshk.h $(INCL)/vault.h \
1201		$(INCL)/epri.h $(INCL)/color.h
1202$(O)mplayer.o: mplayer.c $(HACK_H)
1203$(O)mthrowu.o: mthrowu.c $(HACK_H)
1204$(O)muse.o: muse.c $(HACK_H) $(INCL)/edog.h
1205$(O)music.o: music.c $(HACK_H) #interp.c
1206$(O)o_init.o: o_init.c $(HACK_H) $(INCL)/lev.h
1207$(O)objects.o: objects.c $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \
1208		$(INCL)/prop.h $(INCL)/skills.h $(INCL)/color.h
1209$(O)objnam.o: objnam.c $(HACK_H)
1210$(O)options.o: options.c $(CONFIG_H) $(INCL)/objclass.h $(INCL)/flag.h \
1211		$(HACK_H) $(INCL)/tcap.h
1212$(O)pager.o: pager.c $(HACK_H) $(INCL)/dlb.h
1213$(O)pickup.o: pickup.c $(HACK_H)
1214$(O)pline.o: pline.c $(HACK_H) $(INCL)/epri.h $(INCL)/edog.h
1215$(O)polyself.o: polyself.c $(HACK_H)
1216$(O)potion.o: potion.c $(HACK_H)
1217$(O)pray.o: pray.c $(HACK_H) $(INCL)/epri.h
1218$(O)priest.o: priest.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/eshk.h \
1219		$(INCL)/epri.h $(INCL)/emin.h
1220$(O)quest.o: quest.c $(HACK_H) $(INCL)/qtext.h
1221$(O)questpgr.o: questpgr.c $(HACK_H) $(INCL)/dlb.h $(INCL)/qtext.h
1222$(O)read.o: read.c $(HACK_H)
1223$(O)rect.o: rect.c $(HACK_H)
1224$(O)region.o: region.c $(HACK_H) $(INCL)/lev.h
1225$(O)restore.o: restore.c $(HACK_H) $(INCL)/lev.h $(INCL)/tcap.h
1226$(O)rip.o: rip.c $(HACK_H)
1227$(O)rnd.o: rnd.c $(HACK_H)
1228$(O)role.o: role.c $(HACK_H)
1229$(O)rumors.o: rumors.c $(HACK_H) $(INCL)/lev.h $(INCL)/dlb.h
1230$(O)save.o: save.c $(HACK_H) $(INCL)/lev.h
1231$(O)shk.o: shk.c $(HACK_H) $(INCL)/eshk.h
1232$(O)shknam.o: shknam.c $(HACK_H) $(INCL)/eshk.h
1233$(O)sit.o: sit.c $(HACK_H) $(INCL)/artifact.h
1234$(O)sounds.o: sounds.c $(HACK_H) $(INCL)/edog.h
1235$(O)sp_lev.o: sp_lev.c $(HACK_H) $(INCL)/dlb.h $(INCL)/sp_lev.h
1236$(O)spell.o: spell.c $(HACK_H)
1237$(O)steal.o: steal.c $(HACK_H)
1238$(O)steed.o: steed.c $(HACK_H)
1239$(O)teleport.o: teleport.c $(HACK_H)
1240$(O)timeout.o: timeout.c $(HACK_H) $(INCL)/lev.h
1241$(O)topten.o: topten.c $(HACK_H) $(INCL)/dlb.h $(PATCHLEV_H)
1242$(O)track.o: track.c $(HACK_H)
1243$(O)trap.o: trap.c $(HACK_H)
1244$(O)u_init.o: u_init.c $(HACK_H)
1245$(O)uhitm.o: uhitm.c $(HACK_H)
1246$(O)vault.o: vault.c $(HACK_H) $(INCL)/vault.h
1247$(O)version.o: version.c $(HACK_H) $(INCL)/date.h $(PATCHLEV_H)
1248$(O)vision.o: vision.c $(HACK_H) $(INCL)/vis_tab.h
1249$(O)weapon.o: weapon.c $(HACK_H)
1250$(O)were.o: were.c $(HACK_H)
1251$(O)wield.o: wield.c $(HACK_H)
1252$(O)windows.o: windows.c $(HACK_H) $(INCL)/wingem.h $(INCL)/winGnome.h
1253$(O)wizard.o: wizard.c $(HACK_H) $(INCL)/qtext.h $(INCL)/epri.h
1254$(O)worm.o: worm.c $(HACK_H) $(INCL)/lev.h
1255$(O)worn.o: worn.c $(HACK_H)
1256$(O)write.o: write.c $(HACK_H)
1257$(O)zap.o: zap.c $(HACK_H)
1258
1259# end of file
1260
1261