forked from richelbilderbeek/Zork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MAKEFILE.MSC
162 lines (136 loc) · 4.44 KB
/
MAKEFILE.MSC
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
# Makefile for dungeon
# By Jonathan Mark <uunet!microsoft!jonm>
MSC = 1 # this is the Microsoft C version (for DOS)
!if $(MSC)
O = obj # suffix for object files
BINDIR = . # Where to install the program
LIBDIR = . # Where to install the data file
TARGET = dungeon.exe
!else
O = o # suffix for object files
BINDIR = /usr/games # Where to install the program
LIBDIR = /usr/games/lib # Where to install the data file
TARGET = dungeon
!endif
# The dungeon program provides a ``more'' facility which tries to
# figure out how many rows the terminal has. Several mechanisms are
# supported for determining this; the most common one has been left
# uncommented. If you have trouble, especially when linking, you may
# have to select a different option.
# more option 1: use the termcap routines. On some systems the LIBS
# variable may need to be set to -lcurses. On some it may need to
# be /usr/lib/termcap.o. These options are commented out below.
# LIBS = -ltermcap
# TERMFLAG =
# LIBS = -lcurses
# LIBS = /usr/lib/termcap.o
# more option 2: use the terminfo routines. On some systems the LIBS
# variable needs to be -lcursesX, but probably all such systems support
# the termcap routines (option 1) anyhow.
# LIBS = -lcurses
# TERMFLAG = -DMORE_TERMINFO
# more option 3: assume all terminals have 24 rows
!if $(MSC)
LIBS =
TERMFLAG = -DMORE_24
!endif
# more option 4: don't use the more facility at all
# LIBS =
# TERMFLAG = -DMORE_NONE
# End of more options
# Uncomment the following line if you want to have access to the game
# debugging tool. This is invoked by typing "gdt". It is not much
# use except for debugging.
# GDTFLAG = -DALLOW_GDT
# Compilation flags
!if $(MSC)
# MSC-specific compile options:
# -AM "medium" memory model (code > 64k, data < 64k)
# -Za disables Microsoft C extensions. This causes the compiler to
# define __STDC__, which in turn causes BINREAD to be defined
# as "rb", etc. (This seems odd -- is the "b" suffix in
# ANSI C?) [Yes, it is]
CFLAGS = -O -AM -Za
!else
CFLAGS = -O
!endif
##################################################################
# Source files
CSRC = actors.c ballop.c clockr.c demons.c dgame.c dinit.c dmain.c\
dso1.c dso2.c dso3.c dso4.c dso5.c dso6.c dso7.c dsub.c dverb1.c\
dverb2.c gdt.c lightp.c local.c nobjs.c np.c np1.c np2.c np3.c\
nrooms.c objcts.c rooms.c sobjs.c supp.c sverbs.c verbs.c villns.c
# Object files
OBJS1 = actors.$O ballop.$O clockr.$O demons.$O dgame.$O dinit.$O dmain.$O
OBJS2 = dso1.$O dso2.$O dso3.$O dso4.$O dso5.$O dso6.$O dso7.$O dsub.$O
OBJS3 = dverb1.$O dverb2.$O gdt.$O lightp.$O local.$O nobjs.$O np.$O np1.$O
OBJS4 = np2.$O np3.$O nrooms.$O objcts.$O rooms.$O sobjs.$O supp.$O sverbs.$O
OBJS5 = verbs.$O villns.$O
OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5)
!if $(MSC)
# If we try to link as one $(CC) command, the command line is too long for
# DOS to accept. We therefore have to use the ugly "response file" syntax.
#
$(TARGET): $(OBJS) dtextc.dat
link @<<
$(OBJS1)+
$(OBJS2)+
$(OBJS3)+
$(OBJS4)+
$(OBJS5)
$(TARGET)
/map /codeview
$(LIBS)
<<
!else
$(TARGET): $(OBJS) dtextc.dat
$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
!endif
install: $(TARGET) dtextc.dat
cp $(TARGET) $(BINDIR)
cp dtextc.dat $(LIBDIR)
clean:
rm -f $(OBJS) $(TARGET) core dsave.dat *~
dtextc.dat:
cat dtextc.uu1 dtextc.uu2 dtextc.uu3 dtextc.uu4 >dtextc.uu
uudecode dtextc.uu
rm -f dtextc.uu
dinit.$O: dinit.c funcs.h vars.h
$(CC) $(CFLAGS) $(GDTFLAG) -DTEXTFILE=\"$(LIBDIR)/dtextc.dat\" -c dinit.c
dgame.$O: dgame.c funcs.h vars.h
$(CC) $(CFLAGS) $(GDTFLAG) -c dgame.c
gdt.$O: gdt.c funcs.h vars.h
$(CC) $(CFLAGS) $(GDTFLAG) -c gdt.c
local.$O: local.c funcs.h vars.h
$(CC) $(CFLAGS) $(GDTFLAG) -c local.c
supp.$O: supp.c funcs.h vars.h
$(CC) $(CFLAGS) $(TERMFLAG) -c supp.c
actors.$O: funcs.h vars.h
ballop.$O: funcs.h vars.h
clockr.$O: funcs.h vars.h
demons.$O: funcs.h vars.h
dmain.$O: funcs.h vars.h
dso1.$O: funcs.h vars.h
dso2.$O: funcs.h vars.h
dso3.$O: funcs.h vars.h
dso4.$O: funcs.h vars.h
dso5.$O: funcs.h vars.h
dso6.$O: funcs.h vars.h
dso7.$O: funcs.h vars.h
dsub.$O: funcs.h vars.h
dverb1.$O: funcs.h vars.h
dverb2.$O: funcs.h vars.h
lightp.$O: funcs.h vars.h
nobjs.$O: funcs.h vars.h
np.$O: funcs.h vars.h
np1.$O: funcs.h vars.h parse.h
np2.$O: funcs.h vars.h parse.h
np3.$O: funcs.h vars.h parse.h
nrooms.$O: funcs.h vars.h
objcts.$O: funcs.h vars.h
rooms.$O: funcs.h vars.h
sobjs.$O: funcs.h vars.h
sverbs.$O: funcs.h vars.h
verbs.$O: funcs.h vars.h
villns.$O: funcs.h vars.h