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