umk: Can now name makefile, can now execute the binary

git-svn-id: svn://ultimatepp.org/upp/trunk@14303 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-04-13 16:16:55 +00:00
parent f9849847fb
commit cbb168bfcf
4 changed files with 157 additions and 156 deletions

View file

@ -219,8 +219,6 @@ void SetVar(const String& var, const String& val, bool save = true);
String GetCurrentBuildMethod(); String GetCurrentBuildMethod();
String GetCurrentMainPackage(); String GetCurrentMainPackage();
int GetHydraThreads();
String GetAnyFileName(const char *path); String GetAnyFileName(const char *path);
String GetAnyFileTitle(const char *path); String GetAnyFileTitle(const char *path);
String CatAnyPath(String path, const char *more); String CatAnyPath(String path, const char *more);

View file

@ -18,30 +18,37 @@ topic "UMK - Command line builder";
[s11; [* UMK] (U`+`+ MaKe) is a command line utility to build the U`+`+ [s11; [* UMK] (U`+`+ MaKe) is a command line utility to build the U`+`+
program, with U`+`+ assembly/package/build method system.&] program, with U`+`+ assembly/package/build method system.&]
[s0; &] [s0; &]
[s0;i224;O9; [*C3 umk ][*C@(0.0.255)3 assembly package build`_method][*C@4;3 [s0;i224;O9; [*C3 umk ][*C@(0.0.255)3 assembly package ][*C3 `[][*C@(0.0.255)3 build`_method][*C3 `]
][*C3 `[`-`[][*C@4;3 a][*C3 `]`[][*C@4;3 b][*C3 `]`[][*C@4;3 u][*C3 `]`[][*C@4;3 r][*C3 `]`[][*C@4;3 s ][*C@4;3 ][*C3 `[`-`[][*C@4;3 a][*C3 `]`[][*C@4;3 b][*C3 `]`[][*C@4;3 u][*C3 `]`[][*C@4;3 r][*C3 `]`[
][*C3 `]`[][*C@4;3 S][*C3 `]`[][*C@4;3 v][*C3 `]`[][*C@4;3 m][*C3 `]`[][*C@4;3 d][*C3 `]`[][*C@4;3 M][*C3 `] ][*C@4;3 s][*C3 `]`[][*C@4;3 S][*C3 `]`[][*C@4;3 v][*C3 `]`[][*C@4;3 m][*C3 `]`[][*C@4;3 d][*C3 `]`[][*C@4;3 M
`[][*C@4;3 l][*C3 `]`[][*C@4;3 x][*C3 `]`[][*C@4;3 X][*C3 `]`[][%-*C@4;3 H][%-*/C@3;3 n][*C3 `]`]][*C@4;3 ][*C3 `]`[][*C@4;3 M`=][*/C@3;3 makefile][*C3 `]`[][*C@4;3 l][*C3 `]`[][*C@4;3 x][*C3 `]`[][*C@4;3 X
][*C3 `[`+][*C@(0.0.255)3 FLAG][*C3 `[,][*C@(0.0.255)3 FLAG][*C3 `]...`]][*C@4;3 ][*C3 `]`[][%-*C@4;3 H][%-*/C@3;3 n][*C3 `]`]..][*C@4;3 ][*C3 `[`+][*C@(0.0.255)3 FLAG][*C3 `[,][*C@(0.0.255)3 F
][*C3 `[][*C@(0.0.255)3 out][*C3 `]]&] LAG][*C3 `]..`]][*C@4;3 ][*C3 `[][*C@(0.0.255)3 out][*C3 `] `[][*C@4;3 !][*C3
`[][*C@(0.0.255)3 runarg][*C3 `]..`]]&]
[s0;3 &] [s0;3 &]
[s11; [*@(0.0.255) assembly] can be a predefined assembly (in .var file) [s11; [*@(0.0.255) assembly] is a direct set of package nest directories
which is in Win32 in directory where is located umk.exe or in relative to working directory that represent U`+`+ assembly separated
POSIX systems in directories [@3 `~], [@3 `~/.upp/umk], [@3 `~/.upp/theide] by `',`'. Alternatively it can be a predefined assembly (in .var
or [@3 `~/.upp/theide]. Alternatively, it is a direct set of directories file) which is in Win32 in directory where is located umk.exe
that represent U`+`+ assembly separated by `',`'.&] or in POSIX systems in directories [@3 .config/u`+`+/umk ]or [@3 .config/u`+`+/theide
] or direct path to .var file.&]
[s11; [*@(0.0.255) package ]is the main package (a program to build).&] [s11; [*@(0.0.255) package ]is the main package (a program to build).&]
[s11; [*@(0.0.255) build`_method] is build method that is to be used [s11; [*@(0.0.255) build`_method] is build method that is to be used
to build the resulting executable, specified either as name of to build the resulting executable, specified either as name of
build method (which is then searched for in [@3 `~], [@3 `~/.upp/umk], build method (which is then searched for in [@3 .config/u`+`+/umk
[@3 `~/.upp/theide] [@3 `~/.upp/theide] directories) or it is a direct ]or [@3 .config/u`+`+/theide] directories) or it is a direct path
path to the .bm file.&] to the .bm file. If not specified, [* CLANG] build method is assumed.
Note that in POSIX, umk automatically creates [* CLANG] and [* GCC]
build methods if they do not exist.&]
[s11; [*@(0.0.255) FLAG][* s] are [^topic`:`/`/ide`/app`/Flags`$en`-us^ compilation [s11; [*@(0.0.255) FLAG][* s] are [^topic`:`/`/ide`/app`/Flags`$en`-us^ compilation
flags]. If flags are not specified, the first main configuration flags]. If flags are not specified, the first main configuration
entry in .upp file is used.&] entry in .upp file is used.&]
[s11; [*@(0.0.255) out] is output file or directory.&] [s11; [*@(0.0.255) out] overrides output name, file or directory.&]
[s11; [*C@4;3 !] means the the resulting binary should be also executed
after successful build, using optional arguments after [*C@4;3 !]
as its arguments.&]
[s0;*C@4;3 &] [s0;*C@4;3 &]
[ {{1089:8911h1;@1 [s0; [3 Option]] [ {{1914:8086h1;@1 [s0; [3 Option]]
:: [s0; [3 Description]] :: [s0; [3 Description]]
::^@2 [s0; [*C@4;3 a]] ::^@2 [s0; [*C@4;3 a]]
::= [s0; [3 Rebuild all.]] ::= [s0; [3 Rebuild all.]]
@ -54,7 +61,7 @@ entry in .upp file is used.&]
::^ [s0; [*C@4;3 m]] ::^ [s0; [*C@4;3 m]]
::= [s0; [3 Create a map file.]] ::= [s0; [3 Create a map file.]]
::^ [s0; [*C@4;3 r]] ::^ [s0; [*C@4;3 r]]
::= [s0; [3 Release mode]] ::= [s0; [3 Release mode (default is debug mode with full debug).]]
::^ [s0; [*C@4;3 d]] ::^ [s0; [*C@4;3 d]]
::= [s0; [3 Debug mode without debug symbols.]] ::= [s0; [3 Debug mode without debug symbols.]]
::^ [s0; [*C@4;3 s]] ::^ [s0; [*C@4;3 s]]
@ -64,19 +71,12 @@ entry in .upp file is used.&]
::^ [s0; [*C@4;3 v]] ::^ [s0; [*C@4;3 v]]
::= [s0; [3 Be verbose.]] ::= [s0; [3 Be verbose.]]
::^ [s0; [*C@4;3 M]] ::^ [s0; [*C@4;3 M]]
::= [s0; [3 Create makefile (to file ][*@4;3 out][3 ).]] ::= [s0; [3 Create makefile (to file ][*3 Makefile][3 ).]]
::^ [s0; [*C@4;3 x]] ::^ [s0; [%-*C@4;3 M`=][*/C@3;3 makefile]]
::= [s0; [3 Export project (to directory ][*@4;3 out][3 ), export only files ::= [s0; [3 Create mafile with given name.]]
used.]]
::^ [s0; [*C@4;3 X]]
::= [s0; [3 Export project (to directory ][*@4;3 out][3 ), export all files.]]
::^ [s0; [*C@4;3 xM]]
::= [s0; [3 Export makefile (to directory ][*@4;3 out][3 ).]]
::^ [s0;%- [*C@4;3 k]]
::= [s0; [3 Do not delete target directory ][*@4;3 out][3 when exporting.]]
::^ [s0;%- [*C@4;3 H][*/C@3;3 n]] ::^ [s0;%- [*C@4;3 H][*/C@3;3 n]]
::= [s0; [3 Number of threads used for building (single digit). Default ::= [s0; [3 Number of threads used for building. Default is number of logical
is number of logical cores available.]]}}&] cores available.]]}}&]
[s12; &] [s12; &]
[s12; 2. Examples&] [s12; 2. Examples&]
[s0;*C@5+92 &] [s0;*C@5+92 &]

View file

@ -1,10 +1,10 @@
TITLE("UMK - Command line builder") TITLE("UMK - Command line builder")
COMPRESSED COMPRESSED
120,156,173,87,11,79,220,70,16,254,43,43,145,180,16,140,111,95,126,221,169,18,9,144,4,37,36,85,40,106,212,147,19,175,237,189,187,45,126,213,246,17,80,20,126,123,103,215,62,195,17,231,81,169,8,113,190,241,204,55,51,223,60,118,153,43,206,253,153,160,206,236,242,213,219,96,70,209,163,71,196,194,59,204,35,204,119,24,225,212,133,63,132,17,234,80,198,137,79,3,238,51,230,227,105,146,137,166,9,231,25,245,125,99,68,45,186,67,61,135,18,143,251,220,39,204,243,41,216,82,140,41,246,168,67,56,243,169,51,77,101,147,132,115,12,234,12,124,4,46,11,48,193,216,35,4,51,234,97,230,112,66,24,5,8,234,81,130,157,169,44,210,112,254,210,157,105,3,14,6,216,113,49,198,46,160,113,142,1,93,155,113,70,24,166,204,33,129,227,78,99,185,84,69,56,255,58,37,231,135,41,121,120,170,90,153,247,25,9,62,123,114,232,204,8,152,186,150,187,227,129,91,238,128,179,64,103,196,192,140,82,215,9,136,195,33,36,142,233,180,150,255,172,85,45,115, 120,156,157,87,137,110,219,72,18,253,149,94,56,217,177,99,89,234,131,167,132,1,156,216,57,140,92,139,120,141,29,172,192,12,155,100,75,34,204,67,195,38,29,27,65,242,237,83,213,164,104,209,230,38,193,26,134,69,21,171,94,85,189,58,186,189,76,45,203,91,72,110,47,174,223,126,244,23,156,60,121,194,38,244,64,184,76,120,182,96,22,119,224,15,19,140,219,92,88,204,227,190,229,9,225,209,121,156,73,173,131,101,198,61,207,24,241,9,63,224,174,205,153,107,121,150,199,132,235,113,176,229,148,114,234,114,155,89,194,227,246,60,81,58,14,150,20,212,5,248,240,29,225,83,70,169,203,24,21,220,165,194,182,24,19,28,32,184,203,25,181,231,170,72,130,229,27,103,129,6,22,24,80,219,161,148,58,128,102,89,20,208,209,204,18,76,80,46,108,230,219,206,60,82,235,180,8,150,143,83,178,127,154,146,75,231,105,173,242,46,35,105,45,158,157,218,11,6,166,206,196,57,112,193,173,101,131,51,31,51,18,96,198,185,99,251,204,182,32,36,139,242,121,165,254,106,
89,180,61,130,34,132,146,89,76,188,25,132,112,123,123,107,19,142,59,166,60,136,133,96,136,155,18,144,65,30,30,113,2,28,56,62,241,49,243,56,117,60,72,189,18,181,200,251,76,98,78,103,125,30,190,229,239,184,196,5,70,177,15,241,59,1,0,96,72,2,62,129,72,7,126,153,63,109,123,99,109,167,141,2,43,216,1,146,152,131,189,0,123,220,115,56,100,66,137,75,128,72,172,243,135,50,76,139,178,206,69,22,206,133,207,102,79,222,185,186,13,176,38,13,120,194,196,165,28,2,195,64,52,7,175,196,247,57,241,28,159,5,174,59,77,68,213,170,178,232,188,137,222,35,33,22,33,59,28,234,201,52,115,158,3,132,17,227,25,7,132,114,32,29,59,142,55,109,229,53,208,21,107,143,92,91,81,109,133,61,223,229,4,252,113,40,15,88,128,95,48,32,240,76,28,207,245,192,74,181,153,12,231,218,143,142,16,255,224,103,122,44,23,98,157,129,163,207,31,191,60,62,121,115,112,113,142,230,13,193,51,52,223,39,62,71,23,103,175,80,116,128,142,202,60,23, 210,74,229,170,168,59,132,148,49,206,22,17,115,23,16,194,247,239,223,167,204,162,45,83,46,196,194,40,196,205,25,200,32,15,151,217,62,245,109,143,121,84,184,22,183,93,72,125,43,43,153,119,153,68,22,95,116,121,120,19,239,192,97,14,48,74,61,136,223,246,1,128,66,18,240,9,68,218,240,43,188,121,221,25,163,29,26,249,19,255,0,72,18,54,117,125,234,90,174,109,65,38,156,57,12,136,164,152,63,148,97,94,148,85,46,179,96,41,61,177,120,246,201,193,54,160,72,26,240,68,153,195,45,8,140,2,209,22,120,101,158,103,49,215,246,132,239,56,243,88,110,235,180,44,90,111,178,243,200,216,132,177,3,11,234,41,144,57,215,6,194,152,241,76,125,198,45,32,157,218,182,59,175,213,45,208,21,161,71,11,173,56,90,81,215,115,44,6,254,44,40,15,88,128,95,48,96,240,204,108,215,113,193,42,173,51,21,44,209,15,70,72,127,242,51,63,87,43,217,100,224,232,235,159,223,158,190,252,112,114,117,73,150,154,209,5,89,30,51,207,34,87,239,223,146,240,
69,138,50,85,72,20,175,85,150,202,58,252,37,4,77,58,67,196,70,167,69,91,151,233,58,209,201,26,49,1,128,39,218,58,68,187,23,209,126,180,143,206,196,43,185,135,84,131,4,74,238,163,173,91,149,169,246,6,181,101,7,140,218,149,68,157,73,85,151,75,168,149,133,62,169,118,213,203,96,174,100,30,103,55,147,74,36,151,98,41,39,157,81,46,219,85,153,162,230,166,129,54,181,117,8,144,66,247,161,40,229,186,67,32,160,35,134,214,249,37,10,225,233,112,23,219,216,134,38,217,99,3,38,234,49,187,64,162,143,29,168,209,230,51,134,140,29,67,209,60,58,136,230,131,84,244,210,240,158,44,30,145,213,35,178,102,68,118,62,34,187,26,145,229,35,178,116,68,118,54,34,203,70,100,215,35,178,247,247,101,143,15,122,233,75,243,60,57,58,100,240,165,24,84,194,17,162,246,31,82,253,252,245,211,23,155,183,214,119,94,134,182,109,143,33,62,52,41,215,237,198,34,236,202,205,208,93,3,222,105,14,53,14,81,34,10,20,75,104,195,170,150,169,92,64,15, 132,156,149,121,46,139,132,100,105,161,72,212,164,89,162,170,224,159,1,104,242,5,97,83,114,81,212,85,153,52,49,38,107,196,12,0,158,161,117,64,14,175,194,227,240,152,188,151,111,213,17,73,53,145,36,222,71,107,234,52,75,235,59,82,151,45,48,169,55,138,180,38,219,170,92,67,173,38,228,75,90,111,58,25,204,149,202,163,236,110,182,149,241,181,92,171,89,107,148,171,122,83,38,68,223,105,104,211,41,134,0,41,180,31,41,231,22,118,8,4,116,38,72,147,95,147,0,158,78,15,233,148,78,161,73,142,68,143,73,58,76,163,32,72,184,124,168,104,124,133,127,182,206,58,165,192,40,89,11,65,122,179,240,164,51,69,169,220,233,237,201,162,17,89,51,34,171,70,100,122,68,118,57,34,187,25,145,229,35,178,100,68,246,126,76,22,254,14,207,179,179,83,129,64,242,90,173,82,108,180,71,122,217,136,236,118,68,246,199,190,236,233,73,39,125,99,158,59,47,69,175,18,76,167,35,52,31,63,172,207,171,119,207,95,239,222,78,126,240,18,224,198,234,246,208,162,
166,119,29,176,171,10,100,95,137,26,45,84,6,237,250,105,165,146,149,110,90,16,255,169,10,70,245,67,10,187,44,105,203,250,6,94,203,90,234,215,89,153,136,22,112,160,187,108,121,45,81,89,107,197,223,223,158,159,190,239,123,178,185,111,169,100,131,230,135,16,244,109,104,245,15,19,123,93,85,19,176,127,32,129,105,80,169,12,53,226,136,216,70,79,179,86,214,133,104,213,149,204,110,44,164,218,110,196,58,79,168,145,45,42,23,91,126,219,149,104,81,45,33,249,6,246,241,131,169,2,3,189,30,117,42,241,13,138,126,181,162,95,237,81,58,55,147,18,170,198,12,108,46,32,189,141,112,87,108,70,119,152,234,189,113,152,237,65,211,161,111,141,179,137,85,123,40,117,197,214,13,132,181,181,38,32,7,216,93,170,88,34,32,61,89,183,34,206,164,133,154,74,38,106,161,64,89,194,222,144,53,100,135,10,145,75,205,196,22,252,238,80,94,80,43,32,119,81,39,43,48,91,116,229,251,143,21,26,147,221,35,126,207,52,197,118,121,42,1,123,13,50,210,185,216,113, 108,234,157,1,217,139,252,31,173,112,196,160,106,10,89,173,7,78,218,30,20,228,126,42,238,13,250,198,11,218,185,72,96,73,198,53,209,170,38,229,170,111,198,66,233,186,123,85,86,169,210,164,82,153,172,211,27,133,35,243,165,172,174,211,98,221,191,135,57,218,200,26,84,182,149,210,176,111,31,76,13,96,227,250,171,85,66,162,59,18,254,54,9,127,155,146,231,89,173,170,194,64,130,70,90,147,88,22,36,82,16,16,128,36,80,231,2,212,123,132,195,180,32,211,27,89,17,172,255,17,249,178,73,227,13,134,15,226,255,164,133,224,248,112,31,205,151,141,170,20,190,206,202,216,184,133,249,155,170,91,69,202,10,21,255,245,241,242,226,143,110,106,245,190,37,230,185,60,21,100,26,151,197,42,93,207,26,76,99,102,134,23,44,31,191,129,165,145,38,42,64,216,142,197,173,132,157,1,12,245,177,78,71,75,208,143,60,196,136,155,39,151,16,197,78,120,40,119,59,168,95,79,71,227,48,195,205,128,9,15,246,146,41,10,122,40,145,216,70,3,17,131,125,7,197,130,
110,154,110,156,168,126,52,96,99,32,1,45,55,255,208,150,149,74,162,105,52,137,38,224,41,154,136,170,138,38,207,51,177,108,162,71,178,136,14,214,205,7,189,103,43,149,9,189,148,209,66,191,130,126,57,93,116,143,6,166,40,219,59,182,44,19,198,66,213,77,219,149,51,41,139,133,90,174,235,14,0,154,5,58,94,143,7,36,104,34,213,169,232,154,140,71,172,39,83,107,192,103,181,110,59,3,96,96,24,158,126,73,247,3,14,95,208,231,207,4,251,193,212,15,8,89,145,217,33,65,102,137,207,25,122,219,29,162,225,116,58,136,142,225,174,84,171,65,254,225,144,246,175,134,173,12,210,223,6,245,119,178,43,188,200,50,219,232,111,107,199,219,218,23,141,68,207,94,159,254,241,215,152,110,182,173,123,14,121,193,24,229,101,42,199,180,243,109,237,163,90,194,112,65,3,228,162,227,112,204,166,126,24,123,38,5,68,164,93,140,104,167,219,218,199,144,233,210,232,154,83,19,216,71,169,17,53,55,121,92,102,205,152,195,230,235,244,155,21,244,135,62,161,227,90,232, 37,140,133,4,110,226,166,150,81,166,38,68,111,85,156,174,82,80,86,176,0,85,5,69,32,133,204,21,118,199,0,254,176,175,2,168,21,80,100,89,197,27,48,91,181,44,255,63,68,238,21,226,200,20,171,30,244,232,142,93,12,126,26,229,45,193,228,98,69,138,178,190,143,123,130,135,192,217,187,231,31,94,7,195,128,17,74,235,38,87,201,148,124,40,107,213,17,212,53,196,196,108,105,217,212,101,14,93,25,203,12,218,46,174,20,244,143,222,3,196,19,4,190,189,62,59,27,130,67,31,173,48,174,59,146,148,38,28,117,155,234,122,188,108,221,78,128,165,74,36,244,233,242,115,93,110,211,56,156,135,179,112,6,52,132,51,185,221,134,179,87,153,92,235,240,137,42,194,147,70,127,198,227,107,155,226,8,150,5,89,225,171,192,100,110,30,13,204,3,14,144,163,85,90,193,20,155,230,106,233,110,170,22,0,102,20,198,4,103,170,217,110,13,141,72,14,118,200,120,196,184,147,72,121,163,170,10,226,211,248,117,219,212,166,43,38,173,117,63,1,48,126,123,16,187,213,
238,29,51,59,255,177,25,210,199,124,79,125,243,83,160,87,219,160,207,36,186,146,117,92,54,163,76,157,141,178,155,139,75,105,218,109,23,70,203,60,192,228,24,125,115,90,48,180,55,134,117,189,141,117,114,93,149,117,171,247,216,223,122,82,53,212,221,222,127,136,103,193,254,49,234,101,1,59,84,187,236,39,99,196,207,251,255,195,15,244,113,231,102,52,147,179,81,23,91,180,124,219,199,61,196,199,7,3,230,229,131,46,43,205,238,72,161,53,129,240,86,212,75,56,104,190,137,169,207,201,162,15,29,150,245,184,7,184,85,220,221,41,182,156,189,89,231,49,108,113,216,222,237,10,42,156,118,220,154,45,109,90,75,239,255,221,6,254,66,110,169,90,170,118,207,70,253,181,86,47,160,98,48,207,202,165,74,68,6,139,173,214,173,121,37,96,57,198,102,6,191,124,217,92,102,55,159,212,6,222,68,94,1,199,195,162,114,246,3,218,95,42,77,216,230,187,190,80,194,70,108,234,4,193,34,70,47,142,142,224,194,28,215,40,218,127,113,113,106,157,159,159,80,235,252,229, 5,36,201,162,109,245,97,227,69,41,236,46,88,16,155,178,1,42,113,252,51,93,118,237,136,243,191,130,37,65,116,19,199,74,235,85,147,181,148,67,165,52,26,151,230,154,35,51,72,127,221,224,61,79,119,6,123,142,161,121,83,148,239,52,186,83,186,83,128,47,228,235,87,230,51,107,238,81,207,217,176,197,41,35,230,20,95,10,242,177,189,69,5,243,121,47,58,135,203,114,149,246,242,207,167,188,123,213,31,187,32,253,189,87,255,164,218,22,129,94,154,26,253,161,118,52,212,190,210,138,188,120,119,241,239,255,142,233,102,67,221,75,32,29,246,108,94,38,106,76,187,121,140,92,3,5,170,222,171,210,136,89,62,52,59,51,221,15,227,151,203,182,73,198,108,170,135,41,103,74,130,59,140,140,28,38,237,61,15,155,43,1,46,214,173,216,92,172,160,154,89,43,60,26,131,77,134,176,231,67,107,104,192,14,80,223,229,81,153,233,49,8,253,152,4,189,129,73,193,43,96,84,73,92,50,99,102,151,63,55,51,91,160,43,173,254,37,208,155,33,232,11,69,96,152,162,
211,119,39,199,250,112,232,207,133,31,96,76,214,77,61,49,195,50,209,135,9,64,234,195,225,39,81,191,23,167,236,51,66,207,202,60,110,250,88,69,188,65,29,0,99,253,250,91,81,78,54,40,150,57,15,187,176,59,64,48,29,130,173,175,190,134,133,127,63,123,208,48,252,23,38,108,133,136, 82,143,82,250,126,180,12,187,219,15,57,132,13,104,30,96,135,128,114,127,41,18,100,200,100,127,189,25,191,68,141,251,48,192,166,64,107,56,153,11,51,227,123,168,79,79,250,40,223,220,99,22,67,176,15,77,30,193,20,150,184,16,1,55,105,55,139,57,23,12,105,48,187,83,114,126,223,26,69,175,159,149,107,220,188,176,173,42,100,249,70,194,198,139,76,223,125,251,182,187,248,239,62,249,148,188,188,149,249,54,83,186,159,105,251,216,231,221,5,220,196,105,190,227,90,135,53,167,171,152,192,246,194,213,13,255,92,68,21,9,143,95,95,93,76,46,47,95,242,201,229,155,231,159,94,158,147,240,251,238,36,250,9,198,172,209,213,204,212,125,6,210,25,64,226,113,244,139,168,63,138,83,117,25,145,23,101,30,233,46,86,25,237,80,123,192,8,95,255,175,40,103,59,148,9,126,233,194,110,1,193,180,15,182,186,121,12,11,255,170,119,160,65,240,55,46,145,234,251,

View file

@ -4,6 +4,8 @@ bool SilentMode;
String GetUmkFile(const char *fn) String GetUmkFile(const char *fn)
{ {
if(DirectoryExists(fn) || *fn == '.')
return Null;
String h = ConfigFile(fn); String h = ConfigFile(fn);
if(FileExists(h)) if(FileExists(h))
return h; return h;
@ -48,21 +50,6 @@ void Puts(const char *s)
Cout() << s; Cout() << s;
} }
int CommaSpace(int c)
{
return c == ',' ? ' ' : c;
}
int IsCommaOrColon(int c)
{
return c == ':' || c == ',' ? c : 0;
}
int GetHydraThreads()
{
return CPU_Cores();
}
String GetAndroidSDKPath() String GetAndroidSDKPath()
{ {
return String(); return String();
@ -82,24 +69,100 @@ CONSOLE_APP_MAIN
TheIde(&ide); TheIde(&ide);
ide.console.SetSlots(CPU_Cores()); ide.console.SetSlots(CPU_Cores());
ide.console.console = true; ide.console.console = true;
const Vector<String>& arg = CommandLine();
if(arg.GetCount() >= 3) { ide.debug.def.blitz = ide.release.def.blitz = 0;
for(int i = 3; i < arg.GetCount(); i++) ide.debug.def.debug = 2;
if(arg[i][0] == '-') { ide.release.def.debug = 0;
String x = arg[i]; ide.debug.package.Clear();
for(int i = 1; i < x.GetCount(); i++) { ide.release.package.Clear();
if(x[i] == 'l') ide.debug.linkmode = ide.release.linkmode = 0;
SilentMode = true; ide.release.createmap = ide.debug.createmap = false;
if(x[i] == 'v') ide.targetmode = 0;
ide.console.verbosebuild = true; ide.use_target = false;
ide.makefile_svn_revision = false;
bool clean = false;
bool makefile = false;
bool deletedir = true;
int exporting = 0;
bool run = false;
String mkf;
Vector<String> param, runargs;
const Vector<String>& args = CommandLine();
for(int i = 0; i < args.GetCount(); i++) {
String a = args[i];
if(*a == '-') {
for(const char *s = ~a + 1; *s; s++)
switch(*s) {
case 'a': clean = true; break;
case 'r': ide.targetmode = 1; break;
case 'm': ide.release.createmap = ide.debug.createmap = true; break;
case 'b': ide.release.def.blitz = ide.debug.def.blitz = 1; break;
case 's': ide.debug.linkmode = ide.release.linkmode = 1; break;
case 'd': ide.debug.def.debug = 0; break;
case 'S': ide.debug.linkmode = ide.release.linkmode = 2; break;
case 'v': ide.console.verbosebuild = true; break;
case 'l': SilentMode = true; break;
case 'x': exporting = 1; break;
case 'X': exporting = 2; break;
case 'k': deletedir = false; break;
case 'u': ide.use_target = true; break;
case 'M': {
makefile = true;
if(s[1] == '=') {
mkf = NormalizePath(s + 2);
PutVerbose("Generating Makefile: " + mkf);
goto endopt;
}
else
PutVerbose("Generating Makefile");
break;
} }
} case 'H': {
String v = GetUmkFile(arg[0] + ".var"); int n = 0;
if(*arg[0] == '.' || IsNull(v) || !FileExists(v)) { while(IsDigit(s[1])) {
n = 10 * n + s[1] - '0';
s++;
}
n = minmax(n, 1, 32);
PutVerbose("Hydra threads: " + AsString(n));
ide.console.SetSlots(n);
break;
}
default:
SilentMode = false;
Puts("Invalid build option(s)");
SetExitCode(3);
return;
}
endopt:;
}
else
if(*a == '+')
ide.mainconfigparam = Filter(~a + 1, [](int c) { return c == ',' ? ' ' : c; });
else
if(*a == '!') {
run = true;
for(int j = i + 1; j < args.GetCount(); j++)
runargs.Add(args[j]);
if(runargs)
PutVerbose("Set to execute the result with args: " << Join(runargs, " "));
else
PutVerbose("Set to execute the result");
break;
}
else
param.Add(a);
}
if(param.GetCount() >= 2) {
String v = GetUmkFile(param[0] + ".var");
if(IsNull(v)) {
#ifdef PLATFORM_POSIX #ifdef PLATFORM_POSIX
Vector<String> h = Split(arg[0], IsCommaOrColon); Vector<String> h = Split(param[0], [](int c) { return c == ':' || c == ',' ? c : 0; });
#else #else
Vector<String> h = Split(arg[0], ','); Vector<String> h = Split(param[0], ',');
#endif #endif
for(int i = 0; i < h.GetCount(); i++) for(int i = 0; i < h.GetCount(); i++)
h[i] = GetFullPath(TrimBoth(h[i])); h[i] = GetFullPath(TrimBoth(h[i]));
@ -120,14 +183,14 @@ CONSOLE_APP_MAIN
PutVerbose("Assembly: " + GetVar("UPP")); PutVerbose("Assembly: " + GetVar("UPP"));
} }
PutVerbose("Output directory: " + GetVar("OUTPUT")); PutVerbose("Output directory: " + GetVar("OUTPUT"));
v = SourcePath(arg[1], GetFileTitle(arg[1]) + ".upp"); v = SourcePath(param[1], GetFileTitle(param[1]) + ".upp");
PutVerbose("Main package: " + v); PutVerbose("Main package: " + v);
if(!FileExists(v)) { if(!FileExists(v)) {
Puts("Package does not exist\n"); Puts("Package does not exist\n");
SetExitCode(2); SetExitCode(2);
return; return;
} }
ide.main = arg[1]; ide.main = param[1];
ide.wspc.Scan(ide.main); ide.wspc.Scan(ide.main);
const Workspace& wspc = ide.IdeWorkspace(); const Workspace& wspc = ide.IdeWorkspace();
if(!wspc.GetCount()) { if(!wspc.GetCount()) {
@ -138,7 +201,7 @@ CONSOLE_APP_MAIN
const Array<Package::Config>& f = wspc.GetPackage(0).config; const Array<Package::Config>& f = wspc.GetPackage(0).config;
if(f.GetCount()) if(f.GetCount())
ide.mainconfigparam = f[0].param; ide.mainconfigparam = f[0].param;
String m = arg[2]; String m = 2 < param.GetCount() ? param[2] : "CLANG";
String bp = GetBuildMethodPath(m); String bp = GetBuildMethodPath(m);
PutVerbose("Build method: " + bp); PutVerbose("Build method: " + bp);
if(bp.GetCount() == 0) { if(bp.GetCount() == 0) {
@ -147,90 +210,14 @@ CONSOLE_APP_MAIN
SetExitCode(3); SetExitCode(3);
return; return;
} }
ide.method = m;
ide.debug.def.blitz = ide.release.def.blitz = 0;
ide.debug.def.debug = 2;
ide.release.def.debug = 0;
ide.debug.package.Clear();
ide.release.package.Clear();
ide.debug.linkmode = ide.release.linkmode = 0;
ide.release.createmap = ide.debug.createmap = false;
ide.targetmode = 0;
ide.use_target = false;
ide.makefile_svn_revision = false;
bool clean = false;
bool makefile = false;
bool deletedir = true;
int exporting = 0;
String mkf;
for(int i = 3; i < arg.GetCount(); i++) if(3 < param.GetCount()) {
if(arg[i][0] == '+' || arg[i][0] == '>') ide.debug.target_override = ide.release.target_override = true;
ide.mainconfigparam = Filter(~arg[i] + 1, CommaSpace); ide.debug.target = ide.release.target = NormalizePath(param[3]);
else PutVerbose("Target override: " << ide.debug.target);
if(arg[i][0] == '-') { }
String x = arg[i];
for(int i = 1; i < x.GetCount(); i++) ide.method = m;
switch(x[i]) {
case 'a':
clean = true;
break;
case 'r':
ide.targetmode = 1;
break;
case 'm':
ide.release.createmap = ide.debug.createmap = true;
break;
case 'b':
ide.release.def.blitz = ide.debug.def.blitz = 1;
break;
case 's':
ide.debug.linkmode = ide.release.linkmode = 1;
break;
case 'd':
ide.debug.def.debug = 0;
break;
case 'S':
ide.debug.linkmode = ide.release.linkmode = 2;
break;
case 'M':
makefile = true;
break;
case 'v':
ide.console.verbosebuild = true;
break;
case 'l':
break;
case 'x':
exporting = 1;
break;
case 'X':
exporting = 2;
break;
case 'k':
deletedir = false;
break;
case 'H':
if(i + 1 < x.GetCount() && x[i + 1] >= '1' && x[i + 1] <= '9')
ide.console.SetSlots(x[++i] - '0');
else
ide.console.SetSlots(1);
break;
case 'u':
ide.use_target = true;
break;
default:
SilentMode = false;
Puts("Invalid build option(s)");
SetExitCode(3);
return;
}
}
else {
ide.debug.target_override = ide.release.target_override = true;
ide.debug.target = ide.release.target = NormalizePath(arg[i]);
PutVerbose("Target override: " << ide.debug.target);
}
if(clean) if(clean)
ide.Clean(); ide.Clean();
@ -249,13 +236,29 @@ CONSOLE_APP_MAIN
SetExitCode(0); SetExitCode(0);
} }
else else
if(ide.Build()) if(ide.Build()) {
SetExitCode(0); SetExitCode(0);
if(run) {
Vector<char *> args;
Vector<Buffer<char>> buffer;
auto Add = [&](const String& s) {
auto& b = buffer.Add();
b.Alloc(s.GetCount() + 1);
memcpy(b, s, s.GetCount() + 1);
args.Add(b);
};
Add(ide.target);
for(const String& s : runargs)
Add(s);
args.Add(NULL);
SetExitCode(execv(ide.target, args.begin()));
}
}
else else
SetExitCode(1); SetExitCode(1);
} }
else else
Puts("Usage: umk assembly main_package build_method -options [+flags] [output]\n\n" Puts("Usage: [-options] umk assembly main_package [build_method] [+flags] [output]\n\n"
"Examples: umk examples Bombs GCC -ab +GUI,SHARED ~/bombs\n" "Examples: umk examples Bombs GCC -ab +GUI,SHARED ~/bombs\n"
" umk examples,uppsrc Bombs ~/GCC.bm -rv +GUI,SHARED ~/bin\n\n" " umk examples,uppsrc Bombs ~/GCC.bm -rv +GUI,SHARED ~/bin\n\n"
"See http://www.ultimatepp.org/app$ide$umk$en-us.html for details\n"); "See http://www.ultimatepp.org/app$ide$umk$en-us.html for details\n");