OSDN Git Service

upgrade to 3.6.2
[jnethack/source.git] / sys / mac / Install.mw
1 Building a PPC NetHack 3.6 with the Metrowerks compilers
2
3 Note: If you are building using any compiler for OS X, use the instructions 
4       in sys/unix. This file contains old instructions that predated OS X.
5
6 You must be familiar with the Metrowerks compiler and know how to construct
7 projects.  The NetHack source may come with the four pre-made projects that
8 are needed to build NetHack and the files it needs.  These four projects are
9 in :sys:mac and are MakeDefs.u, DgnComp.u, LevComp.u, and NetHack.u.  If you
10 do not have them, or wish to construct them yourself, see the section "Project
11 Contents" below.
12
13
14 1. Move the projects MakeDefs.u, DgnComp.u, LevComp.u, and NetHack.u to the
15 top level of the NetHack tree.  If you are building your own, create each
16 project as needed, in the order given below.
17
18 2. Create a folder "lib" in the top level.  This is where the files used by
19 NetHack will be deposited by MakeDefs, DgnComp, and LevComp.
20
21 3. Build and run MakeDefs.
22
23 You will be presented with a list of options.  Initially choose them all (the
24 default).  Later you may wish to only run a few of them.  The options are
25 "odemvpqrhz", each of which makes a file:
26
27                                 -o creates :include:onames.h
28                                 -p creates :include:pm.h
29                                 -z creates :src:vis_tab.c
30                                 -m creates :src:monstr.c
31                                 -e creates :dat:dundeon.pdf
32                                 -v creates :lib:options
33                                 -d creates :lib:data
34                                 -r creates :lib:rumors
35                                 -h creates :lib:oracles
36                                 -q creates :lib:quest.dat
37
38
39 4. If you are _not_ using DLB, follow these directions.  As of v3.3, DLB is ON
40 for the Mac.  Copy the following files.  You may want to change News or NHDeflts.
41
42                 a. copy ':sys:mac:MacHelp' to ':lib:MacHelp'
43                 b. copy ':sys:mac:News' to ':lib:News'
44                 c. copy ':sys:mac:NHDeflts' to ':lib:NetHack Defaults'
45
46                 d. copy ':dat:cmdhelp' to ':lib:cmdhelp'
47                 e. copy ':dat:help' to ':lib:help'
48                 f. copy ':dat:hh' to 'lib:hh'
49                 g. copy ':dat:history' to ':lib:history'
50                 h. copy ':dat:license' to ':lib:license'
51                 i. copy ':dat:opthelp' to ':lib:opthelp'
52                 j. copy ':dat:wizhelp' to ':lib:wizhelp'
53
54 5. Create an empty file, ':lib:record'
55
56 6. Build and run DgnComp.
57                 This will create a file "dungeon" in the lib directory.
58
59 7. Build and run LevComp.
60                 This will build the level files (*.lev) in the lib directory.
61
62 8. Build NetHack.
63                 Move NetHack in the lib directory.
64
65
66 ------------------------
67
68
69 Building NetHack with MetroWerks IDE 1.x (DR7-DR10, DR11 was never used)
70
71
72 To build NetHack, you will need to create four projects at the top level of
73 the NetHack directory tree.  These four projects are MakeDefs.u, DgnComp.u,
74 LevComp.u, and NetHack.u.  The projects don't have to end in ".u", but you
75 should append some form of ".XXX" to the end of the project's name to
76 distinguish the project from the executable that it produces.  The files
77 and libraries to include in these projects are listed in the "Project
78 Contents" section below.  You must create and run Makedefs before creating
79 NetHack because MakeDefs will create files used by NetHack.
80
81 Use the MacOS C/C++ template for each of the projects.  The libraries included
82 will be overkill for all the projects (e.g. the C++ libraries are not needed).
83 Add the .c and resource files as indicated below.  Unless otherwise noted, the
84 projects can use the default preferences:
85
86         Font
87                 The tabbing on all non-mac files is 8.  All mac files have a
88                         tab of 4.
89         PPC Processor
90                 All projects must have the same alignment to build a consistent
91                         NetHack.  To share save files with 68K, the alignments
92                         must match for their projects, as well.
93                 Turn on Global Optimization (official version is compiled
94                         with level 1).  If you don't turn it on, some files may
95                         not compile because of register overflow.  [NetHack
96                         only]
97         PPC Project
98                 Set name to <MakeDefs, LevComp DgnComp, NetHack>
99                 Other settings [NetHack only]
100                         creator:                        nh31
101                         preferred heap size:2500
102                         minimum heap size:      2000
103                         stack size:                     128             [PPC only]
104
105
106 The SIOUX library may be replaced with console.stubs.c for the NetHack
107 project.
108
109 NOTE: As NetHack 3.3, you must turn on OLDROUTINENAMES -- so you can't use
110 the default pre-compiled header.  You should either remove it from the
111 preferences or insert another precompiled header that has this define off.
112
113
114 ------------------------
115
116
117 Building NetHack with MetroWerks IDE 2.0.
118
119 This is for building a PowerPC version only.  This doesn't take advantage
120 of the IDE's subprojects.  These will be investigated later.
121
122
123 MakeDefs.u, DgnComp.u, LevComp.u:  Select ANSI C Console PPC.
124         Settings:
125                 PPC Target
126                         + Change File Name to MakeDefs, DgnComp, or LevComp respectively.
127                 C/C++ Language
128                         + Turn off ANSI strict, ANSI Keywords Only, Expand Trigraphs
129                 PPC Processor
130                         + Turn on global optimization (at least to level 1)
131
132 NetHack.u: Basic ToolBox PPC
133                 PPC Target
134                         + Change File Name to NetHack.  Other settings
135                                 creator:                        nh31
136                                 preferred heap size:2500
137                                 minimum heap size:      2000
138                                 stack size:                     128             [PPC only]
139                 C/C++ Language
140                         + Options ANSI strict, ANSI Keywords Only, Expand Trigraphs
141                           are already turned off, so you don't have to do anything.
142                 PPC Processor
143                         + Turn on global optimization (at least to level 1)
144
145
146 ------------------------
147 Creating projects for NetHack with MetroWerks IDE 3.3 (Pro 4)
148
149 This is what I changed from the default settings when creating a 68K version.  Some of
150 the settings may not be necessary.  For example, NetHack doesn't use floating point,
151 so I didn't have to check 8 byte doubles.  Some are interrelated.  For example, the
152 codegen and the Math and MSL libraries used.
153
154 For MakeDefs.u, DgnComp.u, LevComp.u: 
155 1. Select File>>New Project...>>MacOS>>C_C++>>Standard Console>>Std C Console 68K
156 2. 68K Settings:
157         Target Settings:
158                 + Set "Target Name" to {MakeDefs,DgnComp,LevComp}.
159         68K Target:
160                 + Set "File Name" to {MakeDefs,DgnComp,LevComp}.
161         C/C++ Language:
162                 + Check Require Function Prototypes, uncheck everything else.
163                 + Clear "Prefix File".
164         68K Processor:
165                 + Set "Code Model" to Large.
166                 + Check 68020 Codegen, 4-Byte Ints, 8-Byte Doubles, Far Data, Far Method Tables,
167                         Far String Constants.  Uncheck everything else.
168 3. Libraries 68K
169         + Remove the C++ Library (it is not needed).
170         + Change math library to MathLib68K Fa(4i_8d).Lib.
171         + Change MSL C library to MSL C.68K Fa(4i_8d).Lib.
172         Note: The actual libraries used must match the CodeGen options in 68K Processor.
173
174
175 For NetHack.u:
176 1. Select File>>New Project...>>MacOS>>C_C++>>MacOS ToolBox>>MacOS ToolBox 68K
177 2. 68K Settings
178         Target Settings:
179                 + Set "Target Name" to NetHack Debug and NetHack Final.
180         68K Target:
181                 + Set "File Name" to NetHack Debug and NetHack Final.
182                 + Set "Creator" to 'nh31'.
183                 + Set "Preferred Heap Size (k)" to 2500.
184                 + Set "Minimum Heap Size (k)" to 1500.
185         C/C++ Language:
186                 + Check Require Function Prototypes, uncheck everything else.
187                 + Set "Prefix File" to LocalDefines.h.  I use this header to define
188                   OLDROUTINENAMES because the pre-compiled header doesn't have it set
189                   any more.  One of these days we'll fix up the code...
190         68K Processor:
191                 + Set "Code Model" to Large.
192                 + Check 68020 Codegen, 4-Byte Ints, 8-Byte Doubles, Far Data, Far Method Tables,
193                         Far String Constants.  Uncheck everything else.
194 3. Libraries 68K
195         + Remove the C++ Library (it is not needed).
196         + Change math library to MathLib68K Fa(4i_8d).Lib.
197         + Change MSL C library to MSL C.68K Fa(4i_8d).Lib.
198         Note: The actual libraries used must match the CodeGen options in 68K Processor.
199         
200
201 For Recover.u:
202 1. Select File>>New Project...>>MacOS>>C_C++>>MacOS ToolBox>>MacOS ToolBox 68K
203 2. 68K Settings
204         Target Settings:
205                 + Set "Target Name" to Recover Debug and Recover Final.
206         68K Target:
207                 + Set "File Name" to Recover Debug and Recover Final.
208                 + Set "Creator" to 'nhRc'.
209         C/C++ Language:
210                 + Check Require Function Prototypes, uncheck everything else.
211                 + Set "Prefix File" to LocalDefines.h.  I use this header to define
212                   OLDROUTINENAMES because the pre-compiled header doesn't have it set
213                   any more.  One of these days we'll fix up the code...
214         68K Processor:
215                 + Set "Code Model" to Large.
216                 + Check 68020 Codegen, 4-Byte Ints, 8-Byte Doubles, Far Data, Far Method Tables,
217                         Far String Constants.  Uncheck everything else.
218 3. Libraries 68K
219         + Remove the C++ Library (it is not needed).
220         + Change math library to MathLib68K Fa(4i_8d).Lib.
221         + Change MSL C library to MSL C.68K Fa(4i_8d).Lib.
222         Note: The actual libraries used must match the CodeGen options in 68K Processor.
223
224
225 ------------------------
226
227 Project Contents:
228
229 MakeDefs.u should contain the following source files:
230
231         src
232                 objects.c
233                 monst.c
234         util
235                 makedefs.c
236
237
238 DgnComp.u should contain the following source files:
239
240         src
241                 alloc.c
242         sys:share
243                 dgn_lex.c
244                 dgn_yacc.c
245         util
246                 dgn_main.c
247                 panic.c
248
249
250 LevComp.u should contain the following source files:
251
252         src
253                 alloc.c
254                 decl.c
255                 drawing.c
256                 monst.c
257                 objects.c
258         sys:mac
259                 macerrs.c
260                 macfile.c
261         sys:share
262                 lev_lex.c
263                 lev_yacc.c
264         util
265                 lev_main.c
266                 panic.c
267         
268
269 NetHack.u should contain the following source files:
270
271         src
272                 *.c                     [can do an add all]
273         sys:mac
274                 *.c     except mrecover.c
275                 NetHack.rsrc
276                 machelp.bh      [for baloon help]
277                 Sound.rsrc      [if you wish to have a few, crude sounds]
278                 Files.r         [if you use DLB (on by default)]
279         sys:share
280                 random.c
281         win:tty
282                 *.c                     [can do an add all - termcap.c is not needed, but will compile to nothing]
283
284         Note: src:monstr.c and src:vis_tab.c are created by MakeDefs -m and -s
285         respectively.
286
287 Recover.u should contain the following source files:
288
289         sys:mac
290                 mrecover.c
291                 mrecover.rsrc