OSDN Git Service

Initial revision
[hengband/hengband.git] / src / makefile.std
1 # CVS: Last edit by $Author$ on $Date$
2 # File: Makefile
3
4 # This is not a very "nice" Makefile, but it usually works.
5
6 #
7 # Note that you may have to make modifications below according
8 # to your machine, available libraries, compilation options,
9 # and your "visual module" of choice.  This Makefile is intended
10 # for use with Unix machines running X11, Curses, Ncurses, or Vt100,
11 # or possibly for "Atari" or "Amiga" computers with "Curses" ports,
12 # see below for more information.
13 #
14 # Note that "main-mac.c", the visual module for the Macintosh,
15 # must be compiled in a special way, see elsewhere.
16 #
17 # Note that "main-win.c", the visual module for Windows,
18 # must be compiled in a special way, see elsewhere.
19 #
20 # Note that "main-ibm.c", "main-emx.c", and "main-286.c",
21 # the visual modules for various types of IBM-PC computers,
22 # must be compiled with special Makefiles, see elsewhere.
23 #
24 # Note that "main-lsl.c", the visual module for ???,
25 # must be compiled with "Makefile.lsl", see elsewhere.
26 #
27 # Note that "main-acn.c", the visual module for Risc Acorn,
28 # must be compiled with "Makefile.acn", see elsewhere.
29 #
30 # Note that "Makefile.w31" and "Makefile.wat" are slight variations
31 # on "Makefile.win" and "Makefile.ibm", respectively, which allow
32 # the use of the "main-win.c" and "main-ibm.c" files, respectively,
33 # with special compilers.
34 #
35 # If you are able to construct "main-xxx.c" and/or "Makefile.xxx"
36 # files for a currently unsupported system, please send them to me
37 # (benh@phial.com) for inclusion in future versions.
38 #
39 # This Makefile comes with "default" dependancies that may be obsolete.
40 #
41
42
43 #
44 # The "source" and "object" files.
45 #
46
47 SRCS = \
48         z-util.c z-virt.c z-form.c z-rand.c z-term.c \
49         variable.c tables.c util.c cave.c \
50         object1.c object2.c monster1.c monster2.c \
51         xtra1.c xtra2.c spells1.c spells2.c \
52         melee1.c melee2.c save.c files.c \
53         cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c \
54         store.c birth.c load.c \
55         wizard1.c wizard2.c grid.c streams.c rooms.c \
56         generate.c dungeon.c init1.c init2.c \
57         effects.c racial.c inet.c report.c\
58         artifact.c mutation.c flavor.c spells3.c \
59         mspells1.c mspells2.c scores.c mind.c mane.c hissatsu.c \
60         bldg.c obj_kind.c wild.c avatar.c japanese.c mspells3.c \
61         main-cap.c main-gcu.c main-x11.c main-xaw.c main.c chuukei.c
62
63 OBJS = \
64         z-util.o z-virt.o z-form.o z-rand.o z-term.o \
65         variable.o tables.o util.o cave.o \
66         object1.o object2.o monster1.o monster2.o \
67         xtra1.o xtra2.o spells1.o spells2.o \
68         melee1.o melee2.o save.o files.o \
69         cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \
70         store.o birth.o load.o \
71         wizard1.o wizard2.o grid.o streams.o rooms.o \
72         generate.o dungeon.o init1.o init2.o \
73         effects.o racial.o inet.o report.o \
74         artifact.o mutation.o flavor.o spells3.o \
75         mspells1.o mspells2.o scores.o mind.o mane.o hissatsu.o \
76         bldg.o obj_kind.o wild.o avatar.o japanese.o mspells3.o \
77         main-cap.o main-gcu.o main-x11.o main-xaw.o main.o chuukei.o
78
79
80
81 ##
82 ## Following are some "system" definitions
83 ##
84 ## No changes are needed to compile a version that will run on both
85 ## X11 and Curses, in debugging mode, with maximal warnings, on many
86 ## normal Unix machines of the Sun OS variety (non-solaris).
87 ##
88 ## To use an "alternative" definition, simply "modify" (or "replace")
89 ## the definition below with one that you like.  For example, you can
90 ## change the compiler to "cc", or remove the "debugging" options, or
91 ## remove the X11 or Curses support, etc, as desired.
92 ##
93 ## See also "z-config.h" and "h-config.h" for important information.
94 ##
95 ## Some "examples" are given below, they can be used by simply
96 ## removing the FIRST column of "#" signs from the "block" of lines
97 ## you wish to use, and commenting out "standard" block below.
98 ##
99 ## This is not intended to be a "good" Makefile, just a "simple" one.
100 ##
101
102
103 #
104 # This is my compiler of choice, it seems to work most everywhere
105 #
106 CC = gcc
107
108
109 ###################################################################
110 #
111 # Options for Japanese version (comment out for English version)
112
113 JP_OPT= -D"JP" -D"EUC" -DDEFAULT_LOCALE="\"ja_JP.eucJP\""
114
115 ###################################################################
116
117
118 #
119 # Standard version (see main-x11.c and main-gcu.c)
120 #
121 # This version supports both "X11" and "curses" in a single executable.
122 #
123 # You may have to add various X11 include/library directories to the
124 # "CFLAGS", if your machine places files in a weird location.
125 #
126 # You may be able to remove "-ltermcap" on some machines (ex: Solaris).
127 #
128 # You may have to replace "-lcurses" with "-lncurses" to use the
129 # "new curses" library instead of the "old curses" library, and
130 # you may have to add "-l/usr/include/ncurses" to the "CFLAGS".
131 #
132 # See "main-gcu.c" and "z-config.h" for some optional "curses" defines,
133 # including "USE_GETCH" and "USE_CURS_SET".  Note that "z-config.h" will
134 # attempt to "guess" at many of these flags based on your system.
135 #
136 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU"
137 #LIBS = -lX11 -lcurses -ltermcap
138
139 CFLAGS = -Wall -O2  -fno-strength-reduce -m486 -pipe -g -D"USE_X11" $(JP_OPT) -D"USE_GCU" -I/usr/X11R6/include
140 LIBS = -L/usr/X11R6/lib -lX11 -lncurses
141
142
143 ##
144 ## Variation -- Compile for Linux
145 ##
146 #CFLAGS = -Wall -O2 -m486 -pipe -g -D"USE_XAW" -D"USE_GCU"
147 #LIBS = -L/usr/X11R6/lib -lXaw -lXext -lSM -lICE -lXmu -lXt \
148 #       -lX11 -lcurses
149
150
151 ##
152 ## Variation -- Only support "main-x11.c" (not "main-gcu.c")
153 ##
154 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11"
155 #LIBS = -lX11
156
157
158 ##
159 ## Variation -- Only support "main-gcu.c" (not "main-x11.c")
160 ##
161 #CFLAGS = -Wall -O1 -pipe -g -D"USE_GCU"
162 #LIBS = -lcurses -ltermcap
163
164
165 ##
166 ## Variation -- Use "main-xaw.c" instead of "main-x11.c"
167 ##
168 #CFLAGS = -Wall -O1 -pipe -g -D"USE_XAW" -D"USE_GCU"
169 #LIBS = -lXaw -lXmu -lXt -lX11 -lcurses -ltermcap
170
171
172 ##
173 ## Variation -- Use "main-cap.c" instead of "main-gcu.c"
174 ##
175 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_CAP"
176 #LIBS = -lX11 -ltermcap
177
178
179 ##
180 ## Variation -- Only work on simple vt100 terminals
181 ##
182 #CFLAGS = -Wall -O1 -pipe -g -D"USE_CAP" -D"USE_HARDCODE"
183
184
185 ##
186 ## Variation -- this might work for Linux 1.1.93 using ncurses-1.8.7.
187 ##
188 #CFLAGS = -I/usr/X11R6/include -I/usr/include/ncurses \
189 #         -Wall -O2 -fomit-frame-pointer -m486 \
190 #         -D"USE_X11" -D"USE_GCU"
191 #LIBS = -L/usr/X11R6/lib -lX11 -lncurses -ltermcap
192
193 ##
194 ## Variation -- this might work better than the suggestion above
195 ##
196 #CFLAGS = -I/usr/include/ncurses \
197 #         -Wall -O2 -fomit-frame-pointer \
198 #         -D"USE_X11" -D"USE_GCU" \
199 #         -D"USE_TPOSIX" -D"USE_CURS_SET"
200 #LIBS = -lX11 -lncurses
201 #LDFLAGS = -s
202
203
204 ##
205 ## Variation -- compile for Solaris
206 ##
207 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -D"SOLARIS"
208 #LIBS = -lX11 -lsocket -lcurses
209
210
211 ##
212 ## Variation -- compile for SGI Indigo runnig Irix
213 ##
214 #CFLAGS = -Wall -O2  -fno-strength-reduce -g -D"USE_X11" $(JP_OPT) -D"USE_GCU" -I/usr/X11R6/include
215 #LIBS = -L/usr/X11R6/lib -lX11 -lncurses -ltermcap -lsun
216
217
218
219 ##
220 ## Variation -- compile for Dec ALPHA OSF/1 v2.0
221 ##
222 #CC     = cc
223 ##CFLAGS = -std -O -g3 -Olimit 4000 -D"USE_X11" -D"USE_GCU"
224 #CFLAGS = -std -g -D"USE_X11" -D"USE_GCU"
225 #LIBS   = -lX11 -lcurses -ltermcap -lrpcsvc
226
227
228 ##
229 ## Variation -- compile for Interactive Unix (ISC) systems
230 ##
231 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -D"ISC"
232 #LIBS = -lX11 -lcurses -lnsl_s -linet -lcposix
233
234
235 ##
236 ## Variation -- Support fat binaries under NEXTSTEP
237 ##
238 #CFLAGS = -Wall -O1 -pipe -g -D"USE_GCU" -arch m68k -arch i386
239 #LIBS = -lcurses -ltermcap
240
241
242 ##
243 ## Variation -- compile for FreeBSD
244 ##
245 #CFLAGS = -Wall -O2  -fno-strength-reduce -m486 -pipe -g -D"USE_X11" $(JP_OPT) -D"USE_GCU" -I/usr/X11R6/include -DUSE_NCURSES
246 #LIBS = -L/usr/X11R6/lib -lX11 -lncurses -lmytinfo -lxpg4
247
248 ##
249 ## Variation -- compile for other BSD-like OS
250 ##
251 #CFLAGS = -Wall -O2  -fno-strength-reduce -m486 -pipe -g -D"USE_X11" $(JP_OPT) -D"USE_GCU" -I/usr/X11R6/include -DSPECIAL_BSD
252 #LIBS = -L/usr/X11R6/lib -lX11 -lcurses
253
254
255
256
257 #
258 # Hack -- "install" as the base target
259 #
260
261 install: hengband
262         cp hengband ..
263 #       chmod u+s ../hengband
264
265
266 #
267 # Build the "Angband" program
268 #
269
270 hengband: $(OBJS)
271         $(CC) $(CFLAGS) -o hengband $(OBJS) $(LDFLAGS) $(LIBS)
272
273
274 #
275 # Clean up old junk
276 #
277
278 clean:
279         -\rm -f *.bak *.o
280
281
282 #
283 # Generate dependencies automatically
284 #
285
286 depend:
287         makedepend -D__MAKEDEPEND__ $(SRCS)
288
289
290 #
291 # Hack -- some file dependencies
292 #
293
294 HDRS = \
295         h-basic.h \
296         h-define.h h-type.h h-system.h h-config.h
297
298 INCS = \
299         angband.h \
300         z-config.h defines.h types.h externs.h \
301         z-term.h z-rand.h z-util.h z-virt.h z-form.h $(HDRS)
302
303
304 artifact.o: artifact.c $(INCS)
305 avatar.o: avatar.c $(INCS)
306 bldg.o: bldg.c $(INCS)
307 birth.o: birth.c $(INCS)
308 cave.o: cave.c $(INCS)
309 chuukei.o: chuukei.c $(INCS)
310 cmd1.o: cmd1.c $(INCS)
311 cmd2.o: cmd2.c $(INCS)
312 cmd3.o: cmd3.c $(INCS)
313 cmd4.o: cmd4.c $(INCS)
314 cmd5.o: cmd5.c $(INCS) spellstips.h
315 cmd6.o: cmd6.c $(INCS)
316 dungeon.o: dungeon.c $(INCS)
317 effects.o: effects.c $(INCS)
318 files.o: files.c $(INCS)
319 flavor.o: flavor.c $(INCS)
320 generate.o: generate.c $(INCS) generate.h grid.h rooms.h streams.h
321 grid.o: grid.c $(INCS) grid.h generate.h
322 rooms.o: rooms.c $(INCS) grid.h rooms.h generate.h
323 streams.o: streams.c $(INCS) grid.h generate.h
324 hissatsu.o: hissatsu.c $(INCS)
325 inet.o: inet.c $(INCS)
326 init1.o: init1.c $(INCS)
327 init2.o: init2.c $(INCS)
328 japanese.o: japanese.c $(INCS)
329 load.o: load.c $(INCS)
330 main-cap.o: main-cap.c $(INCS)
331 main-gcu.o: main-gcu.c $(INCS)
332 main-x11.o: main-x11.c $(INCS)
333 main-xaw.o: main-xaw.c $(INCS)
334 main.o: main.c $(INCS)
335 mane.o: mane.c $(INCS)
336 melee1.o: melee1.c $(INCS)
337 melee2.o: melee2.c $(INCS)
338 mind.o: mind.c $(INCS) mindtips.h
339 monster1.o: monster1.c $(INCS)
340 monster2.o: monster2.c $(INCS)
341 mspells1.o: mspells1.c $(INCS)
342 mspells2.o: mspells2.c $(INCS)
343 mspells3.o: mspells3.c $(INCS)
344 mutation.o: mutation.c $(INCS)
345 object1.o: object1.c $(INCS)
346 object2.o: object2.c $(INCS) kajitips.h
347 obj_kind.o: obj_kind.c $(INCS)
348 racial.o: racial.c $(INCS)
349 report.o: report.c $(INCS)
350 scores.o: scores.c $(INCS)
351 save.o: save.c $(INCS)
352 spells1.o: spells1.c $(INCS)
353 spells2.o: spells2.c $(INCS)
354 spells3.o: spells3.c $(INCS)
355 store.o: store.c $(INCS)
356 tables.o: tables.c $(INCS)
357 util.o: util.c $(INCS)
358 variable.o: variable.c $(INCS)
359 wild.o: wild.c $(INCS)
360 wizard1.o: wizard1.c $(INCS)
361 wizard2.o: wizard2.c $(INCS)
362 xtra1.o: xtra1.c $(INCS)
363 xtra2.o: xtra2.c $(INCS)
364 z-form.o: z-form.c $(HDRS) z-form.h z-util.h z-virt.h
365 z-rand.o: z-rand.c $(HDRS) z-rand.h
366 z-term.o: z-term.c $(HDRS) z-term.h z-virt.h
367 z-util.o: z-util.c $(HDRS) z-util.h
368 z-virt.o: z-virt.c $(HDRS) z-virt.h z-util.h
369