OSDN Git Service

v3.0.0 Alpha5 OSDN最終版
[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         mspells4.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 floors.o \
69         cmd1.o cmd2.o cmd3.o cmd4.o cmd5.o cmd6.o \
70         do-spell.o 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 snipe.o hex.o \
74         artifact.o autopick.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         mspells4.o \
78         main-cap.o main-gcu.o main-x11.o main-xaw.o main.o chuukei.o
79
80
81
82 ##
83 ## Following are some "system" definitions
84 ##
85 ## No changes are needed to compile a version that will run on both
86 ## X11 and Curses, in debugging mode, with maximal warnings, on many
87 ## normal Unix machines of the Sun OS variety (non-solaris).
88 ##
89 ## To use an "alternative" definition, simply "modify" (or "replace")
90 ## the definition below with one that you like.  For example, you can
91 ## change the compiler to "cc", or remove the "debugging" options, or
92 ## remove the X11 or Curses support, etc, as desired.
93 ##
94 ## See also "z-config.h" and "h-config.h" for important information.
95 ##
96 ## Some "examples" are given below, they can be used by simply
97 ## removing the FIRST column of "#" signs from the "block" of lines
98 ## you wish to use, and commenting out "standard" block below.
99 ##
100 ## This is not intended to be a "good" Makefile, just a "simple" one.
101 ##
102
103
104 #
105 # This is my compiler of choice, it seems to work most everywhere
106 #
107 CC = gcc
108
109
110 ###################################################################
111 #
112 # Options for Japanese version (comment out for English version)
113
114 JP_OPT= -D"JP" -D"EUC" -DDEFAULT_LOCALE="\"ja_JP.eucJP\""
115
116 ###################################################################
117
118
119 #
120 # Standard version (see main-x11.c and main-gcu.c)
121 #
122 # This version supports both "X11" and "curses" in a single executable.
123 #
124 # You may have to add various X11 include/library directories to the
125 # "CFLAGS", if your machine places files in a weird location.
126 #
127 # You may be able to remove "-ltermcap" on some machines (ex: Solaris).
128 #
129 # You may have to replace "-lcurses" with "-lncurses" to use the
130 # "new curses" library instead of the "old curses" library, and
131 # you may have to add "-l/usr/include/ncurses" to the "CFLAGS".
132 #
133 # See "main-gcu.c" and "z-config.h" for some optional "curses" defines,
134 # including "USE_GETCH" and "USE_CURS_SET".  Note that "z-config.h" will
135 # attempt to "guess" at many of these flags based on your system.
136 #
137 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU"
138 #LIBS = -lX11 -lcurses -ltermcap
139
140 CFLAGS = -Wall -O2  -fno-strength-reduce -m486 -pipe -g -D"USE_X11" $(JP_OPT) -D"USE_GCU" -I/usr/X11R6/include
141 LIBS = -L/usr/X11R6/lib -lX11 -lncurses
142
143
144 ##
145 ## Variation -- Compile for Linux
146 ##
147 #CFLAGS = -Wall -O2 -m486 -pipe -g -D"USE_XAW" -D"USE_GCU"
148 #LIBS = -L/usr/X11R6/lib -lXaw -lXext -lSM -lICE -lXmu -lXt \
149 #       -lX11 -lcurses
150
151
152 ##
153 ## Variation -- Only support "main-x11.c" (not "main-gcu.c")
154 ##
155 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11"
156 #LIBS = -lX11
157
158
159 ##
160 ## Variation -- Only support "main-gcu.c" (not "main-x11.c")
161 ##
162 #CFLAGS = -Wall -O1 -pipe -g -D"USE_GCU"
163 #LIBS = -lcurses -ltermcap
164
165
166 ##
167 ## Variation -- Use "main-xaw.c" instead of "main-x11.c"
168 ##
169 #CFLAGS = -Wall -O1 -pipe -g -D"USE_XAW" -D"USE_GCU"
170 #LIBS = -lXaw -lXmu -lXt -lX11 -lcurses -ltermcap
171
172
173 ##
174 ## Variation -- Use "main-cap.c" instead of "main-gcu.c"
175 ##
176 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_CAP"
177 #LIBS = -lX11 -ltermcap
178
179
180 ##
181 ## Variation -- Only work on simple vt100 terminals
182 ##
183 #CFLAGS = -Wall -O1 -pipe -g -D"USE_CAP" -D"USE_HARDCODE"
184
185
186 ##
187 ## Variation -- this might work for Linux 1.1.93 using ncurses-1.8.7.
188 ##
189 #CFLAGS = -I/usr/X11R6/include -I/usr/include/ncurses \
190 #         -Wall -O2 -fomit-frame-pointer -m486 \
191 #         -D"USE_X11" -D"USE_GCU"
192 #LIBS = -L/usr/X11R6/lib -lX11 -lncurses -ltermcap
193
194 ##
195 ## Variation -- this might work better than the suggestion above
196 ##
197 #CFLAGS = -I/usr/include/ncurses \
198 #         -Wall -O2 -fomit-frame-pointer \
199 #         -D"USE_X11" -D"USE_GCU" \
200 #         -D"USE_TPOSIX" -D"USE_CURS_SET"
201 #LIBS = -lX11 -lncurses
202 #LDFLAGS = -s
203
204
205 ##
206 ## Variation -- compile for Solaris
207 ##
208 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -D"SOLARIS"
209 #LIBS = -lX11 -lsocket -lcurses
210
211
212 ##
213 ## Variation -- compile for SGI Indigo runnig Irix
214 ##
215 #CFLAGS = -Wall -O2  -fno-strength-reduce -g -D"USE_X11" $(JP_OPT) -D"USE_GCU" -I/usr/X11R6/include
216 #LIBS = -L/usr/X11R6/lib -lX11 -lncurses -ltermcap -lsun
217
218
219
220 ##
221 ## Variation -- compile for Dec ALPHA OSF/1 v2.0
222 ##
223 #CC     = cc
224 ##CFLAGS = -std -O -g3 -Olimit 4000 -D"USE_X11" -D"USE_GCU"
225 #CFLAGS = -std -g -D"USE_X11" -D"USE_GCU"
226 #LIBS   = -lX11 -lcurses -ltermcap -lrpcsvc
227
228
229 ##
230 ## Variation -- compile for Interactive Unix (ISC) systems
231 ##
232 #CFLAGS = -Wall -O1 -pipe -g -D"USE_X11" -D"USE_GCU" -D"ISC"
233 #LIBS = -lX11 -lcurses -lnsl_s -linet -lcposix
234
235
236 ##
237 ## Variation -- Support fat binaries under NEXTSTEP
238 ##
239 #CFLAGS = -Wall -O1 -pipe -g -D"USE_GCU" -arch m68k -arch i386
240 #LIBS = -lcurses -ltermcap
241
242
243 ##
244 ## Variation -- compile for FreeBSD
245 ##
246 # (for Japanese ver.)
247 #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\""
248 #LIBS = -L/usr/X11R6/lib -lX11 -lncurses -lmytinfo -lxpg4
249
250 ##
251 ## Variation -- compile for other BSD-like OS
252 ##
253 #CFLAGS = -Wall -O2  -fno-strength-reduce -m486 -pipe -g -D"USE_X11" $(JP_OPT) -D"USE_GCU" -I/usr/X11R6/include -DSPECIAL_BSD
254 #LIBS = -L/usr/X11R6/lib -lX11 -lcurses
255
256
257
258
259 #
260 # Hack -- "install" as the base target
261 #
262
263 install: hengband
264         cp hengband ..
265 #       chmod u+s ../hengband
266
267
268 #
269 # Build the "Angband" program
270 #
271
272 hengband: $(OBJS)
273         $(CC) $(CFLAGS) -o hengband $(OBJS) $(LDFLAGS) $(LIBS)
274
275
276 #
277 # Clean up old junk
278 #
279
280 clean:
281         -\rm -f *.bak *.o
282
283
284 #
285 # Generate dependencies automatically
286 #
287
288 depend:
289         makedepend -D__MAKEDEPEND__ $(SRCS)
290
291
292 #
293 # Hack -- some file dependencies
294 #
295
296 HDRS = \
297         h-basic.h \
298         h-define.h h-type.h h-system.h h-config.h
299
300 INCS = \
301         angband.h \
302         z-config.h defines.h types.h externs.h \
303         z-term.h z-rand.h z-util.h z-virt.h z-form.h $(HDRS)
304
305
306 artifact.o: artifact.c $(INCS)
307 avatar.o: avatar.c $(INCS)
308 bldg.o: bldg.c $(INCS)
309 birth.o: birth.c $(INCS)
310 cave.o: cave.c $(INCS)
311 chuukei.o: chuukei.c $(INCS)
312 cmd1.o: cmd1.c $(INCS)
313 cmd2.o: cmd2.c $(INCS)
314 cmd3.o: cmd3.c $(INCS)
315 cmd4.o: cmd4.c $(INCS)
316 cmd5.o: cmd5.c $(INCS)
317 cmd6.o: cmd6.c $(INCS)
318 do-spell.o: do-spell.c $(INCS)
319 dungeon.o: dungeon.c $(INCS)
320 effects.o: effects.c $(INCS)
321 files.o: files.c $(INCS)
322 flavor.o: flavor.c $(INCS)
323 generate.o: generate.c $(INCS) generate.h grid.h rooms.h streams.h
324 grid.o: grid.c $(INCS) grid.h generate.h
325 rooms.o: rooms.c $(INCS) grid.h rooms.h generate.h
326 streams.o: streams.c $(INCS) grid.h generate.h
327 hissatsu.o: hissatsu.c $(INCS)
328 hex.o: hex.c $(INCS)
329 inet.o: inet.c $(INCS)
330 init1.o: init1.c $(INCS)
331 init2.o: init2.c $(INCS)
332 japanese.o: japanese.c $(INCS)
333 load.o: load.c $(INCS)
334 main-cap.o: main-cap.c $(INCS)
335 main-gcu.o: main-gcu.c $(INCS)
336 main-x11.o: main-x11.c $(INCS)
337 main-xaw.o: main-xaw.c $(INCS)
338 main.o: main.c $(INCS)
339 mane.o: mane.c $(INCS)
340 melee1.o: melee1.c $(INCS)
341 melee2.o: melee2.c $(INCS)
342 mind.o: mind.c $(INCS) mindtips.h
343 monster1.o: monster1.c $(INCS)
344 monster2.o: monster2.c $(INCS)
345 mspells1.o: mspells1.c $(INCS)
346 mspells2.o: mspells2.c $(INCS)
347 mspells3.o: mspells3.c $(INCS)
348 mutation.o: mutation.c $(INCS)
349 object1.o: object1.c $(INCS)
350 object2.o: object2.c $(INCS) kajitips.h
351 obj_kind.o: obj_kind.c $(INCS)
352 racial.o: racial.c $(INCS)
353 report.o: report.c $(INCS)
354 scores.o: scores.c $(INCS)
355 save.o: save.c $(INCS)
356 snipe.o: snipe.c $(INCS)
357 spells1.o: spells1.c $(INCS)
358 spells2.o: spells2.c $(INCS)
359 spells3.o: spells3.c $(INCS)
360 store.o: store.c $(INCS)
361 tables.o: tables.c $(INCS)
362 util.o: util.c $(INCS)
363 variable.o: variable.c $(INCS)
364 wild.o: wild.c $(INCS)
365 wizard1.o: wizard1.c $(INCS)
366 wizard2.o: wizard2.c $(INCS)
367 xtra1.o: xtra1.c $(INCS)
368 xtra2.o: xtra2.c $(INCS)
369 z-form.o: z-form.c $(HDRS) z-form.h z-util.h z-virt.h
370 z-rand.o: z-rand.c $(HDRS) z-rand.h
371 z-term.o: z-term.c $(HDRS) z-term.h z-virt.h
372 z-util.o: z-util.c $(HDRS) z-util.h
373 z-virt.o: z-virt.c $(HDRS) z-virt.h z-util.h
374