3 Instructions for compiling cc65 and the ca65 binutils:
6 Linux (and probably most other Unices)
7 --------------------------------------
11 You need the GNU C Compiler, Perl and sgml-tools installed.
15 From the main directory, use
19 to build all binaries, libraries and the docs. Use
21 make -f make/gcc.mak install
23 to install the files. Check the makefile before doing so and adjust the PREFIX
24 variable as you like it.
29 Enter the src/ directory and do a
33 This will build all executables. You may use
35 make -f make/gcc.mak strip
37 to remove debugging information from the binaries.
39 After that, you need to compile the libraries. Do
43 HTML docs can be generated with
47 That's it! Installation directories for the RPM packages are
49 /usr/bin for the binaries
50 /usr/lib/cc65/include for include files
51 /usr/lib/cc65/lib for libraries and startup files
52 /usr/share/doc/cc65-<version> for documentation
54 When using these directories, you don't need to set the CC65_INC and
55 CC65_LIB environment variables. You may also use the /usr/local tree
56 for installation, but the compiler and linker have no predefined search
57 path for this directory, so you need the environment variables or
58 change the search paths in the source.
62 DOS using the DJGPP compiler
63 ----------------------------
65 Most information in this section was provided by Keith W. Gerdes
66 (kwg@netzero.net). Thanks a lot!
68 The tmpfile() function in DJGPP has a bug and will not open the scratch
69 file in binary mode. If you have problems with the archiver (which uses
70 the tmpfile() function), you have two choices:
72 1. Get a fix from http://www.cartsys.com/eldredge/djgpp-patches.html
73 and apply it. This will solve the problem once and forever.
75 2. For a temporary solution, in the file binutils/ar65/main.c, add the
86 This will switch the default mode to binary and will work around the
89 Keith sent me the following notes how to build the tools on a DOS system
90 using DJGPP (add your system type to CFLAGS if needed):
92 -------------------------------------------------------------------------
94 Here's my current batch file:
98 if exist bin\nul goto ahead
110 move ar65.exe ..\..\bin
116 move ca65.exe ..\..\bin
122 move cc65.exe ..\..\bin
128 move cl65.exe ..\..\bin
134 move da65.exe ..\..\bin
140 move grc.exe ..\..\bin
146 move ld65.exe ..\..\bin
152 move od65.exe ..\..\bin
157 make "CC=cc65" "CFLAGS=-Osir -g -t none -I../../include" "AS=ca65"
159 ar65 a common.lib *.o
160 move common.lib ..\..\lib
163 make "CC=cc65" "CFLAGS=-Osir -g -t none -I../../include" "AS=ca65"
165 ar65 a runtime.lib *.o
166 move runtime.lib ..\..\lib
174 for the .depend file.
178 And in autoexec.bat I have:
180 set CC65_INC=E:\djgpp_v2\cc65\include
181 set CC65_LIB=E:\djgpp_v2\cc65\lib
182 PATH=E:\djgpp_v2\cc65\binutils;%PATH%
184 -------------------------------------------------------------------------
187 OS/2 using the EMX compiler
188 ---------------------------
190 If you're using OS/2 and have the EMX compiler and some GNU tools
191 installed, you may also be able to compile the tools and libraries
192 under OS/2. Mirco Miranda (mircomir@libero.it) sent me the following
196 -------------------------------------------------------------------------
198 CC65 make facilities V0.3 for OS/2 by Mirco Miranda
201 OS2HOWTO.TXT... I wrote this very fast... I hope that you can
204 Emx is a porting of gcc under OS/2. I wrote some C code that with
205 simply (and few) preprocessor line can be compiled under OS/2 and Linux.
206 Now for emx there are projects like P2 that let's add to OS/2 a complete
207 Posix.1/SUS-like environment... I think that in the future the porting
208 from bsd unix (and I hope linux) environment can be made very easy...
210 These are the things because I tried to compile CC65 with emx/gcc...
212 WARNING: at time that as wrote compiling with emx/gcc give some warnings.
218 - emx/gcc 0.9D for OS/2
220 http://hobbes.nmsu.edu/cgi-bin/h-browse?sh=1&dir=/pub/os2/dev/emx/v0.9d
224 http://hobbes.nmsu.edu/pub/os2/dev/util/gnumake.zip
228 Use (ba)sh coming with this package.
229 There are many porting of unix shell for OS/2 and some don't
232 - and finally the source package of the CC65
233 http://www.cc65.org/#Download
234 http://www.acc.umu.se/~arvid/cc65_mirror/cc65-sources-2.6.0.tar.gz
236 I hope that's all! I have the complete emx/gnu tools installed on
237 my OS/2 and I haven't test if you need other package. Sorry.
240 2. Setup environment in OS/2
241 ----------------------------
243 Unpack source package in a Directory and
244 copy the files in src directory of source code.
246 Install emx 0.9D following the istruction comes with it.
247 Emx is well documented and I don't rewrite here emx documentation.
249 Unpack the gnu make tool and copy make-os2.exe in ...\emx\gnu directory
250 then rename it in make.exe
252 Copy xxsh.exe in ...\emx\gnu directory
255 If you want use my .cmd script (makeos2emx.cmd):
257 - copy it in src directory
258 - edit it and change the emx path(s) according with your(s).
259 (set MYEMXPATH=c:\appos2\emx)
263 - add ...\emx\gnu directory on your libpath
264 - add ...\emx\gnu directiry on your path
265 - set comspec=...\emx\gnu\xxsh.exe
266 - run make -f make/gcc.mak in src directory
267 - run make in libsrc directory
272 If you use zap command, *.exe are not deleted.
275 4. Author & Disclaimer
276 ----------------------
282 I haven't tested the generated code of cc65 executables with emx/gcc...
283 If you use the cc65 executables compiled with emx/gcc to compile the library,
284 please test it before hardly or productivity using.
286 Safety solution is compile the cc65 executables with Watcom and then
287 compile the library using gnu make and gnu (ba)sh coming with this package.
288 If you use this last solution you must have only installed emx runtime because
289 make.exe and xxsh.exe use it!
291 -------------------------------------------------------------------------
295 DOS, Windows, OS/2 using the Watcom Compiler
296 --------------------------------------------
298 This is what I'm using. You need the Borland make in addition to the
299 Watcom tools, or you have to change the makefile.
301 1. Copy %WATCOM%\src\startup\wildargv.c from your Watcom directory into
306 make -f make\watcom.mak
308 in the src/ directory.
310 3. Use Linux to build the libraries:-) If you don't have Linux, get it
311 now! More serious: There is no makefile to build the libraries under
312 any of the DOS based operating systems. Use a batch file similar to
313 the one above, or rewrite the makefile.