From: DeaDDooMER Date: Mon, 20 Jul 2020 18:24:45 +0000 (+0300) Subject: cpmake: add option to define selectors from command line X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=afeb8a7fb135a5d8b7d40399b61e6e1e283fe4b0;p=cpc.git cpmake: add option to define selectors from command line --- diff --git a/src/generic/Dsw/Mod/MakeMain.cp b/src/generic/Dsw/Mod/MakeMain.cp index 7d98bdf..6512555 100644 --- a/src/generic/Dsw/Mod/MakeMain.cp +++ b/src/generic/Dsw/Mod/MakeMain.cp @@ -97,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; @@ -109,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; @@ -158,6 +158,7 @@ MODULE DswMakeMain; 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; @@ -172,12 +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("acdsgo: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