#ident "@(#)xenv:m68k/README	35.1       88/08/26     "
#ident "Copyright (c) 1984 AT&T"
#ident "Copyright (c) 1985 MOTOROLA, INC."
#
#	MASTER README FOR MOTOROLA-68K SGS
#
#
This README file is in a directory called ....(path name).../xenv/m68k .

The source files composing the MOTOROLA-M68K SGS are stored in a directory
structure of the form:

	../../inc/m68k
	../../inc/common
	../../<tool>/m68k
	../../<tool>/common
	../../../make
	../../../../<lib>/m68k
	../../../../<lib>/common

where ../../inc/* contain the header files, ../../<tool>/* contains the source
files used to build a particular tool, e.g. "as", and ../../../../<lib>/*
contains the source files used to build a particular library, e.g. "libc".
While some tools are composed principally of common files, all of them are
built in the m68k structure.

The directory containing this README file also contains the following
files:
	pathedit-- shell script to set path names in paths.h, sgs.h,
		   makefile, make-m68k, env-m68k,
		   ../../sgs.mk and ../../../../lib.mk

	pted.shlink-- file to link the libc source files to shlibc
                      (this file is invoked by pathedit)

	paths.h	-- a reusable skeleton of ../../inc/m68k/paths.h

	sgs.h	-- a reusable copy of ../../inc/m68k/sgs.h

	plate.mk -- a reusable skeleton of MOTOROLA M68K Master SGS makefile

	make-m68k -- a reusable skeleton of the front-end to make.

	env_m68k -- a reusable skeleton of the cross-environment script

To build the tools, the paths.h file (in ../../inc/m68k/paths.h)
must be set up properly.  This file contains the absolute path
names for various tools and directories.  These path names can
be set using the pathedit shell program in this directory.
Pathedit will also set the path names in the master SGS makefile
(./makefile), the global makefile (../../sgs.mk) which makes both the SGS
and the cross-libraries, the master library makefile (../../../../lib.mk), the
front-end to make (./make-m68k) and the cross-environment script (./env_m68k),
as well as the SGS prefix in sgs.h (../../inc/m68k/sgs.h).

$(BASE) will denote the directory where the SGS source is rooted.

Let:
	MACH 	= Target machine, i.e. the machine for which SGS will produce
		  code. This parameter is used to define the appropriate
		  variable in the C preprocessor. Legal response is
		  m68k.

	BINDIR = directory containing the tools which are called
		 directly, such as m68kcc, m68ksize, etc.. Default value
		 is $(BASE)/$(MACH)/bin.

	LIBDIR = directory containing indirectly called passes of
		 various tools, such as comp and cpp, as well as the
		 libraries (libld.a, libc.a, etc.). Default value 
		 is $(BASE)/$(MACH)/lib.

        USRINC  = the ABSOLUTE name of the default include directory for
                  the cpp. This is the directory in which the cross
		  cpp will look for header files. Default value is
		  $(BASE)/$(MACH)/usr/include.

	PREFIX = generic prefix used for command names, e.g. setting
		 this to "m68k" causes the command name for the C
		 compiler to be called "m68kcc". Default value is the target 
		 machine name, $(MACH).

To set the pathnames, run pathedit giving the names of the parameters
as requested.  Pathedit should be executed with /bin/sh and thus execute
it as follows:

        sh pathedit <cr>

Now the cross-SGS can be made. Simply type the following:

	cd ../..		- go the root directory of the SGS source

	make -f sgs.mk		- builds all MOTOROLA M68K SGS tools and the 
				  cross-libraries and installs them in BINDIR 
				  and LIBDIR


Some other make capabilities are:

	make -f sgs.mk sgs	- builds the M68K SGS tools and libraries only
				  This does not build the cross-libraries.

	make -f sgs.mk install	- installs tools in BINDIR and LIBDIR 

	make -f sgs.mk shrink	- removes ALL non-source files (i.e. .o and
			  	  executable) from the m68k and common
				  directory structures. This DOES NOT remove
				  the installed files.
	
