Mercurial > hg > early-roguelike
annotate arogue5/Makefile.in @ 111:7f8f43943b1f
Fix some terribly depressing corruption during restore.
In rogue5/state.c, rs_read_daemons() zeroes out the argument and delay
if the daemon slot is empty. Unfortunately that code ended up on the
wrong side of the brace that closes the for loop, so instead of running
after each daemon, it got run once after the loop exited, when the
index was of course out of bounds.
This tended to manifest, when compiled with -O2, by overwriting hw and
setting it to NULL. When inventory() next ran, hw would be passed to
wgetch(), which returns ERR when it gets a NULL argument. This made
md_readchar() think something was wrong and autosave the game.
Upon investigation, rogue3 was found to commit the same mistake.
rogue4 and srogue don't zero the data. arogue5 already does it
properly.
Someday I am going to run all this through Valgrind. Someday when I
am a kinder person who will not be driven to invoke hordes of trolls
and centaurs upon the original authors.
author | John "Elwin" Edwards |
---|---|
date | Wed, 08 Jan 2014 16:44:16 -0500 |
parents | fbc75509f4cd |
children | 97f8fdf9595c |
rev | line source |
---|---|
99 | 1 # |
2 # Makefile for rogue | |
3 # | |
4 # Advanced Rogue | |
5 # Copyright (C) 1984, 1985 Michael Morgan, Ken Dalka and AT&T | |
6 # All rights reserved. | |
7 # | |
8 # Based on "Rogue: Exploring the Dungeons of Doom" | |
9 # Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman | |
10 # All rights reserved. | |
11 # | |
12 # See the file LICENSE.TXT for full copyright and licensing information. | |
13 # | |
14 | |
15 DISTNAME=@PACKAGE_TARNAME@@PACKAGE_VERSION@ | |
16 PACKAGE_TARNAME=@PACKAGE_TARNAME@-@PACKAGE_VERSION@ | |
17 PROGRAM=@PROGRAM@ | |
18 | |
19 SCOREFILE=@SCOREFILE@ | |
20 LOGFILE=@LOGFILE@ | |
21 SAVEDIR=@SAVEDIR@ | |
22 GROUPOWNER=@GROUPOWNER@ | |
23 | |
24 DESTDIR= | |
25 prefix=@prefix@ | |
26 exec_prefix=@exec_prefix@ | |
27 datarootdir=@datarootdir@ | |
28 bindir=@bindir@ | |
29 docdir=@docdir@ | |
30 | |
31 O=o | |
32 | |
104
fbc75509f4cd
Add config.h to the list of headers in the Makefiles.
John "Elwin" Edwards
parents:
99
diff
changeset
|
33 HDRS = rogue.h mach_dep.h network.h config.h |
99 | 34 OBJS1 = chase.$(O) command.$(O) daemon.$(O) daemons.$(O) encumb.$(O) \ |
35 fight.$(O) init.$(O) io.$(O) list.$(O) main.$(O) maze.$(O) mdport.$(O)\ | |
36 misc.$(O) monsters.$(O) move.$(O) new_level.$(O) options.$(O) \ | |
37 outside.$(O) | |
38 OBJS2 = pack.$(O) passages.$(O) player.$(O) potions.$(O) rings.$(O) rip.$(O) \ | |
39 rogue.$(O) rooms.$(O) save.$(O) scrolls.$(O) state.$(O) sticks.$(O) \ | |
40 things.$(O) trader.$(O) util.$(O) vers.$(O) weapons.$(O) wear.$(O) \ | |
41 wizard.$(O) xcrypt.$(O) | |
42 OBJS = $(OBJS1) $(OBJS2) | |
43 CFILES= \ | |
44 vers.c chase.c command.c daemon.c daemons.c encumb.c \ | |
45 fight.c init.c io.c list.c main.c maze.c mdport.c misc.c monsters.c \ | |
46 move.c new_level.c options.c outside.c pack.c passages.c player.c \ | |
47 potions.c rings.c rip.c rogue.c \ | |
48 rooms.c save.c scrolls.c state.c sticks.c things.c trader.c util.c \ | |
49 weapons.c wear.c wizard.c xcrypt.c | |
50 | |
51 MISC= Makefile LICENSE.TXT arogue58.sln arogue58.vcproj | |
52 DOCS= arogue58.doc arogue58.html | |
53 | |
54 CC = gcc | |
55 CPPFLAGS =@DEFS@ | |
56 CFLAGS= -g | |
57 CRLIB = -lcurses | |
58 RM = rm -f | |
59 TAR = tar | |
60 INSTALL=@INSTALL@ | |
61 .SUFFIXES: .obj | |
62 | |
63 .c.obj: | |
64 $(CC) $(CFLAGS) /c $*.c | |
65 | |
66 $(PROGRAM): $(OBJS) | |
67 $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(CRLIB) -o $@ | |
68 | |
69 tags: $(HDRS) $(CFILES) | |
70 ctags -u $? | |
71 ed - tags < :ctfix | |
72 sort tags -o tags | |
73 | |
74 lint: | |
75 lint -hxbc $(CFILES) $(CRLIB) > linterrs | |
76 | |
77 install: $(PROGRAM) | |
78 -touch test | |
79 -if test ! -f $(DESTDIR)$(SCOREFILE) ; \ | |
80 then $(INSTALL) -m 0664 test $(DESTDIR)$(SCOREFILE) ; fi | |
81 -if test "x$(LOGFILE)" != "x" && test ! -f $(DESTDIR)$(LOGFILE) ; then \ | |
82 $(INSTALL) -m 0664 test $(DESTDIR)$(LOGFILE) ; fi | |
83 -if test "x$(SAVEDIR)" != "x" && test ! -d $(DESTDIR)$(SAVEDIR) ; then \ | |
84 mkdir -p $(DESTDIR)$(SAVEDIR) ; fi | |
85 -$(INSTALL) -m 0755 $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) | |
86 -if test "x$(GROUPOWNER)" != "x" ; then \ | |
87 chgrp $(GROUPOWNER) $(DESTDIR)$(SCOREFILE) ; \ | |
88 chgrp $(GROUPOWNER) $(DESTDIR)$(LOGFILE) ; \ | |
89 chgrp $(GROUPOWNER) $(DESTDIR)$(bindir)/$(PROGRAM) ; \ | |
90 chgrp $(GROUPOWNER) $(DESTDIR)$(SAVEDIR) ; \ | |
91 chmod 02755 $(DESTDIR)$(bindir)/$(PROGRAM) ; \ | |
92 chmod 0464 $(DESTDIR)$(SCOREFILE) ; \ | |
93 chmod 0464 $(DESTDIR)$(LOGFILE) ; \ | |
94 chmod 0775 $(DESTDIR)$(SAVEDIR) ; \ | |
95 fi | |