📄 compile.txt
字号:
Instructions for compiling cc65 and the ca65 binutils:Linux (and probably most other Unices)--------------------------------------You need the GNU C compiler. Enter the src/ directory and do a make -f make/gcc.makThis will build all executables. You may use make -f make/gcc.mak stripto remove debugging information from the binaries.After that, you need to compile the libraries. Do cd libsrc; makeThat's it! Installation directories for the RPM packages are /usr/bin for the binaries /usr/lib/cc65/include for include files /usr/lib/cc65/lib for libraries and startup filesWhen using these directories, you don't need to set the CC65_INC andCC65_LIB environment variables. You may also use the /usr/local treefor installation, but the compiler and linker have no predefined searchpath for this directory, so you need the environment variables orchange the search paths in the source.DOS using the DJGPP compiler----------------------------Most information in this section was provided by Keith W. Gerdes(kwg@netzero.net). Thanks a lot!The tmpfile() function in DJGPP has a bug and will not open the scratchfile in binary mode. If you have problems with the archiver (which usesthe tmpfile() function), you have two choices: 1. Get a fix from http://www.cartsys.com/eldredge/djgpp-patches.html and apply it. This will solve the problem once and forever. 2. For a temporary solution, in the file binutils/ar65/main.c, add the following lines: At top: #include <fcntl.h> At start of main: _fmode = O_BINARY; This will switch the default mode to binary and will work around the bug.Keith sent me the following notes how to build the tools on a DOS systemusing DJGPP (add your system type to CFLAGS if needed):-------------------------------------------------------------------------Here's my current batch file:cd djgpp_v2\cc65if exist bin\nul goto aheadmkdir binmkdir lib:aheadcd src\commonmake -f make\gcc.makcd ..\ar65make -f make\gcc.makdel ar65strip ar65.exemove ar65.exe ..\..\bincd ..\ca65make -f make\gcc.makdel ca65strip ca65.exemove ca65.exe ..\..\bincd ..\cc65make -f make\gcc.makdel cc65strip cc65.exemove cc65.exe ..\..\bincd ..\cl65make -f make\gcc.makdel cl65strip cl65.exemove cl65.exe ..\..\bincd ..\da65make -f make\gcc.makdel da65strip da65.exemove da65.exe ..\..\bincd ..\grcmake -f make\gcc.makdel grcstrip grc.exemove grc.exe ..\..\bincd ..\ld65make -f make\gcc.makdel ld65strip ld65.exemove ld65.exe ..\..\bincd ..\od65make -f make\gcc.makdel od65strip od65.exemove od65.exe ..\..\bincd ..\..cd libsrc\commonmake "CC=cc65" "CFLAGS=-Osir -g -t none -I../../include" "AS=ca65""AFLAGS=-t none"ar65 a common.lib *.omove common.lib ..\..\libcd ..\runtimemake "CC=cc65" "CFLAGS=-Osir -g -t none -I../../include" "AS=ca65""AFLAGS=-t none"ar65 a runtime.lib *.omove runtime.lib ..\..\lib --In djgpp.env I use:+LFN=Yfor the .depend file. --And in autoexec.bat I have:set CC65_INC=E:\djgpp_v2\cc65\includeset CC65_LIB=E:\djgpp_v2\cc65\libPATH=E:\djgpp_v2\cc65\binutils;%PATH%-------------------------------------------------------------------------OS/2 using the EMX compiler---------------------------If you're using OS/2 and have the EMX compiler and some GNU toolsinstalled, you may also be able to compile the tools and librariesunder OS/2. Mirco Miranda (mircomir@libero.it) sent me the followingnotes:-------------------------------------------------------------------------CC65 make facilities V0.3 for OS/2 by Mirco MirandaDate: 02/01/2000OS2HOWTO.TXT... I wrote this very fast... I hope that you canunderstand...Emx is a porting of gcc under OS/2. I wrote some C code that withsimply (and few) preprocessor line can be compiled under OS/2 and Linux.Now for emx there are projects like P2 that let's add to OS/2 a completePosix.1/SUS-like environment... I think that in the future the portingfrom bsd unix (and I hope linux) environment can be made very easy...These are the things because I tried to compile CC65 with emx/gcc...WARNING: at time that as wrote compiling with emx/gcc give some warnings.1. What do you need-------------------- emx/gcc 0.9D for OS/2http://hobbes.nmsu.edu/cgi-bin/h-browse?sh=1&dir=/pub/os2/dev/emx/v0.9d- gnu makehttp://hobbes.nmsu.edu/pub/os2/dev/util/gnumake.zip- bashUse (ba)sh coming with this package.There are many porting of unix shell for OS/2 and some don'twork propely.- and finally the source package of the CC65 http://www.cc65.org/#Download http://www.acc.umu.se/~arvid/cc65_mirror/cc65-sources-2.6.0.tar.gzI hope that's all! I have the complete emx/gnu tools installed onmy OS/2 and I haven't test if you need other package. Sorry.2. Setup environment in OS/2----------------------------Unpack source package in a Directory andcopy the files in src directory of source code.Install emx 0.9D following the istruction comes with it.Emx is well documented and I don't rewrite here emx documentation.Unpack the gnu make tool and copy make-os2.exe in ...\emx\gnu directorythen rename it in make.exeCopy xxsh.exe in ...\emx\gnu directoryIf you want use my .cmd script (makeos2emx.cmd):- copy it in src directory- edit it and change the emx path(s) according with your(s). (set MYEMXPATH=c:\appos2\emx)else- add ...\emx\gnu directory on your libpath- add ...\emx\gnu directiry on your path- set comspec=...\emx\gnu\xxsh.exe- run make -f make/gcc.mak in src directory- run make in libsrc directory3. My make files----------------If you use zap command, *.exe are not deleted.4. Author & Disclaimer----------------------Mirco Mirandamircomir@libero.itICQ#: 51640305I haven't tested the generated code of cc65 executables with emx/gcc...If you use the cc65 executables compiled with emx/gcc to compile the library,please test it before hardly or productivity using.Safety solution is compile the cc65 executables with Watcom and thencompile the library using gnu make and gnu (ba)sh coming with this package.If you use this last solution you must have only installed emx runtime becausemake.exe and xxsh.exe use it!-------------------------------------------------------------------------DOS, Windows, OS/2 using the Watcom Compiler--------------------------------------------This is what I'm using. You need the Borland make in addition to theWatcom tools, or you have to change the makefile.1. Copy %WATCOM%\src\startup\wildargv.c from your Watcom directory into binutils\common.2. Enter make -f make\watcom.mak in the src/ directory.3. Use Linux to build the libraries:-) If you don't have Linux, get it now! More serious: There is no makefile to build the libraries under any of the DOS based operating systems. Use a batch file similar to the one above, or rewrite the makefile.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -