Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_FS_1_19910112 - kcc-6/build/build.doc
There is 1 other file named build.doc in the archive. Click here to see a list.
BUILD.DOC  3/5/90

	This file describes four phases:
		A. Initial Setup -- directories & command files
		B. Building KCC binaries
		C. Testing the binaries
		D. Installing the binaries for general use

Although primarily oriented towards TOPS-20 (T20) and CompuServe
(CSI), these directions also illustrate the general steps needed for
other systems.

-----------------------------------------------------------------------------
INITIAL SETUP:

	[0] There are some name interdependencies in this phase, so read the
whole section before doing anything.

	[1] Put all sources into their own separate directories,
preferably as subdirectories of a single top-level directory.  The
top-level directory, as normally distributed, is reserved for files
that pertain to the distribution itself.  From here on the directory
containing this file (BUILD.DOC) will be referred to as CBLD:.

	[2] Create another (sub)directory to hold the binaries you'll be
generating.  This directory will be referred to as Cxxx:, where xxx is
the target system name (T20, CSI, T10, etc).  This may already exist
as part of the distribution.

	[3] Set up a command file in CBLD: called DEFDIR (T20:
DEFDIR.CMD, CSI: DEFDIR.COM) which will define all of the logical
names needed to point to every KCC directory, including CBLD: and
Cxxx:.  Use one of the existing DEFDIR.* files as a model; the names
defined must be exactly as given in the file, since they are used
elsewhere.

	[4] Create another command file called DEFBLD (.CMD or .COM).
This file should define logical names for three things:
		C:	=> Cxxx:
		CSYS:	=> CINCS:
		KCC:	=> <filename of KCC compiler executable to use>
Some examples already exist as DEFBLD.*.

	[5] Create a similar command file called DEFTST which does the
same thing as DEFBLD except that it sets things up for testing a new
KCC and LIBC when the binaries are still in Cxxx: and haven't been
installed yet.  Some examples already exist as DEFTST.*.

	[6] Select the appropriate LIB*.* files for your system.
On T20: Copy LIB*.T20 to *.MIC.
On CSI: Copy LIB*.CSI to *.COM.

	[7] Select the appropriate NCC.* file for your system.
On TOPS-20: Copy NCC.T20 and NCCX.T20 to NCC.MIC and NCCX.MIC.
On CSI: Copy NCC.CSI to NCC.COM.

	[8] For convenience you may wish to copy any or all of these
command files to Cxxx:.  Only DEFDIR needs to be in a "pre-defined"
place since once it has been executed, everything else can be accessed
using the standard logical names.  However, for clarity the remaining
directions assume that the files remain in CBLD:.

-----------------------------------------------------------------------------
BUILDING:

	[1] Take commands from CBLD:DEFDIR and connect to Cxxx:.
		T20: "TAKE defdir" and "CONNECT Cxxx:"
		CSI: Login to Cxxx: (sigh!) and "@[cbld-ppn]defdir"

	[2] Take commands from DEFBLD.
		T20: "TAKE cbld:defbld"
		CSI: "@cbld:defbld"

	[3] Build the library with the appropriate command:
		T20: "DO cbld:libc"
		CSI: "@cbld:libc"
This leaves the library in Cxxx:LIBC.REL (as well as the .REL and perhaps
assembler files for all modules).

	[4] Now that the C library is available, you can build a KCC
compiler which uses it with the command:
		T20: "DO cbld:ncc" and "DO cbld:nccx"
		CSI: "@cbld:ncc"
This leaves a new KCC in Cxxx:NCC.EXE.  On T20, the second command also
produces NCCX.EXE (which uses extended addressing).  It is probably best
to install the latter version to avoid problems compiling large sources.

	[5] Build the auxiliary user libraries with the appropriate commands:
		T20: "DO cbld:libtrm" and "DO cbld:libtmx"
		CSI: "@cbld:libtrm" and "@cbld:libtmx"
This leaves the libraries in Cxxx:LIB*.REL (as well as the .REL and perhaps
assembler files for all modules).

-----------------------------------------------------------------------------
TESTING:

If you want to test out the new KCC and LIBC before installing them,
you will have to set up different definitions in place of those made by
DEFBLD.  Note that unless you know what you are doing, it helps avoid
confusion if you do your testing while connected to a different
directory.  (If you log in to someplace else, you'll have to do DEFDIR
over again first).

	[1] Rename or copy Cxxx:NCC.EXE to Cxxx:TCC.EXE
		(on T20, it may be best to use NCCX.EXE, especially if
		recompiling KCC itself)

	[2] Use the DEFTST command file:
		T20: "TAKE cbld:deftst"
		CSI: "@cbld:deftst"

	[3] Then, to compile something,
		T20: "KCC: file.c"
		CSI: "KCC file.c"

CSI NOTE: Because CSI does not have search paths, any user libraries
specified with the "-l" switch must be copied into Cxxx: or they will
not be found.

-----------------------------------------------------------------------------
INSTALLING:

	[1] You must define, on a system-wide basis, the logical names
C: and CSYS:.  If possible, CSYS: should be a subdirectory of C: -- they
cannot be the same directory due to filename conflicts.

	[2] Copy all the files in CINC: to C:.
	[3] Copy all the files in CINCS: to CSYS:.
	[4] Copy any "substitute" .H files in Cxxx: to C:, in particular
		the C-ENV.H configuration file.
	[5] Copy the Cxxx:LIB*.REL libraries to C: (particularly LIBC!)
	[6] Install Cxxx:NCC.EXE in the standard location for public programs,
		with the appropriate name (CC, or KCC, or whatever).
		On T20, ditto for NCCX.
SPECIAL DIRECTIONS: Cross-compiling on TOPS-20 for other operating systems

In order to cross-compile for another system, certain compiler
switches MAY have to be set for every cross-compilation.  The program
XCC.C exists to perform this.  If cross-compiling from TOPS-20 to
system xxx, an entry within XCC.C needs to be set up (conditionalized
by the TGSYS macro) and the appropriate binary of XCC built.  This
binary can then be pointed to by the KCC: logical name, and used as
the "compiler" for all cross-compilations.

As a specific example, the following files have been used to build KCC
and the library for a TOPS-10 system, with the resulting binaries in CT10:

	CBLD:XCCT10.MIC will build
	CBLD:XCCT10.EXE which can then be used by DEFBLD.

	CBLD:DEFBLD.2X1 (copy to DEFBLD.CMD)
	CBLD:DEFTST.2X1 (copy to DEFTST.CMD)
	CBLD:NCC.2X1 (copy to NCC.MIC)

	The other files are the same as for a TOPS-20 target.