3 Instructions for compiling cc65 and the ca65 binutils:
6 Linux (and probably most other Unices)
7 --------------------------------------
9 You need the GNU C compiler. Enter the src/ directory and do a
13 This will build all executables. You may use
15 make -f make/gcc.mak strip
17 to remove debugging information from the binaries.
19 After that, you need to compile the libraries. Do
23 That's it! Installation directories for the RPM packages are
25 /usr/bin for the binaries
26 /usr/lib/cc65/include for include files
27 /usr/lib/cc65/lib for libraries and startup files
29 When using these directories, you don't need to set the CC65_INC and
30 CC65_LIB environment variables. You may also use the /usr/local tree
31 for installation, but the compiler and linker have no predefined search
32 path for this directory, so you need the environment variables or
33 change the search paths in the source.
37 DOS using the DJGPP compiler
38 ----------------------------
40 Most information in this section was provided by Keith W. Gerdes
41 (kwg@netzero.net). Thanks a lot!
43 The tmpfile() function in DJGPP has a bug and will not open the scratch
44 file in binary mode. If you have problems with the archiver (which uses
45 the tmpfile() function), you have two choices:
47 1. Get a fix from http://www.cartsys.com/eldredge/djgpp-patches.html
48 and apply it. This will solve the problem once and forever.
50 2. For a temporary solution, in the file binutils/ar65/main.c, add the
61 This will switch the default mode to binary and will work around the
64 Keith sent me the following notes how to build the tools on a DOS system
65 using DJGPP (add your system type to CFLAGS if needed):
67 -------------------------------------------------------------------------
69 Here's my current batch file:
72 if exist .depend goto ahead1
76 move *.exe ..\binutils
79 if exist .depend goto ahead2
83 move *.exe ..\binutils
86 if exist .depend goto ahead3
92 if exist .depend goto ahead4
99 if exist .depend goto ahead5
106 if exist .depend goto ahead6
113 make 'CFLAGS=-Oi -I../../include/'
114 ar65 a common.lib *.o
118 make 'CFLAGS=-Oi -I../../include/'
119 ar65 a runtime.lib *.o
128 for the .depend file.
132 And in autoexec.bat I have:
134 set CC65_INC=E:\djgpp_v2\cc65\include
135 set CC65_LIB=E:\djgpp_v2\cc65\lib
136 PATH=E:\djgpp_v2\cc65\binutils;%PATH%
138 -------------------------------------------------------------------------
141 OS/2 using the EMX compiler
142 ---------------------------
144 If you're using OS/2 and have the EMX compiler and some GNU tools
145 installed, you may also be able to compile the tools and libraries
146 under OS/2. Mirco Miranda (mircomir@libero.it) sent me the following
150 -------------------------------------------------------------------------
152 CC65 make facilities V0.3 for OS/2 by Mirco Miranda
155 OS2HOWTO.TXT... I wrote this very fast... I hope that you can
158 Emx is a porting of gcc under OS/2. I wrote some C code that with
159 simply (and few) preprocessor line can be compiled under OS/2 and Linux.
160 Now for emx there are projects like P2 that let's add to OS/2 a complete
161 Posix.1/SUS-like environment... I think that in the future the porting
162 from bsd unix (and I hope linux) environment can be made very easy...
164 These are the things because I tried to compile CC65 with emx/gcc...
166 WARNING: at time that as wrote compiling with emx/gcc give some warnings.
172 - emx/gcc 0.9D for OS/2
174 http://hobbes.nmsu.edu/cgi-bin/h-browse?sh=1&dir=/pub/os2/dev/emx/v0.9d
178 http://hobbes.nmsu.edu/pub/os2/dev/util/gnumake.zip
182 Use (ba)sh coming with this package.
183 There are many porting of unix shell for OS/2 and some don't
186 - and finally the source package of the CC65
187 http://www.cc65.org/#Download
188 http://www.acc.umu.se/~arvid/cc65_mirror/cc65-sources-2.6.0.tar.gz
190 I hope that's all! I have the complete emx/gnu tools installed on
191 my OS/2 and I haven't test if you need other package. Sorry.
194 2. Setup environment in OS/2
195 ----------------------------
197 Unpack source package in a Directory and
198 copy the files in src directory of source code.
200 Install emx 0.9D following the istruction comes with it.
201 Emx is well documented and I don't rewrite here emx documentation.
203 Unpack the gnu make tool and copy make-os2.exe in ...\emx\gnu directory
204 then rename it in make.exe
206 Copy xxsh.exe in ...\emx\gnu directory
209 If you want use my .cmd script (makeos2emx.cmd):
211 - copy it in src directory
212 - edit it and change the emx path(s) according with your(s).
213 (set MYEMXPATH=c:\appos2\emx)
217 - add ...\emx\gnu directory on your libpath
218 - add ...\emx\gnu directiry on your path
219 - set comspec=...\emx\gnu\xxsh.exe
220 - run make -f make/gcc.mak in src directory
221 - run make in libsrc directory
226 If you use zap command, *.exe are not deleted.
229 4. Author & Disclaimer
230 ----------------------
236 I haven't tested the generated code of cc65 executables with emx/gcc...
237 If you use the cc65 executables compiled with emx/gcc to compile the library,
238 please test it before hardly or productivity using.
240 Safety solution is compile the cc65 executables with Watcom and then
241 compile the library using gnu make and gnu (ba)sh coming with this package.
242 If you use this last solution you must have only installed emx runtime because
243 make.exe and xxsh.exe use it!
245 -------------------------------------------------------------------------
249 DOS, Windows, OS/2 using the Watcom Compiler
250 --------------------------------------------
252 This is what I'm using. You need the Borland make in addition to the
253 Watcom tools, or you have to change the makefile.
255 1. Copy %WATCOM%\src\startup\wildargv.c from your Watcom directory into
260 make -f make\watcom.mak
262 in the src/ directory.
264 3. Use Linux to build the libraries:-) If you don't have Linux, get it
265 now! More serious: There is no makefile to build the libraries under
266 any of the DOS based operating systems. Use a batch file similar to
267 the one above, or rewrite the makefile.