home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / mach / doc / notes / mach3_build.doc.Z / mach3_build.doc
Encoding:
Text File  |  1993-06-18  |  28.5 KB  |  600 lines

  1.                                BUILDING MACH 3.0
  2.  
  3.                                 Mary R.Thompson
  4.  
  5.                                  18 June 1993
  6.  
  7. 1. Introduction
  8.   We  have  now  switched our Makefiles to use the OSF/ODE make program and OSF
  9. style Makefiles. This make program is basically the one by Adam  De  Boor  that
  10. was released on the BSD 4.3-Reno tape. The OSF modified it to support CMU style
  11. object and shadow directories. The version we are using came from the OSF DCE v
  12. 2.1  tape. The programs are all available without license restrictions and have
  13. been placed in the buildtools/ode directory. Currently they are used  to  build
  14. themselves,  the  mk, ux, user and BNR-server (bsdss). We have also switched to
  15. use gcc 2.3.3 for all our  compilations.  Sources  for  this  compiler  are  in
  16. buildtools/gnu.  You  can build it yourself and install it where you want it or
  17. you can use the binary version we  provide  in  the  mach3.release  collection.
  18. External        users        need        to        setenv       GCC_EXEC_PREFIX
  19. <your_installation_dir>/@sys/lib/lib-gcc/, since otherwise gcc will try to find
  20. it's  components  in /afs/cs.cmu.edu/project/mach3/latest/release/@sys/lib/lib-
  21. gcc/, followed by /usr/local/lib/gcc-lib and /usr/lib/gcc.
  22.  
  23.   Once all the tools are installed, the procedure for  building  components  of
  24. the  system is to run a script that sets a number of environment variables that
  25. the Makefiles depend on, then switch to the directory containing the sources of
  26. the target to be built, and type odemake.
  27.  
  28.   There  are  several  documents to help you understand how this process works.
  29. There are OSF man pages on make.1 and makefiles.5, a man page on the additional
  30. makefiles  for  the  mach3  project,  a  man page for setvar.1 and a postscript
  31. tutorial by Adam de Boor on the make program.
  32.  
  33. 2. Bootstraping the ODE tools
  34.   This section can be skipped if binary versions of  the  following  tools  are
  35. already  available:  gcc 2.3.3, odemake, genpath, makepath, md, release, wh and
  36. setvar.        At        CMU         these         files         are         in
  37. /afs/cs/project/mach3/{latest,alpha}/release/@sys.  External to CMU they can be
  38. obtained by supping the mach3.release collection.
  39.  
  40.   The ODE tools were designed by the OSF to be portable to  different  machines
  41. and  versions  of  Unix.  The  first step in this process is to build the tools
  42. themselves. A script (or set of scripts) has been provided  for  this  purpose.
  43. The  first  script is setup.sh which we have placed in the buildtools/ode/setup
  44. directory. It is called with a context argument which defines the  machine  and
  45. host  OS,  in  our case it is one of i386_mach, i386_bnr, pmax_mach, sun3_mach,
  46. sun4_mach, vax_mach, luna88k_mach or pmax_mach_X_alpha.   The  setup.sh  script
  47. runs  a  sub-script, <context>/setup.sh which is used to set the machine and OS
  48. specific variables. If you are trying to build the tools on  a  platform  other
  49. than Mach or BNR you should create a customized script for your new context.
  50.  
  51.   The  location and procedure for running the setup script is pretty inflexible
  52. since it needs to set up a directory structure and know where the sources  are.
  53. The directory structure (which may be rooted wherever you wish) that it assumes
  54. is as follows:
  55.         src/{buildtools,mk,ux,user,bsdss}/...
  56.         src/buildtools/ode/{setup,mk,bin,lib}
  57.         obj/<context>/{buildtools,mk,ux,user,bsdss}/...
  58.         release/<context>/{bin,lib,include,etc,man,special}/...
  59.         export/<context>/{bin,include,lib,special}/...
  60.  
  61.   Actually the setup.sh script only cares about the source directory  names  in
  62. the ode subdirectory and the location of the object directory.  There must be a
  63. Makeconf file in the src/buildtools  directory  that  specifies  MAKEOBJDIR  to
  64. match where setup.sh believes it is.
  65.  
  66.   To run the setup script you should
  67.  
  68.     cd src/buildtools/ode/setup
  69.     sh -x setup.sh <context> >& log &
  70.  
  71.   The  script  will  create all the obj, release and export directories that it
  72. needs, use the bin/make/bootstrap.sh script to  build  make,  install  make  in
  73. export/<context>/bin/odemake,  which  it  has  added  to PATH. The bootstrap.sh
  74. script defines some variables dependent on the context. If you are building  in
  75. a  new  context  you will need to modify this script. It then uses this odemake
  76. and the Makefiles in ode/setup/mk to build genpath, makepath, release,  md  and
  77. wh and to install them in export/<context>/bin.
  78.  
  79.   The  version  of  gcc 2.3.3 we provide is the standard gnu release, with some
  80. configuration changes for  Mach.    The  gnu  directory  contains  scripts  and
  81. instructions on how to do build it.
  82.  
  83.   At  this point you have the bootstrap tools that are needed to build the rest
  84. of the system. You still need to have the standard Unix tools: csh, sed,  yacc,
  85. lex,  awk,  tar  and an assembler and loader available.  Now you should run the
  86. setvar script and build the complete buildtools directory.  This  will  rebuild
  87. the  odetools  plus  a few additional things depending on what platform you are
  88. building on.
  89.  
  90. 3. Setting the environment for odemake
  91.  
  92.  
  93.  
  94. 3.1. setvar
  95.   The ODE make and makefiles depend on certain environment variables.  A set of
  96. scripts,   buildtools/ode/setup/{setvar.csh,<context>/setvar.csh}   have   been
  97. provided which make sure that all the necessary target directories exist,  exec
  98. a shell and set the necessary variables.
  99.  
  100.   There are three different situations in which the build may take place.
  101.  
  102.    1. Everything  is  in  the  local  source, export or release area. This
  103.       includes all the tools we provide and whatever exported includes  or
  104.       libs are needed.
  105.  
  106.    2. The  local area contains all the sources of the programs that are to
  107.       be built, but tools and includes or libraries from other  areas  are
  108.       to be found in a complete system release area.
  109.  
  110.    3. The local area is a shadow of some system release area, and contains
  111.       only the sources that are different from the originals. In this case
  112.       sources  as  well  as  tools, libs and includes are to come from the
  113.       system release area, unless they exist in the local area.
  114.  
  115.   setvar can be called with a variety of arguments to deal with these cases.
  116.  
  117.     setvar.csh [-basedir <dir>] [-masterbase <dir> ]
  118.                [-systembase <dir> ] [-makesyspath <dir>]
  119.                [-target <machine>] <host_context>
  120.  
  121.   The options are:
  122.  
  123. -basedir <dir>: the base of the tree which contains  the  local  src,  obj  and
  124.                 export  directories.  Defaults  to the parent of a superior src
  125.                 directory.
  126.  
  127. -masterbase <dir>:
  128.                 when  shadowing  set this to the base of the source and release
  129.                 directory that is being shadowed.
  130.  
  131. -systembase <dir>:
  132.                 is the base of the tree that contains a current system release.
  133.                 When shadowing a fully built release area  this  variable  does
  134.                 not  need  to  be  set, since anything that is not in the local
  135.                 area should be found in either the master/release  area  or  on
  136.                 the  default  PATH.   If not shadowing and this variable is not
  137.                 set, then a bootstrap script should  be  run  to  get  the  the
  138.                 system  tools and include files generated and released into the
  139.                 local export directory.
  140.  
  141. -makesyspath <dir>:
  142.                 is  a  list of directories (separated by ':'s) that is searched
  143.                 by  odemake  to  find  the  .mk  rules  files.    Defaults   to
  144.                 <basedir>/export/<host_context>/lib/mk,       followed       by
  145.                 masterbase/release if  shadowing,  and  systembase  if  it  was
  146.                 given.
  147.  
  148. -target <machine>:
  149.                 should only be used when cross-building and the  target_machine
  150.                 is  different  from the host_machine.  Otherwise target_machine
  151.                 is set from the host_context
  152.  
  153. -savepath:      if set, the current PATH will be added to the end of  the  PATH
  154.                 that is set here. By default PATH will only contain the minimum
  155.                 necessary to build.
  156.  
  157. -help:          prints a brief help message
  158.  
  159. host_context:   is host_machine_os specification that  selects  sub  setvar.csh
  160.                 that  sets  machine  specific  variables  such as HOST_MACHINE,
  161.                 target_machine, target_cpu and default search paths.
  162.  
  163.   For example:
  164.  
  165.   Case    1:    where    everything    is    local     in     the     directory
  166. /mach3/{src,export,release}
  167.  
  168.     cd /mach3/src
  169.     /mach3/export/i386_mach/etc/setup/setvar i386_mach
  170.  
  171.   Case  2:  /usr/mrt/mach3  is  contains all the sources for a kernel build but
  172. other   tools   are   to   be   found   in    the    system    release    area,
  173. /afs/cs/project/mach3/latest/release.
  174.  
  175.     cd /usr/mrt/mach3/src
  176.     alias sv `/afs/cs/project/mach3/latest/release/@sys/etc/setup/setvar`
  177.     sv -systembase /afs/cs/project/mach3/latest/release/@sys i386_mach
  178.  
  179.   Case  3: /mach3 is a local shadow area for a kernel build and the master area
  180. is /afs/cs/project/mach3/latest.
  181.  
  182.     alias sv `/afs/cs/project/mach3/latest/release/@sys/etc/setup/setvar`
  183.     sv -basedir /mach3 -masterbase /afs/cs/project/mach3/latest i386_mach
  184.  
  185.  
  186.  
  187. 3.2. Environment variables
  188.   The following environment variables are set by context/setvar.csh
  189.  
  190. HOST_MACHINE,TARGET_MACHINE,target_machine,TARGET_CPU,target_cpu
  191.                 type of machine
  192.  
  193. TARGET_OS,target_os
  194.                 set to mach
  195.  
  196. DEFCPATH        Default path to search for include files.
  197.  
  198. OBJECT_FORMAT   format objects are to be built-in. e.g A_OUT, COFF, MACH_O
  199.  
  200. ARCHIVE_FORMAT  format of archive files. e.g. BSDARCH,
  201.  
  202. Some flags for porting the ODE tools
  203.  
  204.   The following environment variables are set by setvar.csh
  205.  
  206. PATH            Path to be searched for binaries. This is the export directory,
  207.                 the  release  directory  and  whatever DEFPATH was set for this
  208.                 system.
  209.  
  210. CPATH           Path  to  be  searched  for  include  files.  Used  by  the   C
  211.                 preprocessor.
  212.  
  213. LPATH           Path to be searched to find crt0.o and migcom.
  214.  
  215. INCDIRS         a  list  of -Idirs to be passed to the pre-processor instead of
  216.                 relying on CPATH
  217.  
  218. LIBDIRS         a list of -Ldirs to be passed to the loader instead of  relying
  219.                 on LPATH
  220.  
  221. PROJECT_NAME,project_name
  222.                 Selects  the  project  specific  make  rules  by  causing   the
  223.                 inclusion  of  osf.<project_name>.mk into the makefiles. Set to
  224.                 mach3 for all the Mach 3.0 collections.
  225.  
  226. RULES_MK        the name of the stardard make rules file to start the  includes
  227.                 in.  It  is  set  to  osf.std.mk  which  is  looked  for in the
  228.                 MAKESYSPATH directory.    This  is  used  instead  of  the  BSD
  229.                 standard sys.mk.
  230.  
  231. EXPORTBASE, SOURCEBASE, OBJECTDIR
  232.                 bases of the respective trees.  SOURCEBASE  and  OBJECTDIR  are
  233.                 used by genpath. OBJECTDIR is also used by Makeconf.
  234.  
  235. SOURCEDIR       Can be set to define a backing directory for the sources.  Used
  236.                 by genpath and Makeconf
  237.  
  238.   In an OSF environment, the setvar.csh script is replaced by rc-files and  the
  239. workon program.
  240.  
  241. 4. Building from a set of sources
  242.   The basic procedure for building from a set of Mach 3.0 sources is to execute
  243. the setvar.csh script, cd to the directory in which the sources are to be found
  244. and type odemake.
  245.  
  246.   odemake    will    descend   down   the   subtree   as   specified   in   the
  247. EXP{BIN,INC,LIB}_SUBDIRS  variables  in  the  Makefile,  first   building   and
  248. exporting  any export targets, and then into the SUBDIRS list building the rest
  249. of the targets.  Once all the exported targets are in place, individual targets
  250. can be built by cd'ing to the source directory and typing odemake <target>.
  251.  
  252.   The  target  export_all  will  do  only  the exporting passes, and the target
  253. export_<file> will export a single file or program.    The  target  install_all
  254. along  with a TOSTAGE argument will release everything that has been previously
  255. built to the TOSTAGE area.  See the man page  makefiles(5)  for  more  possible
  256. targets.
  257.  
  258.   The   following   sections  describe  in  detail  the  build  steps  for  the
  259. micro-kernel (mk tree) and the unix-server (ux tree). You do not really need to
  260. understand this unless you want to modify these programs.
  261.  
  262.  
  263.  
  264. 4.1. Make variables
  265.   The  odemake  envrionment uses a set of standard rules files that define lots
  266. of variables as well as  standard  rules.  These  files  are  included  by  the
  267. .include <${RULES_MK}> in each Makefile. ${RULES_MK} is defined as osf.rules.mk
  268. and     is     found     on     the     $MAKESYSPATH     path     which      is
  269. {export,release}/<context>/lib/mk.    The  majority of variables are defined in
  270. osf.<projectname>.mk, in our case osf.mach3.mk and osf.std.mk. The rest of  the
  271. .mk  files are rules. In general, these .mk files define variables only if they
  272. have not been previously defined which allows you to overide these values  with
  273. environment  variables  or  by  setting them in Makefiles. The values are often
  274. fuctions of other variables set in the environment or Makefiles.
  275.  
  276.   Variables are defined for most programs that might be used by  rules:    e.g.
  277. _CC_,  _LD_,  RM,  RANLIB etc, and for default flags used by the rules. Many of
  278. the flags follow the pattern of combining
  279.  
  280. DEF_xFLAGS      set conditionally in osf.mach3.mk
  281.  
  282. ${.TARGET}_xFLAGS or xFLAGS
  283.                 set in the Makefile
  284.  
  285. ${.TARGET}_xENV or xENV
  286.                 set in the environment
  287.  
  288. ${.TARGET}_xARGS or xARGS
  289.                 set on the command line
  290.  
  291.  
  292.  
  293. 4.2. Makeconf
  294.   The  Makeconf  file  is read by odemake before any other Makefiles and sets a
  295. few basic variables. Its location is used by odemake  to  determine  two  other
  296. variables.
  297.  
  298. CONFIG          Selects  what  configuration  options are chosen for the kernel
  299.                 and Unix server. Defined in Makeconf.
  300.  
  301. MAKEOBJDIR      The directory in which the objects are  placed.    If  this  is
  302.                 undefined  the objects are put in the source directory. Defined
  303.                 in Makeconf as a function of OBJECTDIR
  304.  
  305. MAKESRCPATH     The base of the Master sources if you are shadowing.    Set  in
  306.                 Makeconf if SOURCEDIR is defined.
  307.  
  308. MAKECONF        Defined  by  odemake  as  the absolute pathname of the Makeconf
  309.                 file that it is using.  This value is used in our Makefiles  to
  310.                 determine  the  base of the source and/or object,release trees.
  311.                 Exported to the environment.
  312.  
  313. MAKETOP         Defined by odemake as the relative pathname from the  directory
  314.                 in  which  odemake  was invoked to the directory containing the
  315.                 Makeconf file.
  316.  
  317.  
  318.  
  319. 4.3. Search path variables
  320.   odemake uses an agumented version of $VPATH to search for source files.    It
  321. gives  -I  flags  to  cc  and mig to search for header files, -I flags to md to
  322. shorten dependencies and -L flags to ld to search for libraries. The  variables
  323. that are used to set these values are:
  324.  
  325. VPATH           The  search  path  that  odemake  uses to find the prerequisite
  326.                 files when it is evaluating a dependency rule. This may be  set
  327.                 by individual Makefiles, but odemake expands any given names to
  328.                 include the same names in  the  source  tree  and  any  backing
  329.                 source  areas.  (See Shadowing) If a file name starts with "./"
  330.                 only the current directory, which is  normally  in  the  object
  331.                 tree, is searched.
  332.  
  333. INCDIRS and LIBDIRS
  334.                 set by setvar to the local export directory and and  master  or
  335.                 system release area. These directories are not expanded.
  336.  
  337. INCFLAGS and LIBFLAGS
  338.                 set in Makefiles and expanded by genpath relative to the  local
  339.                 source area, and any master source area.
  340.  
  341.  
  342.  
  343. 4.4. Building the mk tree
  344.   The make procedure for the mk tree is more complicated than a build of a tree
  345. of simple unrelated programs. The mk/Makefile has been  set  up  to  build  and
  346. install  the pieces of this tree in the order in which they are needed.  If you
  347. are not absolutely sure of what you are  doing  you  should  always  start  the
  348. odemake  in the directory mk. If you start off in one of the subdirectories you
  349. may either find that files are missing or you are getting incorrect versions of
  350. files  from  incorrect  directories.  The building of the kernel itself is also
  351. complicated by the  fact  that  it  needs  to  be  dynamically  configured  for
  352. different hardware platforms and configurations. This is accomplished following
  353. the tradition of BSD 4.3 of having the config program write the Makefile, named
  354. Makefile.internal, that will be used to build the kernel.
  355.  
  356.   Mach  has  the  added  complication  that the bootable kernel is built in two
  357. pieces: the kernel  itself  named  mach_kernel  and  the  default  pager  named
  358. bootstrap.  Another  program,  makeboot,  binds  the  two files together into a
  359. single load image named mach.boot as the final step of the kernel build.
  360.  
  361.   The layout of the mk source tree is as follows:
  362.  
  363. bootstrap       Makefile and sources to build the default pager.
  364.  
  365. conf            a link to kernel/conf.
  366.  
  367. include         contains the Makefiles to build,  export  and  install  the  mk
  368.                 collection  include  files  that  are  used  outside  of kernel
  369.                 builds.
  370.  
  371. user/libmach    Makefile  and  sources   to   build   crt0.o,   libmach.a   and
  372.                 libmach_sa.a
  373.  
  374. user/threads    Makefile and sources to build libthreads.a
  375.  
  376. kernel/src/{config,doconf,makeboot,mig}
  377.                 Makefiles and sources to build each of these programs which are
  378.                 needed to build the kernel
  379.  
  380. kernel/conf     The Makefile templates and configuration files that config uses
  381.                 to create the Makefile for the kernel, Makefile.internal.
  382.  
  383. kernel          The Makefile that starts off the building of the kernel and all
  384.                 the  kernel  sources. It ends up switching to the configuration
  385.                 directory  and  calling  odemake   with   the   newly   created
  386.                 Makefile.internal  as the Makefile that actually compiles files
  387.                 for the kernel.
  388.  
  389.   When you do a odemake in the mk directory, it will proceed to make and export
  390. all  of the export targets in each of the subdirectories in the EXPDIRS list in
  391. each Makefile in the order in which they appear. If you wish to start the  make
  392. at  any other place in this tree, you need to be sure that all the prerequisite
  393. tools, libraries and includes have been exported.
  394.  
  395.   In case you are curious what all the steps are doing this a  summary  of  the
  396. major ones:
  397.  
  398.    - cd kernel/src/mig/include; odemake MAKEFILE_PASS=FIRST
  399.      build_all
  400.      exports the include files that are needed to build mig.
  401.  
  402.    - kernel/src/mig
  403.      builds and exports mig.
  404.  
  405.    - cd include; odemake MAKEFILE_PASS=FIRST build_all
  406.      exports  all  the  kernel  include  files that are needed by external
  407.      programs
  408.  
  409.    - cd user/libmach; odemake MAKEFILE_PASS=FIRST build_all
  410.      builds and exports crt0.o, libmach.a and libmach_sa.a
  411.  
  412.    - cd user/threads; odemake MAKEFILE_PASS=FIRST build_all
  413.      builds and exports libthreads.a
  414.  
  415.    - cd makeboot; odemake MAKEFILE_PASS=SECOND build_all
  416.      builds and exports the default pager,
  417.  
  418.    - cd mk/kernel/src/makeboot; make  MAKEFILE_PASS=SECOND build_all
  419.      build and exports makeboot program
  420.  
  421.    - cd mk/kernel/src/config; make  MAKEFILE_PASS=SECOND build_all
  422.      build and exports config program
  423.  
  424.    - cd mk/kernel/src/doconf; make  MAKEFILE_PASS=SECOND build_all
  425.      exports doconf script
  426.  
  427.    - cd kernel/conf; odemake MAKEFILE_PASS=BASIC  build_all
  428.      Runs the Makefile that is in the conf directory, which runs doconf to
  429.      generate    the    <CONF>    file    from    MASTER,    MASTER.local,
  430.      <target_cpu>/{MASTER,MASTER.local} Then cds<CONFIG>; runs the  config
  431.      program     which     reads     the    <CONF>    file,    conf/files,
  432.      conf/<target_cpu>/files.                            conf/template.mk,
  433.      conf/<target_cpu>/template.mk  and generates the options .h files and
  434.      the Makefile.internal in the object directory.
  435.  
  436.    - cd <CONFIG>; make MAKEFILE_PASS=BASIC  build_all
  437.      runs the generated Makefile that builds the kernel.
  438.  
  439.   There are  several  shortcut  targets  that  can  be  used  carefully  during
  440. repetitive kernel builds.
  441.  
  442.    - cd mk/kernel; odemake kernel
  443.      exports  any  kernel  headers you might have changed and rebuilds the
  444.      kernel.
  445.  
  446.    - cd mk/kernel; odemake kernel_only
  447.      only builds the kernel, does not worry about changes to header files.
  448.  
  449.    - cd mk/kernel/<CONFIG>; odemake file.o
  450.      Can be used after you create an empty directory with the CONFIG  name
  451.      to recompile one file.
  452.  
  453.    - cd mk/kernel/<CONFIG>; odemake relink
  454.      Can  be used after recompiling a few .o files. Does not check for any
  455.      out-of-date dependencies.
  456.  
  457. 5. Configurations
  458.   Both the mach kernel and Unix server use a modified version of the BSD config
  459. program  to  write  Makefile.internal which is used to build the kernel/server.
  460. There  are  three  types  of  files  that  provide  input  to  config:  MASTER,
  461. template.mk and files.
  462.  
  463.   The  MASTER  files  define the various individual configuration options and a
  464. few macro configuration names that are combinations of individual options.  For
  465. each  machine  type  the options from MASTER, MASTER.local, <traget_cpu>/MASTER
  466. and <target_cpu>/MASTER.local are combined by the doconf script into a file  in
  467. the  object  directory with the name conf/<CONFIG>.  Thus if you are building a
  468. STD+WS configuration of the  kernel,  the  file  obj/@sys/mk/kernel/conf/STD+WS
  469. will contain all the options selected for this configuration.
  470.  
  471.   The  files  files  simply list each file, conditionalized by the options that
  472. will select it, that is to be used in the kernel or server.   Again  the  files
  473. and  <target_cpu>/files  are combined. The lines OPTIONS/foo cause a file foo.h
  474. to be written into the object  directory  which  contains  a  #define  FOO  1|0
  475. depending on whether the option foo was selected or not.
  476.  
  477.   The template.mk and <target_cpu>/template.mk contain definitions and template
  478. rules for config to use in writing Makefile.internal.
  479.  
  480.   The Makeconf file defines the CONFIG variable which  is  used  to  chose  the
  481. configuration  to  build.  This  can be overridden by setting it on the command
  482. line to odemake.  For example the odemake command in the ux directory could be
  483.  
  484.      odemake CONFIG=STDVICE+WS
  485.  
  486. which would cause the non-AFS/NFS configuration of the Unix server to be built.
  487. It  is  also  possible  to  select  or remove specific options in the following
  488. manner: for example in mk
  489.  
  490.      odemake CONFIG=STD+WS-debug-ipc_debug
  491.  
  492. would disable the kernel debugging interfaces. Note:  we  do  not  expect  that
  493. most  randomly  chosen  configurations  would  either  build or work. There are
  494. several drivers for various machines which are not usually built and are likely
  495. to require some work before they will compile or run.
  496.  
  497. 6. Building the uk collection
  498.   Building  in  the  ux tree has some of the same complications as the mk tree.
  499. Again you should start your make from the ux directory, to ensure  that  things
  500. are   done   in   the  proper  order.  Here  it  is  only  important  that  the
  501. include/Makefile installs the .h files before the emulator and  server  try  to
  502. use them for building.
  503.  
  504.   The  config  program is used to write the Makefile.internal file that directs
  505. the building of the Unix server just as it did for the  kernel.  Configurations
  506. are  again  specified  by the files in the ux/server/conf directory. Because of
  507. license restrictions on the Unix server sources, you may not be able  to  build
  508. the  default configuration that we build at CMU. This configuration, STDAFS+WS,
  509. requires sources for the kernel support for NFS and AFS. If  you  do  not  have
  510. source  liceses  for  these,  you  will  need  to change the CONFIG variable to
  511. STDVICE+WS. CONFIG is defined in ux/Makeconf.  It can either be  changed  there
  512. or defined on the command line to odemake.
  513.  
  514. 7. Special files
  515.   A  release area contains several primary subdirectories.  Most of these, bin,
  516. lib, include, etc, man should be familiar to you.  The special subdirectory  is
  517. where the following binaries are installed:
  518.         mach.boot.<version>.<config>
  519.         emulator.<version>
  520.         vmunix.<version>.<config>
  521. where  <version>  is  a string like MK69 or UX31, and <config> is a string like
  522. STD+ANY or STDAFS+WS.
  523.  
  524.   These files should be copied from the special directory when installing  them
  525. in / or /mach_servers.  The files in the object directory are NOT stripped. For
  526. all kernels MK68  and  later,  you  should  install  and  boot  mach.boot,  NOT
  527. mach_kernel.    mach.boot  is  produced from bootstrap and mach_kernel with the
  528. makeboot program.  What name you give mach.boot in / or /../..  is of course  a
  529. matter  for  you and your boot loader to decide.  For more detailed information
  530. on installing these programs see the document Setup for Mach 3.0.
  531.  
  532. 8. Shadowing
  533.   The Makefiles also support shadowing.  With shadowing, you can have a "system
  534. source  area" which contains most source files, and a "local source area" which
  535. only contains files that you have changed.  In the extreme, the only  file  you
  536. need  in  your  local  source area is the top-level Makeconf.  (Each collection
  537. contains one Makeconf now, at top-level.)  A shadow build searches  your  local
  538. source  area for files and directories first, and then checks the system source
  539. area for files and directories.  To do shadowing, you  should  call  setvar.csh
  540. with   -masterbase   option.      For   example,   if   your   local   area  is
  541. /usr/rvb/mymach3/src/mk       and       the        system        area        is
  542. /afs/cs/project/mach3/latest/src/mk then:
  543.  
  544.        cd /usr/rvb/mymach3/src/mk/bootstrap
  545.        setvar -masterbase /afs/cs/project/mach3/latest i386_mach
  546.        odemake
  547.  
  548. does  a  shadow  build  of  bootstrap  in  the mk collection.  Any libraries or
  549. include files that are not in your local release area  will  be  found  in  the
  550. system  release  area,  /afs/cs/project/mach3/release/latest/@sys.  The object,
  551. export  and  release  files  you  build  will   be   placed   respectivley   in
  552. /usr/rvb/mymach3/{obj,export,release}/@sys.
  553.  
  554. 9. Other Topics
  555.  
  556.  
  557.  
  558. 9.1. Supping
  559.   If you are not at CMU the standard way to get both the sources and the system
  560. release area is to use our Software Upgrade Protocol program (SUP) to copy  the
  561. files  over  the  Internet.  There  is  a  different collection for each source
  562. subtree and one for the system release area. Different licenses are required to
  563. get  permission  to sup the different collections. Your machine must be enabled
  564. in our host tables to sup these collections.  Information on  all  the  details
  565. can  be  found in /usr/mach/public/doc/notes/mach3_sup which can be FTP'ed from
  566. mach.cs.cmu.edu as user anonymous.
  567.  
  568.  
  569.  
  570. 9.2. m3tree
  571.   If you are at CMU and have read access to the mach3 archive area, you can get
  572. a  copy  of  the  sources  by  using  the  m3tree script. Use of this script is
  573. documented   by    calling    it    with    the    -help    option    and    in
  574. /afs/cs/project/mach/public/doc/notes/mach3_cmu.{ps.doc}.
  575.  
  576.  
  577.  
  578. 9.3. How to run Mach 3.0
  579.   See   the   document   Setup   for   Mach   3.0   which   can   be  found  in
  580. /usr/mach/public/doc/mach3/mach3_setup.{ps,doc}
  581.                                Table of Contents
  582. 1. Introduction                                                               0
  583. 2. Bootstraping the ODE tools                                                 0
  584. 3. Setting the environment for odemake                                        0
  585.      3.1. setvar                                                              0
  586.      3.2. Environment variables                                               0
  587. 4. Building from a set of sources                                             1
  588.      4.1. Make variables                                                      1
  589.      4.2. Makeconf                                                            1
  590.      4.3. Search path variables                                               1
  591.      4.4. Building the mk tree                                                1
  592. 5. Configurations                                                             2
  593. 6. Building the uk collection                                                 2
  594. 7. Special files                                                              2
  595. 8. Shadowing                                                                  2
  596. 9. Other Topics                                                               2
  597.      9.1. Supping                                                             2
  598.      9.2. m3tree                                                              2
  599.      9.3. How to run Mach 3.0                                                 2
  600.