home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / mach / doc / notes / mach3_oldbuild.doc.Z / mach3_oldbuild.doc
Encoding:
Text File  |  1992-08-18  |  28.7 KB  |  541 lines

  1.                                BUILDING MACH 3.0
  2.  
  3.                                 Mary R.Thompson
  4.  
  5.                                Richard P. Draves
  6.  
  7.                                   21 May 1992
  8.  
  9. 1. Expected Environment
  10.   The  Mach  3.0  build  process assumes that it is being performed on a system
  11. that is running either Mach 3.0, Mach 2.5, MSD 2.6 or OSF/1.  Otherwise many of
  12. the  tools  used  in the build process may not be consistent with the ones that
  13. are expected.  We provide sources for some, but not all, of our build tools.
  14.  
  15.   The biggest difference between our tools and standard BSD Unix is our use  of
  16. searchpaths.  Our  cpp  looks  for include files along the environment variable
  17. CPATH.  make has an additional searchpath, MAKECPP, that it hands to cpp.    To
  18. help  alleviate this difficulty, we have included binaries for make, cc and cpp
  19. or gcc-cpp in the release area. This  is  a  collection  that  is  suppable  by
  20. holders  of  BSD  4.3  licenses. If you have supped this collection install the
  21. programs in it at the beginning of your PATH.  The man page for  make  is  also
  22. included in our mach3.release area.
  23.  
  24. 2. Directory Structure
  25.   The  Makefiles  make  some assumptions about the layout of source, object and
  26. release areas. In order to avoid modifications to  the  Makefiles,  you  should
  27. have your sources in adjacent directories with the following names:  mk (kernel
  28. sources), ux (Unix-server sources), user (user level program) and poe (the  POE
  29. server). The object area (where the .o files and executables are built) and the
  30. release area (where includes, libraries and programs are executed from)  should
  31. be adjacent to the src directory.
  32.  
  33.   The source, object and release directory organization is now:
  34.         src/{mk,ux,user,...}/...
  35.         obj/{pmax_mach,i386_mach,...}/{mk,ux,user,...}/...
  36.         release/{pmax_mach,i386_mach,...}/{bin,lib,include,etc,man,special}/...
  37.  
  38.   Each  collection  has  is  its  own source area and object area (for example,
  39. src/mk and obj/@sys/mk) but the collections share a release area, release/@sys.
  40. You  must  set  up  the  source  directories  and  top level object and release
  41. directories and populate them either  by  sup  or  m3tree.  The  build  process
  42. creates  the obj and release subdirectories. Having objects placed in a machine
  43. dependent directory that is separate from the source  directory  allows  us  to
  44. build  objects  for  several  machine  types  from the same sources in the same
  45. logical name space. On filesystems such as NFS and  AFS,  it  also  allows  the
  46. source  directories  to be "read-only" and the object directories to be treated
  47. as more "temporary" files.
  48.  
  49.   The CMU @sys variable (which on Mach systems expands  to  <machine>_mach)  is
  50. used  in  the release and install directories. It appears in the Makeconf files
  51. where it can be overridden by defining  the  make  variable  ATSYS.    It  also
  52. appears in the Makefile-mklinks files.
  53.  
  54. 3. Overview of Build Process
  55.   Each  component  builds  using files from the release area and installs files
  56. back into the release area.  This  means  that  if  you  are  building  several
  57. components,  then  they  must be built in the proper order.  Bootstrapping from
  58. scratch, e.g. when the release area starts off empty, is a little  tricky,  and
  59. we  supply  a  script  that  can be used as a template.  However, if you have a
  60. "system release area" that is already populated, then it can  be  searched  for
  61. files  after the "local release area". If you are working on a platform that is
  62. supported by CMU, you can get the  contents  of  this  release  area  from  the
  63. mach3.release  SUP  collection.    In  this  case,  you  only have to build the
  64. components you are interested in, and everything else  comes  from  the  system
  65. release  area.  For example, you no longer have to build mig, config, makeboot,
  66. libraries, bootstrap, etc. to build a kernel.  You no longer have  to  build  a
  67. kernel before building a Unix server.
  68.  
  69.   The  Makefiles  (Makeconfs,  actually)  take care of adding the local release
  70. area to your PATH/CPATH/LPATH variables so that it is  searched  appropriately.
  71. If  you  are  not bootstrapping from scratch, you should add the system release
  72. area to your variables yourself.  For example,
  73.  
  74.     setpath -i0 /usr/mach3
  75.  
  76. if /usr/mach3 is your system release area.  The system release area at CMU is
  77.  
  78.     /afs/cs.cmu.edu/project/mach3/latest/release/@sys
  79.  
  80. .
  81.  
  82.   The Makefiles use the wh program to search  path  variables.    For  example,
  83. dependencies  on  libraries  are  generated by searching LPATH for the library.
  84. The user collection includes source for the wh program and it is  installed  in
  85. the  system  release  area.   The source for md and xstrip programs used by the
  86. Makefiles is also in the user collection.
  87.  
  88.   The top-level Makefiles (mk/Makefile, ux/Makefile, user/Makefile)  build  the
  89. subdirectories in the collection in the appropriate order.  Only subdirectories
  90. which actually exist in your copy of the sources are built.   For  example,  if
  91. you have mk/bootstrap/* and mk/kernel/* but not mk/include/* and not mk/user/*,
  92. then builds in mk will skip the non-existent  directories.    Instead,  include
  93. files  and  libraries  will  come  from  the system release area.  However, the
  94. top-level  Makefile  will   build   mig,   config,   makeboot,   doconf   (from
  95. mk/kernel/src/*) and install them in the local release area before building the
  96. kernel so that they can be used from there for the kernel build.  Also  machine
  97. dependent  directories  for  platforms  other  than  the one being built may be
  98. missing.
  99.  
  100.   This document does not try to duplicate all of the information in the CS make
  101. man page. It is expected that you read it along with this document. Some of the
  102. variables that our build process uses are used and/or defined  and/or  modified
  103. by the make program. Others are purely local, defined and used only by our Mach
  104. 3.0 Makefiles. It is important to understand which  are  used  by  make  before
  105. attempting any changes to the Makefiles.
  106.  
  107.   One  feature  of CMU's make that you want to avoid is its default behavior of
  108. always looking for an RCS archive file, e.g. foo.c,v and RCS/foo.c,v,  when  it
  109. fails  to find a primary file, foo.c. If you keep all your source files checked
  110. out, and have several directories that  are  being  searched  for  prerequisite
  111. files,  this  can  add  a noticeable and unnecessary amount of time to a build,
  112. especially one where most of the time is spent on fstat's  of  files  that  are
  113. up-to-date.  To  avoid  this  behavior  run  make with the -c switch. For those
  114. people who are doing builds from a shadow area that has RCS links back  to  the
  115. Mach  3.0 archive areas, make may actually check-out obsolete versions of files
  116. from the RCS tree instead of finding a newer version  that  may  now  be  in  a
  117. different directory.
  118.  
  119. 4. Makefiles
  120.  
  121.  
  122.  
  123. 4.1. targets
  124.   The  Makefiles  have four main targets.  The default target is install.  That
  125. is, make is equivalent to 'make install'.
  126.  
  127. make install    builds and installs into the local release area
  128.  
  129. make clean      removes files installed in the local release area
  130.  
  131. make all        When  possible,  builds  in  the   object   directory   without
  132.                 installing.
  133.  
  134. make release    Used  for  copying  from  the  local  release  area to a system
  135.                 release area, or copying between system release areas.
  136.  
  137.   The toplevel Makefiles also have a  target  mkidirs  to  create  the  primary
  138. subdirectories  in  the local release directory.  Normally the Makefiles do not
  139. assume that the object area or the local release area have been populated  with
  140. subdirectories.    Instead,  subdirectories  are created as needed.  This means
  141. before building, only the top-level  object  directory  (obj/@sys/<collection>)
  142. and  release  directory (release/@sys) must already exist. If you are not going
  143. to build from the top, but are going to go straight  into  a  subdirectory  and
  144. build, to ensure that bin, lib, etc are created first before you try to install
  145. into them, you should make the target mkidirs at the top level.
  146.  
  147.   Similarly, the target mkrdirs  creates  the  primary  subdirectories  in  the
  148. release   directory,   which  you  should  do  before  going  straight  into  a
  149. subdirectory and doing a  'make  release'.    A  'make  install'  at  top-level
  150. automatically  does  a  'make  mkidirs',  and  a  'make  release'  at top-level
  151. automatically does a 'make mkrdirs', so normally you shouldn't  have  to  worry
  152. about this.
  153.  
  154.  
  155.  
  156. 4.2. Generic Makefiles
  157.   Each  collection  has its own set of standard Makefiles which are included by
  158. the  individual  Makefiles  in  the  subdirectories.  Makefile-common  contains
  159. standard  definitions  and  few  very  general rules. It is included by all the
  160. individual Makefiles.  The other Makefile-* files at the top level define  more
  161. specialized rules and are only included by Makefiles that need those rules.
  162.  
  163.   The  Makeconf file at the top level is read by make before it reads any other
  164. Makefile. Makeconf is used to set the make variables that determine  where  the
  165. objects  are to be built and the binaries are to be installed. It also sets the
  166. variables  that  determine  what  directories  are  searched  for  executables,
  167. libraries and include files. Make starts in the directory that it was called in
  168. and searches up the directory hierarchy to find a Makeconf file.  It  uses  the
  169. first  one it finds. If there is no Makeconf file anywhere in the superior tree
  170. then none is used.
  171.  
  172.  
  173.  
  174. 4.3. Make variables
  175.  
  176. CONFIG          Selects what configuration options are chosen  for  the  kernel
  177.                 and Unix server. Defined in Makefile-config.
  178.  
  179. OBJECTDIR       The  directory  in  which  the  objects are placed.  If this is
  180.                 undefined the objects are put in the source directory.  Defined
  181.                 in Makeconf.
  182.  
  183. INSTALLDIR      The  directory  in  which  executable  files, include files and
  184.                 libraries are put by the install target. Defined in Makeconf.
  185.  
  186. FRELEASEDIR     The directory  in  which  files  are  found  by  make  release.
  187.                 Defaults to INSTALLDIR. Defined in Makeconf.
  188.  
  189. TRELEASEDIR     The  directory  into which files are installed by make release.
  190.                 Defined in Makeconf.
  191.  
  192. atsys           Used as the name of the machine-dependent  directories  in  the
  193.                 object  and  release  areas.  Defined  in Makeconf. Defaults to
  194.                 @sys, unless the environment variable ATSYS is set.
  195.  
  196. MAKECONF        Defined by make as the absolute pathname of the  Makeconf  file
  197.                 that  it  is  using.    This  value is used in our Makefiles to
  198.                 determine the base of the source and/or  object,release  trees.
  199.                 Exported to the environment.
  200. MAKETOP         Defined  by make as the relative pathname from the directory in
  201.                 which make was invoked to the directory containing the Makeconf
  202.                 file.
  203.  
  204. TARGET_MACHINE  Defined  by  make  as  the  machine  type for which the make is
  205.                 taking place. It is used in our Makefiles to select definitions
  206.                 based  on which machine type the build is for.  It is also used
  207.                 by make when it is called with the -m switch as  as  additional
  208.                 subdirectory to search for prerequisite files.
  209.  
  210. VPATH           The  search  path that make uses to find the prerequisite files
  211.                 when it is evaluating a dependency rule. This  may  be  set  by
  212.                 individual  Makefiles,  but  make  expands  any  given names to
  213.                 include the same names in  the  source  tree  and  any  backing
  214.                 source  areas.  (See Shadowing) If a file name starts with "./"
  215.                 only the current directory, which is  normally  in  the  object
  216.                 tree,  is  searched.  Running make with the -d switch will show
  217.                 you what make is using for the VPATH
  218.  
  219. cpu             Yet another name for machine dependent subdirectories.  Defined
  220.                 in  Makefile-common and can be used as a component of VPATH for
  221.                 directories which have machine-dependent subdirectories.
  222.  
  223. DIRS            Defined by toplevel Makefiles as the list of subdirectories  in
  224.                 which make will be run by the RECURSE template.
  225.  
  226. MKIDIRS         Defined  by  toplevel Makefiles as the directories that must be
  227.                 created in the install area.
  228.  
  229. MKRDIRS         Defined by the toplevel Makefile as the directories  that  must
  230.                 be created in the release area.
  231.  
  232. PROGRAM,OBJECTS,LIBRARIES
  233.                 Defined by leaf Makefiles. These variables  are  used  in  ways
  234.                 defined by the toplevel Makefile-* files. In general PROGRAM is
  235.                 the target being built, it depends on OBJECTS and LIBRARIES and
  236.                 it links with LIBRARIES. Details may vary depending on where in
  237.                 the tree the Makefile is and what Makefile-* it is including.
  238.  
  239.  
  240.  
  241. 4.4. Environment variables
  242.  
  243. CPATH           The search path for include files. Defined in Makeconf and some
  244.                 Makefiles. Used by cpp.
  245.  
  246. LPATH           The search path for libraries. Defined in Makeconf.  Used by ld
  247.                 and some Makefiles.
  248.  
  249. PATH            The search path for executables. Defined in Makeconf.  Used  by
  250.                 csh.
  251.  
  252. MAKECPP         A  search  path  defined  by  make and passed to cpp for cpp to
  253.                 search for include files. You can check the value of this  path
  254.                 by running make with the -d switch.
  255.  
  256. MAKECWD         Defined  by  make  as  the absolute path to the directory where
  257.                 make is currently executing; exported to the environment.
  258.  
  259. MAKEDIR         Defined by  make  as  the  relative  path  from  the  directory
  260.                 containing the Makeconf file to the directory in which make was
  261.                 invoked; exported to the environment.
  262.  
  263. MAKEPSD         Defined by make as a pathlist of the source directories. If you
  264.                 are not using any shadow directories, this is just the relative
  265.                 pathname  back  to  the  source  directory  from   the   object
  266.                 directory.  If  you are building from shadow sources, this will
  267.                 also include the  master  soruce  directory;  exported  to  the
  268.                 environment.
  269.  
  270. CPP_INCL_DEBUG  If  set  to  1,  cpp  prints  out  the  directories  that it is
  271.                 searching for include files.
  272.  
  273. 5. Cross compiling
  274.   With  the  release  of  MK73,  UX34,  and  USER16,  the   Makefiles   support
  275. cross-compilation.    Johannes Helander of the Helsinki Institute of Technology
  276. did the original development, and then Rich Draves  incorporated  it  into  our
  277. current  Makefiles.   Johannes also added a clean way for sites to override the
  278. standard make definitions.
  279.  
  280.   If you aren't cross-compiling, the cross-compilation support shouldn't get in
  281. your way.  Everything works as before.
  282.  
  283.   In  addition to the old TARGET_MACHINE variable (set by make), there is now a
  284. HOST_MACHINE variable, which defaults to ${TARGET_MACHINE}.  You  cross-compile
  285. by  overriding  the  default values of these variables so that their values are
  286. different.
  287.  
  288.   When cross-compiling, some stuff (meant for the host machine) is installed in
  289. a  different  location.   There is a HOST_INSTALLDIR variable which defines the
  290. location   of   the   local   host   release   area.       It    defaults    to
  291. ${INSTALLDIR}/${host_atsys}.   For example, if one is compiling for the i860 on
  292. i386 (TARGET_MACHINE=I860, HOST_MACHINE=I386) then the directory layout is
  293.         source          src/mk
  294.         objects         obj/i860_mach/mk
  295.         target release  release/i860_mach/{bin,lib,...}
  296.         host release    release/i860_mach/i386_mach/{bin,lib,...}
  297. Programs like mig, makeboot, config, md, wh, xstrip are compiled for  the  host
  298. machine  and  installed  in  the  host  release area.  The path variables PATH,
  299. HOST_LPATH, and HOST_CPATH search the host release area.   The  path  variables
  300. LPATH and CPATH search the target release area.
  301.  
  302.   For 'make release', there are variables HOST_FRELEASEDIR and HOST_TRELEASEDIR
  303. which work the way you'd expect.
  304.  
  305.   If you aren't cross-compiling, then HOST_INSTALLDIR =  INSTALLDIR,  etc,  and
  306. this all collapses to the normal directory layout.
  307.  
  308. 6. Overriding the Makefile defaults
  309.   To   override  the  standard  definitions  in  Makeconf,  you  can  create  a
  310. Makeconf-site, which Makeconf includes if it exists.  In Makeconf-site you  can
  311. define  SOURCEDIR (to get shadowing), redefine OBJECTDIR & INSTALLDIR, override
  312. HOST_MACHINE & TARGET_MACHINE, define initial values for  the  path  variables,
  313. etc.
  314.  
  315.   To  override  the  standard  definitions in Makefile-common, you can create a
  316. Makefile-site, which Makefile-common includes it it exists.   In  Makefile-site
  317. you can add/override definitions of CC and the like.
  318.  
  319. 7. Building the mk collection
  320.   The make procedure for the mk tree is more complicated than a build of a tree
  321. of simple unrelated programs. The mk/Makefile has been  set  up  to  build  and
  322. install  the pieces of this tree in the order in which they are needed.  If you
  323. are not absolutely sure of what you are doing you should always start the  make
  324. in  the  directory  mk.  If  you start off in one of the subdirectories you may
  325. either find that files are missing or you are  getting  incorrect  versions  of
  326. files  from  incorrect  directories.  The building of the kernel itself is also
  327. complicated by the  fact  that  it  needs  to  be  dynamically  configured  for
  328. different hardware platforms and configurations. This is accomplished following
  329. the tradition of BSD 4.3 of having the config program write the Makefile, named
  330. Makefile.internal, that will be used to build the kernel.
  331.  
  332.   We  have recently added the complication that the bootable kernel is built in
  333. two pieces: the kernel itself named mach_kernel and  the  default  pager  named
  334. bootstrap.  Another  program,  makeboot,  binds  the  two files together into a
  335. single load image named mach.boot as the final step of the kernel build.
  336.  
  337.   The layout of the mk source tree is as follows:
  338.  
  339. bootstrap       Makefile and sources to build the default pager.
  340.  
  341. conf            a link to kernel/conf.
  342.  
  343. include         contains only  the  Makefiles  to  install  the  mk  collection
  344.                 include files.
  345.  
  346. user/libmach    Makefile and sources to build libmach.a and libmach_sa.a
  347.  
  348. user/threads    Makefile and sources to build libthreads.a
  349.  
  350. kernel/src/{config,doconf,makeboot,mig}
  351.                 Makefiles and sources to build each of these programs which are
  352.                 needed to build the kernel
  353.  
  354. kernel/conf     The Makefile templates and configuration files that config uses
  355.                 to create the Makefile for the kernel, Makefile.internal.
  356.  
  357. kernel          The Makefile that starts off the building of the kernel and all
  358.                 the  kernel  sources. It ends up switching to the configuration
  359.                 directory   and   calling   make   with   the   newly   created
  360.                 Makefile.internal  as the Makefile that actually compiles files
  361.                 for the kernel.
  362.  
  363.   When you do a make in the mk directory, it will proceed to make  the  install
  364. target in each of the subdirectories in the DIRS list in kernel/Makefile in the
  365. order in which they appear. If you wish to start the make at any other place in
  366. this  tree,  you need to be sure that all the prerequisite tools, libraries and
  367. includes have been installed.  One item to notice, is that the  kernel/Makefile
  368. resets CPATH to ".", before doing the make with Makefile.internal. This has the
  369. effect of having the kernel make look for include files only within the  kernel
  370. source and object directories, rather than from the release area.
  371.  
  372. 8. Configurations
  373.   Both the mach kernel and Unix server use a modified version of the BSD config
  374. program to write Makefile.internal which is used to  build  the  kernel/server.
  375. There are three types of files that provide input to config: MASTER*, Makefile*
  376. and files.
  377.  
  378.   The MASTER files define the various individual configuration  options  and  a
  379. few  macro configuration names that are combinations of individual options. For
  380. each machine type the options from MASTER, MASTER.local,  MASTER.<machine>  and
  381. MASTER.<machine>.local  are  combined  by  the doconf script into a file in the
  382. object directory with the name <CONFIG>.  Thus if you  are  building  a  STD+WS
  383. configuration  of  the  kernel,  the file obj/@sys/mk/kernel/STD+WS/STD+WS will
  384. contain all the options selected for this configuration.
  385.  
  386.   The files files simply list each file, conditionalized by  the  options  that
  387. will  select  it,  that is to be used in the kernel or server.  Again the files
  388. and files.<machine> are combined. The lines OPTIONS/foo cause a file  foo.h  to
  389. be written into the object directory which contains a #define FOO 1|0 depending
  390. on whether the option foo was selected or not.
  391.  
  392.   The Makefile.template and Makefile.<machine> contain definitions and template
  393. rules for config to use in writing Makefile.internal.
  394.  
  395.   The  Makefile-config  file defines the CONFIG variable which is used to chose
  396. the configuration to build. This can be overridden by setting it on the command
  397. line to make.  For example the make command in the ux directory could be
  398.  
  399.      make CONFIG=STDVICE+WS
  400. which would cause the non-AFS/NFS configuration of the Unix server to be built.
  401. It is also possible to select or  remove  specific  options  in  the  following
  402. manner: for example in mk
  403.  
  404.      make CONFIG=STD+WS-debug-ipc_debug
  405.  
  406. would  disable  the  kernel  debugging interfaces. Note:  we do not expect that
  407. most randomly chosen configurations would  either  build  or  work.  There  are
  408. several drivers for various machines which are not usually built and are likely
  409. to require some work before they will compile or run.
  410.  
  411. 9. Building the uk collection
  412.   Building in the ux tree has some of the same complications as  the  mk  tree.
  413. Again  you  should start your make from the ux directory, to ensure that things
  414. are  done  in  the  proper  order.  Here  it  is  only   important   that   the
  415. include/Makefile  installs  the  .h files before the emulator and server try to
  416. use them for building.
  417.  
  418.   The config program is used to write the Makefile.internal file  that  directs
  419. the  building  of the Unix server just as it did for the kernel. Configurations
  420. are again specified by the files in the ux/server/conf  directory.  Because  of
  421. license  restrictions  on the Unix server sources, you may not be able to build
  422. the default configuration that we build at CMU. This configuration,  STDAFS+WS,
  423. requires  sources  for  the  kernel support for NFS and AFS. If you do not have
  424. source liceses for these, you will  need  to  change  the  CONFIG  variable  to
  425. STDVICE+WS.  CONFIG is defined in ux/Makefile-config.  It can either be changed
  426. there or defined on the command line to make.
  427.  
  428. 10. Special files
  429.   A release area contains several primary subdirectories.  Most of these,  bin,
  430. lib,  include, etc, man should be familiar to you.  The special subdirectory is
  431. where the following binaries are installed:
  432.         bootstrap.<version>
  433.         mach_kernel.<version>.<config>
  434.         mach.boot.<version>.<config>
  435.         emulator.<version>
  436.         vmunix.<version>.<config>
  437. where <version> is a string like MK69 or UX31, and <config> is  a  string  like
  438. STD+ANY or STDAFS+WS.
  439.  
  440.   These  files should be copied from the special directory when installing them
  441. in / or /mach_servers.  The files in the object directory are NOT stripped. For
  442. all  kernels  MK68  and  later,  you  should  install  and  boot mach.boot, NOT
  443. mach_kernel.  mach.boot is produced from bootstrap  and  mach_kernel  with  the
  444. makeboot  program.  What name you give mach.boot in / or /../..  is of course a
  445. matter for you and your boot loader to decide.  For more  detailed  information
  446. on installing these programs see the document Setup for Mach 3.0.
  447.  
  448. 11. Bootstrapping
  449.   We  are  still  not at the point where we can provide a full set of bootstrap
  450. files and procedures. The main things that are missing are the CMU  version  of
  451. make  and  a  CMU  compatible  version  of cpp. We do make our modifications to
  452. gcc-cpp available in the /usr/mach/public/src ftp area.  The  make  we  use  is
  453. based  on  BSD 4.3 and is encumbered with AT&T licenses. We hope to change to a
  454. non-licensed make at some point.
  455.  
  456.   Meanwhile Rich Draves has provided a shell script called m3build  which  will
  457. build  and install the tools that we do supply in the correct order.  It can be
  458. found in /usr/mach/public/doc/mach3/m3build.sh.  It  should  be  run  from  the
  459. <base>/src directory. It is run as:
  460.  
  461.        m3build  bootstrap | mk | ux | user
  462.                 [-mach3release <release-dir>] [-clean] [-extra]
  463.  
  464. 'm3build  bootstrap'  builds and installs md, wh, xstrip, the mk and ux include
  465. files and libcmucs. 'm3build mk | ux |user' builds and installs  all  files  in
  466. those  trees.  The  -mach3release  switch  lets you specify the 'system release
  467. area' where files like make and cc or gcc are found.  The  -clean  switch  will
  468. delete  any  of  previously released files or objects before it does the build.
  469. -extra will build all the configurations of mk or ux.
  470.  
  471. 12. Shadowing
  472.   The Makefiles also support shadowing.  With shadowing, you can have a "system
  473. source  area" which contains most source files, and a "local source area" which
  474. only contains files that you have changed.  In the extreme, the only  file  you
  475. need  in  your  local  source area is the top-level Makeconf.  (Each collection
  476. contains one Makeconf now, at top-level.)  A shadow build searches  your  local
  477. source  area for files and directories first, and then checks the system source
  478. area for files and directories.  To do shadowing, you should set  SOURCEDIR  to
  479. the  system  source  and  build in your local source area. For example, if your
  480. local   area   is   /usr/rpd/mymach3/src/mk   and   the    system    area    is
  481. /afs/cs/project/mach3/latest/src/mk then:
  482.  
  483.        cd /usr/rpd/mymach3/src/mk/bootstrap
  484.        setpath -i0 /afs/cs/project/mach3/release/latest/@sys
  485.        make SOURCEDIR=/afs/cs/project/mach3/latest/src/mk install
  486.  
  487. does  a  shadow  build  of  bootstrap  in  the mk collection.  Any libraries or
  488. include files that are not in your local release area  will  be  found  in  the
  489. system  release  area, /afs/cs/project/mach3/release/latest/@sys.  Your copy of
  490. Makeconf in /usr/rpd/mymach3/src/mk should define OBJECTDIR and  INSTALLDIR  to
  491. be  someplace  appropriate  for your files to be placed in. You can also define
  492. SOURCEDIR in Makeconf.
  493.  
  494. 13. Other Topics
  495.  
  496.  
  497.  
  498. 13.1. Supping
  499.   If you are not at CMU the standard way to get both the sources and the system
  500. release  area is to use our Software Upgrade Protocol program (SUP) to copy the
  501. files over the Internet. There  is  a  different  collection  for  each  source
  502. subtree and one for the system release area. Different licenses are required to
  503. get permission to sup the different collections. Your machine must  be  enabled
  504. in  our  host  tables to sup these collections.  Information on all the details
  505. can be found in /usr/mach/public/doc/mach3/mach3_sup.
  506.  
  507.  
  508.  
  509. 13.2. m3tree
  510.   If you are at CMU and have read access to the mach3 archive area, you can get
  511. a  copy  of  the  sources  by  using  the  m3tree script. Use of this script is
  512. documented   by    calling    it    with    the    -help    option    and    in
  513. /usr/mach/public/doc/mach3/mach3_cmu.{ps.doc}.
  514.  
  515.  
  516.  
  517. 13.3. How to run Mach 3.0
  518.   See   the   document   Setup   for   Mach   3.0   which   can   be  found  in
  519. /usr/mach/public/doc/mach3/mach3_setup.{ps,doc}
  520.                                Table of Contents
  521. 1. Expected Environment                                                       0
  522. 2. Directory Structure                                                        0
  523. 3. Overview of Build Process                                                  0
  524. 4. Makefiles                                                                  0
  525.      4.1. targets                                                             0
  526.      4.2. Generic Makefiles                                                   0
  527.      4.3. Make variables                                                      0
  528.      4.4. Environment variables                                               1
  529. 5. Cross compiling                                                            1
  530. 6. Overriding the Makefile defaults                                           1
  531. 7. Building the mk collection                                                 1
  532. 8. Configurations                                                             1
  533. 9. Building the uk collection                                                 2
  534. 10. Special files                                                             2
  535. 11. Bootstrapping                                                             2
  536. 12. Shadowing                                                                 2
  537. 13. Other Topics                                                              2
  538.      13.1. Supping                                                            2
  539.      13.2. m3tree                                                             2
  540.      13.3. How to run Mach 3.0                                                2
  541.