]> git.sur5r.net Git - cc65/blobdiff - doc/compile.txt
Added note on the necessity of tab chars at the beginning of make command lines.
[cc65] / doc / compile.txt
index 8067858ec68086834b53307ec3cf58b63a0fe8d1..5061d1ed299e1c654d3ad7982722dc80f26b4698 100644 (file)
@@ -5,28 +5,57 @@ Instructions for compiling cc65 and the ca65 binutils:
 
 Linux (and probably most other Unices)
 --------------------------------------
+                           
+Preconditions:
 
-You need the GNU C compiler. Do a
+You need the GNU C Compiler, Perl and sgml-tools installed.
 
-       make -f make/gcc.mak
+The simple way:
 
-twice(!) in each of the directories
+From the main directory, use
 
-       cc65
-       binutils
+        make -f make/gcc.mak
+
+to build all binaries, libraries and the docs. Use
+
+        make -f make/gcc.mak install
+
+to install the files. Check the makefile before doing so and adjust the PREFIX
+variable as you like it.
+
+
+Step by step:
+
+Enter the src/ directory and do a
+
+               make -f make/gcc.mak
+
+This will build all executables. You may use
+
+       make -f make/gcc.mak strip
+
+to remove debugging information from the binaries.
 
 After that, you need to compile the libraries. Do
 
-       cd lib
-       make clean c64lib
-       make clean c128lib
-       make clean plus4lib
-       make clean cbm610lib
-       make clean petlib
-       make clean apple2lib
+       cd libsrc; make
 
-Be sure to say "clean" each time, since some of the sources have a
-"#ifdef <target_system>".
+HTML docs can be generated with
+
+        cd doc; make html
+
+That'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 files
+        /usr/share/doc/cc65-<version>   for documentation
+
+When using these directories, you don't need to set the CC65_INC and
+CC65_LIB environment variables. You may also use the /usr/local tree
+for installation, but the compiler and linker have no predefined search
+path for this directory, so you need the environment variables or
+change the search paths in the source.
 
 
 
@@ -34,7 +63,7 @@ DOS using the DJGPP compiler
 ----------------------------
 
 Most information in this section was provided by Keith W. Gerdes
-(kwg@freebird.ghofn.org). Thanks a lot!
+(kwg@netzero.net). Thanks a lot!
 
 The tmpfile() function in DJGPP has a bug and will not open the scratch
 file in binary mode. If you have problems with the archiver (which uses
@@ -64,56 +93,77 @@ using DJGPP (add your system type to CFLAGS if needed):
 
 Here's my current batch file:
 
-cd cc65
-if exist .depend goto ahead1
-make -f make\gcc.mak
-:ahead1
+cd djgpp_v2\cc65
+
+if exist bin\nul goto ahead
+mkdir bin
+mkdir lib
+:ahead
+
+cd src\common
 make -f make\gcc.mak
-move *.exe ..\binutils
 
-cd ..\cl65
-if exist .depend goto ahead2
+cd ..\ar65
 make -f make\gcc.mak
-:ahead2
+del ar65
+strip ar65.exe
+move ar65.exe ..\..\bin
+
+cd ..\ca65
 make -f make\gcc.mak
-move *.exe ..\binutils
+del ca65
+strip ca65.exe
+move ca65.exe ..\..\bin
 
-cd ..\binutils\common
-if exist .depend goto ahead3
+cd ..\cc65
 make -f make\gcc.mak
-:ahead3
+del cc65
+strip cc65.exe
+move cc65.exe ..\..\bin
+
+cd ..\cl65
 make -f make\gcc.mak
+del cl65
+strip cl65.exe
+move cl65.exe ..\..\bin
 
-cd ..\ca65
-if exist .depend goto ahead4
+cd ..\da65
 make -f make\gcc.mak
-:ahead4
+del da65
+strip da65.exe
+move da65.exe ..\..\bin
+
+cd ..\grc
 make -f make\gcc.mak
-move *.exe ..
+del grc
+strip grc.exe
+move grc.exe ..\..\bin
 
 cd ..\ld65
-if exist .depend goto ahead5
-make -f make\gcc.mak
-:ahead5
 make -f make\gcc.mak
-move *.exe ..
+del ld65
+strip ld65.exe
+move ld65.exe ..\..\bin
 
-cd ..\ar65
-if exist .depend goto ahead6
-make -f make\gcc.mak
-:ahead6
+cd ..\od65
 make -f make\gcc.mak
-move *.exe ..
+del od65
+strip od65.exe
+move od65.exe ..\..\bin
 
-cd ..\..\lib\common
-make 'CFLAGS=-Oi -I../../include/'
+cd ..\..
+
+cd libsrc\common
+make "CC=cc65" "CFLAGS=-Osir -g -t none -I../../include" "AS=ca65"
+"AFLAGS=-t none"
 ar65 a common.lib *.o
-move common.lib ..
+move common.lib ..\..\lib
 
 cd ..\runtime
-make 'CFLAGS=-Oi -I../../include/'
+make "CC=cc65" "CFLAGS=-Osir -g -t none -I../../include" "AS=ca65"
+"AFLAGS=-t none"
 ar65 a runtime.lib *.o
-move runtime.lib ..
+move runtime.lib ..\..\lib
 
  --
 
@@ -134,6 +184,114 @@ PATH=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 tools
+installed, you may also be able to compile the tools and libraries
+under OS/2. Mirco Miranda (mircomir@libero.it) sent me the following
+notes:
+
+
+-------------------------------------------------------------------------
+
+CC65 make facilities V0.3 for OS/2 by Mirco Miranda
+Date: 02/01/2000
+
+OS2HOWTO.TXT... I wrote this very fast... I hope that you can
+understand...
+
+Emx is a porting of gcc under OS/2. I wrote some C code that with
+simply (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 complete
+Posix.1/SUS-like environment... I think that in the future the porting
+from 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/2
+
+http://hobbes.nmsu.edu/cgi-bin/h-browse?sh=1&dir=/pub/os2/dev/emx/v0.9d
+
+- gnu make
+
+http://hobbes.nmsu.edu/pub/os2/dev/util/gnumake.zip
+
+- bash
+
+Use (ba)sh coming with this package.
+There are many porting of unix shell for OS/2 and some don't
+work 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.gz
+
+I hope that's all! I have the complete emx/gnu tools installed on
+my 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 and
+copy 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 directory
+then rename it in make.exe
+
+Copy xxsh.exe in ...\emx\gnu directory
+
+
+If 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 directory
+
+3. My make files
+----------------
+
+If you use zap command, *.exe are not deleted.
+
+
+4. Author & Disclaimer
+----------------------
+
+Mirco Miranda
+mircomir@libero.it
+ICQ#: 51640305
+
+I 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 then
+compile 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 because
+make.exe and xxsh.exe use it!
+
+-------------------------------------------------------------------------
+
+
+
 DOS, Windows, OS/2 using the Watcom Compiler
 --------------------------------------------
 
@@ -147,13 +305,12 @@ Watcom tools, or you have to change the makefile.
 
        make -f make\watcom.mak
 
-   in each of the directories
-
-       cc65
-       binutils
+   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. Use a
-   batch file similar to the one above, or rewrite the makefile.
+   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.
+