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:
73 if exist bin\nul goto ahead
85 move ar65.exe ..\..\bin
91 move ca65.exe ..\..\bin
97 move cc65.exe ..\..\bin
103 move cl65.exe ..\..\bin
109 move da65.exe ..\..\bin
115 move grc.exe ..\..\bin
121 move ld65.exe ..\..\bin
127 move od65.exe ..\..\bin
132 make "CC=cc65" "CFLAGS=-Osir -g -t none -I../../include" "AS=ca65"
134 ar65 a common.lib *.o
135 move common.lib ..\..\lib
138 make "CC=cc65" "CFLAGS=-Osir -g -t none -I../../include" "AS=ca65"
140 ar65 a runtime.lib *.o
141 move runtime.lib ..\..\lib
149 for the .depend file.
153 And in autoexec.bat I have:
155 set CC65_INC=E:\djgpp_v2\cc65\include
156 set CC65_LIB=E:\djgpp_v2\cc65\lib
157 PATH=E:\djgpp_v2\cc65\binutils;%PATH%
159 -------------------------------------------------------------------------
162 OS/2 using the EMX compiler
163 ---------------------------
165 If you're using OS/2 and have the EMX compiler and some GNU tools
166 installed, you may also be able to compile the tools and libraries
167 under OS/2. Mirco Miranda (mircomir@libero.it) sent me the following
171 -------------------------------------------------------------------------
173 CC65 make facilities V0.3 for OS/2 by Mirco Miranda
176 OS2HOWTO.TXT... I wrote this very fast... I hope that you can
179 Emx is a porting of gcc under OS/2. I wrote some C code that with
180 simply (and few) preprocessor line can be compiled under OS/2 and Linux.
181 Now for emx there are projects like P2 that let's add to OS/2 a complete
182 Posix.1/SUS-like environment... I think that in the future the porting
183 from bsd unix (and I hope linux) environment can be made very easy...
185 These are the things because I tried to compile CC65 with emx/gcc...
187 WARNING: at time that as wrote compiling with emx/gcc give some warnings.
193 - emx/gcc 0.9D for OS/2
195 http://hobbes.nmsu.edu/cgi-bin/h-browse?sh=1&dir=/pub/os2/dev/emx/v0.9d
199 http://hobbes.nmsu.edu/pub/os2/dev/util/gnumake.zip
203 Use (ba)sh coming with this package.
204 There are many porting of unix shell for OS/2 and some don't
207 - and finally the source package of the CC65
208 http://www.cc65.org/#Download
209 http://www.acc.umu.se/~arvid/cc65_mirror/cc65-sources-2.6.0.tar.gz
211 I hope that's all! I have the complete emx/gnu tools installed on
212 my OS/2 and I haven't test if you need other package. Sorry.
215 2. Setup environment in OS/2
216 ----------------------------
218 Unpack source package in a Directory and
219 copy the files in src directory of source code.
221 Install emx 0.9D following the istruction comes with it.
222 Emx is well documented and I don't rewrite here emx documentation.
224 Unpack the gnu make tool and copy make-os2.exe in ...\emx\gnu directory
225 then rename it in make.exe
227 Copy xxsh.exe in ...\emx\gnu directory
230 If you want use my .cmd script (makeos2emx.cmd):
232 - copy it in src directory
233 - edit it and change the emx path(s) according with your(s).
234 (set MYEMXPATH=c:\appos2\emx)
238 - add ...\emx\gnu directory on your libpath
239 - add ...\emx\gnu directiry on your path
240 - set comspec=...\emx\gnu\xxsh.exe
241 - run make -f make/gcc.mak in src directory
242 - run make in libsrc directory
247 If you use zap command, *.exe are not deleted.
250 4. Author & Disclaimer
251 ----------------------
257 I haven't tested the generated code of cc65 executables with emx/gcc...
258 If you use the cc65 executables compiled with emx/gcc to compile the library,
259 please test it before hardly or productivity using.
261 Safety solution is compile the cc65 executables with Watcom and then
262 compile the library using gnu make and gnu (ba)sh coming with this package.
263 If you use this last solution you must have only installed emx runtime because
264 make.exe and xxsh.exe use it!
266 -------------------------------------------------------------------------
270 DOS, Windows, OS/2 using the Watcom Compiler
271 --------------------------------------------
273 This is what I'm using. You need the Borland make in addition to the
274 Watcom tools, or you have to change the makefile.
276 1. Copy %WATCOM%\src\startup\wildargv.c from your Watcom directory into
281 make -f make\watcom.mak
283 in the src/ directory.
285 3. Use Linux to build the libraries:-) If you don't have Linux, get it
286 now! More serious: There is no makefile to build the libraries under
287 any of the DOS based operating systems. Use a batch file similar to
288 the one above, or rewrite the makefile.