DEADSOFTWARE

cpmake: add hand-link mode (default behavior)
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Mon, 24 Feb 2020 15:17:03 +0000 (18:17 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Mon, 24 Feb 2020 15:17:03 +0000 (18:17 +0300)
src/generic/Dsw/Mod/MakeMain.cp

index 9df3961d6c067c22ccc57a3672d525ed4631c20b..8e68f87b001903a82a4156c9becf12862ad997b6 100644 (file)
@@ -67,7 +67,7 @@ MODULE DswMakeMain;
     END;
 
   VAR
     END;
 
   VAR
-    err: INTEGER;
+    werr, err: INTEGER;
     mno, rno: INTEGER; (* num modules *)
     modList, lnkList, cmpList: ARRAY maxImps OF Module;
     def: Selector; (* with head, global list of selectors *)
     mno, rno: INTEGER; (* num modules *)
     modList, lnkList, cmpList: ARRAY maxImps OF Module;
     def: Selector; (* with head, global list of selectors *)
@@ -257,9 +257,7 @@ MODULE DswMakeMain;
     Log.String("  -Xi path     Use executable file for internal linker (native only)"); Log.Ln;
     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("  -Xi path     Use executable file for internal linker (native only)"); Log.Ln;
     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("  -a           Enable automatic dependency resolution"); 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;
     Log.String('  -D ident["+"|"-"] Add preprocessor selector'); 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;
     Log.String('  -D ident["+"|"-"] Add preprocessor selector'); Log.Ln;
@@ -419,6 +417,9 @@ MODULE DswMakeMain;
         j := 0; (* find module in global list *)
         WHILE (j < mno) & (modList[j].name$ # name$) DO INC(j) END;
         IF j >= mno THEN
         j := 0; (* find module in global list *)
         WHILE (j < mno) & (modList[j].name$ # name$) DO INC(j) END;
         IF j >= mno THEN
+          IF ~auto THEN
+            Log.String("module " + name + " required before " + m.name); Log.Ln; INC(werr)
+          END;
           NEW(imp); imp.name := name$; imp.selectors := CopySelectorList(m.selectors);
           modList[mno] := imp; INC(mno)
         ELSE
           NEW(imp); imp.name := name$; imp.selectors := CopySelectorList(m.selectors);
           modList[mno] := imp; INC(mno)
         ELSE
@@ -613,6 +614,7 @@ MODULE DswMakeMain;
       END;
       INC(i)
     END;
       END;
       INC(i)
     END;
+    INC(err, werr);
     num := 0;
     FOR i := 0 TO rno - 1 DO
       Trace(modList[i], modList[i], num)
     num := 0;
     FOR i := 0 TO rno - 1 DO
       Trace(modList[i], modList[i], num)