summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae26c07)
raw | patch | inline | side by side (parent: ae26c07)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Tue, 25 Feb 2020 13:02:12 +0000 (16:02 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Tue, 25 Feb 2020 13:02:12 +0000 (16:02 +0300) |
src/generic/Dsw/Mod/MakeMain.cp | patch | blob | history |
index 9cb6a98e7ed5de28fee74f202633123605f25b76..a5ba7c0df42506b10da45dc49702a6624c42e8f8 100644 (file)
Module = POINTER TO RECORD
name: DevCPT.Name;
- path: Files.Name;
+ odc: Files.Name;
selectors: Selector; (* with head, list of selectors for this module *)
depth: INTEGER; (* 0: leaf, MAX: root *)
dir: DevCPM.Directory;
auto: BOOLEAN;
jobs: INTEGER;
exe: String;
+ printCompileModList: BOOLEAN;
+ printLinkModList: BOOLEAN;
+ printCompileFileList: BOOLEAN;
PROCEDURE Error (e: INTEGER; IN p0, p1: ARRAY OF CHAR; i2: INTEGER);
VAR msg, p2: ARRAY 128 OF CHAR;
Log.String(" -Cg params Pass parameters to Component Pasacal compiler directly"); Log.Ln;
Log.String(" -Ci params Pass parameters to internal linker directly"); Log.Ln;
Log.String(" -II Trap on user interrupt"); Log.Ln;
+ Log.String(" -IC Print module list for compilation and quit"); Log.Ln;
+ Log.String(" -IL Print module list for linking and quit"); Log.Ln;
+ Log.String(" -Ic Print file list for compilation and quit"); Log.Ln;
+(*
+ Log.String(" -Il Print file list for linking and quit"); Log.Ln;
+*)
Log.String(" -a Enable automatic dependency resolution"); Log.Ln;
Log.String(" -o name Generate executable file"); Log.Ln;
Log.String(" -j num Specifies the number of jobs to run simultaneously"); Log.Ln;
PROCEDURE ParseInfoOpts;
BEGIN
- CASE DswOpts.GetOpt("I") OF
+ CASE DswOpts.GetOpt("CLcI") OF
| "I": Kernel.intTrap := TRUE
+ | "C": printCompileModList := TRUE
+ | "L": printLinkModList := TRUE
+ | "c": printCompileFileList := TRUE
| ":": Error(10, "-I" + DswOpts.str, "", 0)
| "?": Error(11, "-I" + DswOpts.str, "", 0)
| 0X: Error(11, "-I", "", 0)
i := 0; rno := mno;
WHILE (err = 0) & (i < mno) DO
m := modList[i];
- GetSource(m.name$, m.dir, m.path, src);
+ GetSource(m.name$, m.dir, m.odc, src);
IF src # NIL THEN
CheckModule(m, src, ok);
IF ~ok THEN INC(err) END
PROCEDURE PutPathList (w: DswProcs.Process; IN par: ARRAY OF CHAR; base: DevCPM.Directory);
BEGIN
IF base # NIL THEN
- PutPath(w, base.next); (* in revese order *)
+ PutPathList(w, par, base.next); (* in revese order *)
w.PutParam(par);
w.PutParam(base.path);
END
VAR w: DswProcs.Process; ok: BOOLEAN;
BEGIN
ASSERT(m # NIL, 20);
- ASSERT(m.path # "", 21);
+ ASSERT(m.odc # "", 21);
ASSERT(m.worker = NIL, 22);
w := DswProcs.dir.New();
w.Program(cpcExe);
w.PutParam("-legacy");
- PutPath(w, "-legacysymdir", m.dir);
+ PutPathList(w, "-legacysymdir", m.dir);
PutParams(w, cpcArgs);
CASE compiler OF
| cpfront:
ELSE
w.PutParam("-define-"); w.PutParam("DEV2");
END;
- w.PutParam(m.path);
+ w.PutParam(m.odc);
w.Execute(ok);
IF ok THEN
- Log.String("Compile " + m.name + " (" + m.path + ")"); Log.Ln;
+ Log.String("Compile " + m.name + " (" + m.odc + ")"); Log.Ln;
ELSE
w := NIL
END;
ASSERT(compiler = cpnative, 22);
p := DswProcs.dir.New();
p.Program(cplExe);
- PutPath(w, "-legacycodedir", dirList);
+ PutPathList(p, "-legacycodedir", dirList);
IF os # anyos THEN
p.PutParam("-os");
CASE os OF
END
END Link;
+ PROCEDURE PrintInfo;
+ VAR i: INTEGER;
+ BEGIN
+ IF printCompileModList THEN
+ FOR i := 0 TO mno - 1 DO
+ Log.String(cmpList[i].name$); Log.Char(" ")
+ END;
+ Log.Ln
+ ELSIF printLinkModList THEN
+ FOR i := 0 TO mno - 1 DO
+ IF ~(library IN lnkList[i].flags) THEN
+ Log.String(lnkList[i].name$); Log.Char(" ")
+ END
+ END;
+ Log.Ln
+ ELSIF printCompileFileList THEN
+ FOR i := 0 TO mno - 1 DO
+ Log.String(cmpList[i].odc); Log.Char(" ")
+ END;
+ Log.Ln
+(* ELSIF printLinkFileList THEN
+ FOR i := 0 TO mno - 1 DO
+ IF ~(library IN lnkList[i].flags) THEN
+ Log.String(lnkList[i].ocf); Log.Char(" ")
+ END
+ END;
+ Log.Ln*)
+ END
+ END PrintInfo;
+
PROCEDURE Main;
- VAR m: Module; s: Selector; p: DswProcs.Process; ok: BOOLEAN; i, res: INTEGER;
BEGIN
IF Kernel.trapCount = 0 THEN
ParseArgs;
IF err = 0 THEN
- CheckParams;
- IF err = 0 THEN
+ IF printCompileModList OR printLinkModList OR printCompileFileList THEN
+ auto := TRUE;
CheckDeps;
IF err = 0 THEN
- Compile;
+ PrintInfo
+ END
+ ELSE
+ CheckParams;
+ IF err = 0 THEN
+ CheckDeps;
IF err = 0 THEN
- Link
+ Compile;
+ IF err = 0 THEN
+ Link
+ END
END
END
END