home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-01-24 | 2.3 KB | 74 lines | [TEXT/????] |
- MODULE Make;
-
- (*
- * MAKEMAKE. Create a MAKEFILE for a MODULA-2 program.
- *
- * Written by Steve Tynor, 30 September 1986.
- * UUCP : tynor@gitpyr
- * USNAIL: 2550 Akers Mill Rd. T-2, Atlanta GA. 30339
- *
- * Permission is granted to distribute, copy and change this program as long
- * as this notice remains...
- ---
- *
- * Make.
- * Modified and extended for MacMETH by :
- * J?rgen N?rgaard, 23 october 1987.
- * UUCP : jnp@daimi.dk
- * MAIL : Dybb?lvej 29, v?r. 2+3, 8240 Risskov, DENMARK
- *
- * Essentially only the parser remains from the original.
- * Extensions are a dependency-tree and a make-like facility.
- *
- *)
-
- (* Usage :
- * Enter the name of the module,
- * "name" (assumed to have extension .MOD) to make.
- * Output (if successful) name.CMD file for the compiler-utility 'cmd-1'
- *)
-
- IMPORT System, InOut, StringLib0, FileSystem, MakeForest, MakeParser;
-
- VAR
- modulename : MakeForest.NameString;
- filename : System.Path;
- thisEntity : MakeForest.EntityPtr;
- makeFile : FileSystem.File;
- success : BOOLEAN;
- i : INTEGER;
-
- BEGIN
- InOut.WriteString ("Make which MODULE ? ");
- InOut.ReadString(modulename);
- WHILE (InOut.termCH # 3C) DO (* Not terminated *)
- InOut.WriteLn;
- MakeForest.RemoveTree(MakeForest.root);
- IF MakeForest.AddModule(modulename, MakeForest.root, thisEntity) THEN
- MakeParser.ParseModule (modulename, MakeParser.main,
- thisEntity, filename, success);
- IF success THEN
- i := StringLib0.Length(filename) - 1;
- filename[i - 3] := '.'; filename[i - 2] := 'C';
- filename[i - 1] := 'M'; filename[i] := 'D';
- FileSystem.Lookup(makeFile, filename, TRUE);
- IF NOT (makeFile.res = FileSystem.done) THEN
- InOut.WriteString('Could not open .CMD-file');
- ELSE
- MakeForest.Make(MakeForest.root, makeFile);
- FileSystem.Close(makeFile);
- InOut.WriteString('+ ');
- InOut.WriteString(filename);
- END;
- ELSE
- InOut.WriteString('Missing file');
- END;
- ELSE
- InOut.WriteString('Serious error! (in "MakeForest")');
- END;
- InOut.WriteLn;
- InOut.WriteString ("Make which MODULE ? ");
- InOut.ReadString(modulename);
- END;
- END Make.
-