X-Git-Url: https://deadsoftware.ru/gitweb?p=cpc.git;a=blobdiff_plain;f=src%2Fgeneric%2FDsw%2FMod%2FMakeMain.cp;h=6512555a8fd33bef5be1006dd08d986a7049e337;hp=5c84f5296973d52dd8df3146e4eee924c5bade84;hb=afeb8a7fb135a5d8b7d40399b61e6e1e283fe4b0;hpb=4bf6d419bd3ba4bc8902de1607e60fdced58590d diff --git a/src/generic/Dsw/Mod/MakeMain.cp b/src/generic/Dsw/Mod/MakeMain.cp index 5c84f52..6512555 100644 --- a/src/generic/Dsw/Mod/MakeMain.cp +++ b/src/generic/Dsw/Mod/MakeMain.cp @@ -29,7 +29,8 @@ MODULE DswMakeMain; module = 75; eof = 76; (* module state flags *) - imported = 0; trace = 1; hasObj = 2; hasSym = 3; hasErrors = 4; library = 5; + imported = 0; trace = 1; hasObj = 2; hasSym = 3; hasErrors = 4; + library = 5; force = 6; debugImport = FALSE; debugOrder = FALSE; @@ -56,7 +57,7 @@ MODULE DswMakeMain; END; VAR (* options *) - auto, trap, clean: BOOLEAN; + auto, trap, clean, symonly: BOOLEAN; exe, target, base: String; jobs: INTEGER; @@ -96,7 +97,7 @@ MODULE DswMakeMain; i := IdentLen(n); IF i # 0 THEN IF ~((n[i] = 0X) OR (((n[i] = "+") OR (n[i] = "-")) & (n[i + 1] = 0X))) THEN - Error("defines: expectd + or - after identifier (^0)", n, "", 0) + Error("expectd + or - after selector identifier (^0)", n, "", 0) END; v := n[i] # "-"; n[i] := 0X; s := def; WHILE (s.next # NIL) & (s.next.name$ # n$) DO s := s.next END; @@ -108,7 +109,7 @@ MODULE DswMakeMain; ELSIF overwrite THEN s.next.value := v END - ELSE Error("defines: '^0' not valid identifier", n, "", 0) + ELSE Error("selector '^0' have invalid identifier", n, "", 0) END END Define; @@ -156,6 +157,8 @@ MODULE DswMakeMain; Log.String("Options:"); Log.Ln; Log.String(" -a Enable automatic dependency resolution"); Log.Ln; Log.String(" -c Remove all generated files"); Log.Ln; + Log.String(" -s Generate symbol files only"); Log.Ln; + Log.String(" -d selector Add selector"); Log.Ln; Log.String(" -t target Specify target rules"); Log.Ln; Log.String(" -o file Generate object file"); Log.Ln; Log.String(" -j num Specifies the number of jobs to run simultaneously"); Log.Ln; @@ -170,11 +173,14 @@ MODULE DswMakeMain; exe := NIL; auto := FALSE; jobs := 1; def.next := NIL; mno := 0; rno := 0; target := NewStr("default"); base := NewStr("cprules"); LOOP - CASE DswOpts.GetOpt("acdgo:t:j:f:") OF + CASE DswOpts.GetOpt("acd:sgGo:t:j:f:") OF | "a": auto := TRUE | "c": clean := TRUE - | "d": trap := TRUE + | "g": trap := TRUE + | "G": Kernel.intTrap := TRUE + | "s": symonly := TRUE | "f": base := DswOpts.str + | "d": Define(DswOpts.str, TRUE) | "h": Help | "j": jobs := MIN(MAX(StrToInt(DswOpts.str, 1), 1), maxJobs) | "o": exe := DswOpts.str @@ -350,6 +356,7 @@ MODULE DswMakeMain; ParseModule(m); DevCPR.Check; ok := DevCPM.noerr; + IF DevCPR.used THEN INCL(m.flags, force) END; DevCPR.Close; DevCPM.InsertMarks; DevCPM.Close; @@ -521,6 +528,14 @@ MODULE DswMakeMain; p := DswProcs.dir.New(); p.Program(base + "/" + target + "/" + "build"); p.PutParam(m.odc); + IF force IN m.flags THEN p.PutParam("-f") END; + IF symonly OR (library IN m.flags) THEN p.PutParam("-s") END; + s := def.next; + WHILE s # NIL DO + IF s.value THEN p.PutParam("-D") ELSE p.PutParam("-d") END; + p.PutParam(s.name$); + s := s.next + END; RETURN p END PrepareCompiler; @@ -578,7 +593,7 @@ MODULE DswMakeMain; PROCEDURE Link; VAR p: DswProcs.Process; ok: BOOLEAN; i, res: INTEGER; BEGIN - IF exe # NIL THEN + IF ~symonly & (exe # NIL) THEN p := DswProcs.dir.New(); p.Program(base + "/" + target + "/" + "link"); p.PutParam(exe$);