MakeDoAndPCedar.tioga
Eduardo Pelegri-Llopart, January 16, 1990 3:21:43 pm PST
Last tweaked by Mike Spreitzer on December 9, 1988 5:43:10 pm PST
MakeDoAndPCedar
CEDAR7.0 — FOR INTERNAL XEROX USE ONLY
MakeDo And PCedar
Eduardo Pelegri-Llopart
© Copyright 1988 Xerox Corporation. All rights reserved.
Abstract: Briefly describes how MakeDo can deal with .mob, .c, .c2c.c and .o files, and the porting of MakeDo to PCedar.
Created by: Eduardo Pelegri-Llopart
Maintained by: Eduardo Pelegri-Llopart <Pelegri.pa>
Keywords: Make, Dependency, Consistency, Derive, File, DF File, Command, Compile, Bind, Order, Sequence, Portable Cedar, Mimosa
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
Commands
MakeDo now has client procedures that know about the creation of .mob, .c2c.c, and .o files. These clients are loaded on demand, to save GFI when you're running in PrincOps and don't need them.
Cc and Mimosa
Mimosa is reworked version of the Cedar/Mesa compiler. The intention is to eventually arrive at a compiler base that can have multiple targets. Mimosa does not generate BCD files; instead it generates MOB files for the symbol table information and C files for the executable code. The C files can be seen as intermediate files with the final result being the (UNIX) O files produced by the C compiler (and also a pass through the loader) [there is also a native code generator for the Dragon, but this code generator is currently mothballed], see MimosaDoc for more details.
The dependencies involved with Mimosa are similar to those with PrincOps compiler, except that BCD extensions are replaced by MOB extensions and that C and O files must be added when there is executable code (i.e. everything but DEFINITIONS files). The C files generated by Mimosa are renamed to have the extension .C2C.C to help differentiating them from user-written .C files. Files with extension .C2C.C produce files with extension .C2C.O.
The process of binding modules in Mimosa starts with a version of the PrincOps binder, called Cinder because, again, it generates C as intermediate code and includes (UNIX) "loading" the O files of the component modules into a single O file. Cinder accepts an extension of C/Mesa that includes a STATIC REQUEST statement to indicate that some files (outside the traditional Mesa/Cedar world) are required and should be included in the "loading" process. Typically these files correspond to O files generated by C files that do not correspond to any Mesa file.
MakeDo contains two different actions. The first action involves Mimosa and Cinder and generates foo.mob and foo.c from PROGRAM, or MONITOR file foo.mesa and CONFIG file foo.config, and foo.mob from DEFINTIONS file foo.mesa. The second action invoves the C compiler, the UNIX loader, and some transfer program (through the MMCCMesa et al commands) and converts foo.c into foo.o. The second action determines the correct invocation sequence to use based on whether there exists a foo.config or a foo.mesa file.
Mimosa and Cinder dependencies are similar to the PrincOps compiler. Cc dependencies are based on a version stamp encoded on the C files generated by Mimosa, and on create times if they are missing. The dependencies used for C are extracted from the #include "fileName" commands present in foo.c. Any reference to a path name in fileName (i.e. a "/") will cause the dependency to be ignored. Include commands of the form #include <fileName> are also ignored. The depencies do not take into account the role of the C preprocessor [so you can really shoot yourself in the foot if you want to].
Include dependencies that arise with some uses of TRUSTED MACHINE CODE are not modelled (yet). If I get requests, I'll get to it sooner.
The Cc actions give an special meaning to file names appearing in a DF file with an explicit directory part and ending with an .O extension. Such a file is assumed to be generated from a C file with a name obtained by replacing the .O by a .C and removing the explicit directory part. The transformation is performed as indicated in CcCommandsDoc, using the directory part to indicate the "remote binary directory". In addition, MakeDo gives specific semantics to several directory parts:
sun3> implies remote machine class of sun3 and compile switches of "-c -g"
sun4> implies sun4 and "-c -g"
sun4-o3> implies sun4 and "-c -O3"
sun4-profiled> implies sun4 and "-c -p"
29k> implies amd29000 and "-c -g"
Customizing the behavior of MakeDo
The actions used to construct .mob and .o objects can be modified by providing .switches files. If they exist, the contents of the file are passed as the value of the switches to Mimosa and ComplexCc, respectively. Switches passed to ComplexCc are interpreted as follows:
> If the contents of the switch file starts with a double quote ", the string inside the quotes is passed as a value to the -cSwitch of ComplexCc.
> If the contents starts with a colon :, then the file is expected to be of the form (:key:"string"<whitespace>)*, where (, ), <whitespace>, and * are meta-syntactic symbols. The valid keys are cSwitch, lSwitch, and lib (case non-significant). The strings are then used for the -cSwitch, the -lSwitch, and the -lib switch respectively. [this might be extended as necessary].
> Finally, if the contents of the switch file don't start with a colon, the complete contents of the file (beware of NLs and stuff like that!) is passed as the value to the -cSwitch. This usage is discouraged; use the "" convention instead.
MakeDo issues MMCCMesa, MMCCConfig and MMCCC commands. These commands are a simple layer on top of ComplexCc, MS, and cRCopy. It is possible to customize the action performed using the MakeDo.UnixCommandsSubstitutions user profile entry. This entry contains a sequence of either pairs of strings or the string "defaults". The pairs are TextReplace match and replace string literals (i.e. no patterns). Defaults expands to the sequence:
"${cpp}" "/lib/cpp"
"${awk}" "/bin/awk"
"${ccom}" "/lib/ccom"
"${msScript}" "/usr/local/bin/msScript"
"${cc}" "/bin/cc"
"${ld}" "/bin/ld"
"${rm}" "/bin/rm"
The MMCC* commands can also be redefined for more complex customization [NB: the specialization mechanisms used for the MMCC* commands and for switches should be identical].
The boolean-valued user profile entry MakeDo.dbxDebug requests the use of the MS program to allow Cedar/Mesa source-level debugging.
The token-valued user profile entry MakeDo.Reporter indicates what method to use to report on the progress of MakeDo.
MakeDo on PCedar
MakeDo has been ported to PCedar. The only "reporter" implemented in PCedar is "Files" [this will change soon now that we have PViewers], and none of the MDS user profile entries are meaningful; consequenlty, the -p argument only accepts one argument.
See the document LifeInPCedar.tioga for more details on how to use MakeDo on PCedar.
Sharing Code Between PCedar and PrincOps
[See also [Mimosa]<Mimosa>Documentation>DFPorterDoc.tioga]
The DF software is not very adequate to describe the sharing of code that we want between PCedar and PrincOps. We hope that we will move to something better soon (most likely based on the Jasmine project from BSDU). In the meantime we have an organization based on a tree of DFs, where the top level Foo-Source.df contains the files that are common to both PCedar and PrincOps worlds, the second level contains two files, Foo-PrincOps.df (or plain Foo.df), for PrincOps files, and Foo-PCR.df for PCedar files, and the third level may contain up to 3 files, Foo-Sun3.df, Foo-Sun4.df, and Foo-SoftCard.df, which are children of Foo-PCR.df and which contain files that are specific to the sun3, sun4, or SoftCard respectively. An example of this organization are the files describing MakeDo. They are:
[CedarChest7.0]<Top>MakeDo.df for the PrincOps files
[CedarChest7.0]<Top>MakeDo-Source.df for the files shared between PrincOps and PCedar
[PCedarChest1.0]<Top>MakeDo-PCR.df for common PCedar files
[PCedarChest1.0]<Top>MakeDo-Sun4.df for Sun4-specific files.
Because of this organization, it is not meaningful to "MakeVerify" any of these DF files on isolation. Instead, MakeVerify should be invoked with a "path" in the DF tree. The two paths that correspond to the above organization are:
MakeVerify MakeDo-Source.df MakeDo.df
and
MakeVerify MakeDo-Sourcesource.df MakeDo-PCR.df MakeDo-Sun4.df
Moreover, since some goals end up being in DF files other than the "leaves" of the "paths", the proper way to redo the packages would be:
MakeDo -rgom MakeDo-Source.df -rgom MakeDo.df
and
MakeDo -rgom MakeDo-Source.df -rgom MakeDo-PCR.df -rgom MakeDo-Sun4.df
Since typying these commands is cumbersome, each "leaf" DF file is expected to contain comments with the commands so that they can just be SHIFT-selected into a command tool.
Finally, note that the use of "qbo" and "smodel" must be changed. It is still correct to obtain the exported files from a DF file by just doing "qbo -p Foo.df", but to bring over all the files before making changes to a package, the whole path of files should be brought. In the above case:
qbo MakeDo-Source.df MakeDo.df
and
qbo MakeDo-Source.df MakeDo-PCR.df MakeDo-Sun4.df
And similarly for smodel.
Until all the PCedar DF files have been converted (and even after if we are not careful), it will be delicate to share the PCeadr and the PrincOps versions of a package in a local directory, but it can be done if you are pretty careful
A lingering problem with the DF-tree organization is that makeverify will complain when the structure of the intermediate DF nodes differs between the local disk and the remote location. What I do is to fix first all the other problems in the DFs first, then do an smodel of the MakeDo-Source.df, then another MakeVerify, then an smodel of the MakeDo-PCR.df, a MakeVerify, and an smodel of the MakeDo-Sun4.df. Or you can do the MakeVerify after all the smodels.