OSDN Git Service

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