Изменения в параметрах командной строки

This commit is contained in:
AntKrotov committed 2020-01-21 10:05:24 +03:00
1 parent 83aa05a66a
commit 13059667e0
13 files changed
+86 -55

No files matched your search

BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1,2 +1,2 @@
for %%f in (samples\Windows\Console\*.ob07) do Compiler.exe %%f console64
for %%f in (samples\Windows\Console\*.ob07) do Compiler.exe %%f win64con
@pause
+1 -1
View File
@@ -1,2 +1,2 @@
Compiler.exe source\Compiler.ob07 kos -out source\Compiler.kex -stk 2
Compiler.exe source\Compiler.ob07 kosexe -out source\Compiler.kex -stk 2
@pause
+1 -1
View File
@@ -1,2 +1,2 @@
Compiler.exe source\Compiler.ob07 elfexe -out source\Compiler32 -stk 2
Compiler.exe source\Compiler.ob07 linux32exe -out source\Compiler32 -stk 2
@pause
+1 -1
View File
@@ -1,2 +1,2 @@
Compiler.exe source\Compiler.ob07 elfexe64 -out source\Compiler -stk 2
Compiler.exe source\Compiler.ob07 linux64exe -out source\Compiler -stk 2
@pause
+1 -1
View File
@@ -1,2 +1,2 @@
Compiler.exe source\Compiler.ob07 console -out source\Compiler32.exe -stk 2
Compiler.exe source\Compiler.ob07 win32con -out source\Compiler32.exe -stk 2
@pause
+1 -1
View File
@@ -1,2 +1,2 @@
Compiler.exe source\Compiler.ob07 console64 -out source\Compiler.exe -stk 2
Compiler.exe source\Compiler.ob07 win64con -out source\Compiler.exe -stk 2
@pause
+15 -14
View File
@@ -10,13 +10,14 @@ UTF-8 с BOM-сигнатурой.
Параметры:
1) имя главного модуля
2) тип приложения
"console" - Windows console
"gui" - Windows GUI
"dll" - Windows DLL
"kos" - KolibriOS
"obj" - KolibriOS DLL
"elfexe" - Linux ELF-EXEC
"elfso" - Linux ELF-SO
"win32con" - Windows console
"win32gui" - Windows GUI
"win32dll" - Windows DLL
"linux32exe" - Linux ELF-EXEC
"linux32so" - Linux ELF-SO
"kosexe" - KolibriOS
"kosdll" - KolibriOS DLL
3) необязательные параметры-ключи
-out <file_name> имя результирующего файла; по умолчанию,
совпадает с именем главного модуля, но с другим расширением
@@ -44,13 +45,13 @@ UTF-8 с BOM-сигнатурой.
Например:
Compiler.exe "C:\example.ob07" console -out "C:\example.exe" -stk 1
Compiler.exe "C:\example.ob07" dll -out "C:\example.dll"
Compiler.exe "C:\example.ob07" gui -out "C:\example.exe" -stk 4
Compiler.exe "C:\example.ob07" console -out "C:\example.exe" -nochk pti
Compiler.kex "/tmp0/1/example.ob07" kos -out "/tmp0/1/example.kex" -stk 4
Compiler.kex "/tmp0/1/example.ob07" obj -out "/tmp0/1/example.obj" -ver 2.7
Compiler.exe "C:\example.ob07" elfexe -out "C:\example" -stk 1 -nochk a
Compiler.exe "C:\example.ob07" win32con -out "C:\example.exe" -stk 1
Compiler.exe "C:\example.ob07" win32dll -out "C:\example.dll"
Compiler.exe "C:\example.ob07" win32gui -out "C:\example.exe" -stk 4
Compiler.exe "C:\example.ob07" win32con -out "C:\example.exe" -nochk pti
Compiler.kex "/tmp0/1/example.ob07" kosexe -out "/tmp0/1/example.kex" -stk 4
Compiler.kex "/tmp0/1/example.ob07" kosdll -out "/tmp0/1/mydll.obj" -ver 2.7
Compiler.exe "C:\example.ob07" linux32exe -out "C:\example" -stk 1 -nochk a
В случае успешной компиляции, компилятор передает код завершения 0, иначе 1.
При работе компилятора в KolibriOS, код завершения не передается.
+9 -8
View File
@@ -10,11 +10,12 @@ UTF-8 с BOM-сигнатурой.
Параметры:
1) имя главного модуля
2) тип приложения
"console64" - Windows64 console
"gui64" - Windows64 GUI
"dll64" - Windows64 DLL
"elfexe64" - Linux ELF64-EXEC
"elfso64" - Linux ELF64-SO
"win64con" - Windows64 console
"win64gui" - Windows64 GUI
"win64dll" - Windows64 DLL
"linux64exe" - Linux ELF64-EXEC
"linux64so" - Linux ELF64-SO
3) необязательные параметры-ключи
-out <file_name> имя результирующего файла; по умолчанию,
совпадает с именем главного модуля, но с другим расширением
@@ -41,9 +42,9 @@ UTF-8 с BOM-сигнатурой.
Например:
Compiler.exe "C:\example.ob07" console64 -out "C:\example.exe" -stk 1
Compiler.exe "C:\example.ob07" dll64 -out "C:\example.dll" -nochk pti
Compiler "source/Compiler.ob07" elfexe64 -out "source/Compiler" -nochk a
Compiler.exe "C:\example.ob07" win64con -out "C:\example.exe" -stk 1
Compiler.exe "C:\example.ob07" win64dll -out "C:\example.dll" -nochk pti
Compiler "source/Compiler.ob07" linux64exe -out "source/Compiler" -nochk a
В случае успешной компиляции, компилятор передает код завершения 0, иначе 1.
+39 -10
View File
@@ -130,6 +130,22 @@ BEGIN
END keys;
PROCEDURE OutTargetItem (target: INTEGER; text: ARRAY OF CHAR);
VAR
width: INTEGER;
BEGIN
width := 15;
width := width - LENGTH(TARGETS.Targets[target].ComLinePar) - 4;
C.String(" '"); C.String(TARGETS.Targets[target].ComLinePar); C.String("'");
WHILE width > 0 DO
C.String(20X);
DEC(width)
END;
C.StringLn(text)
END OutTargetItem;
PROCEDURE main;
VAR
path: PARS.PATH;
@@ -164,19 +180,32 @@ BEGIN
IF inname = "" THEN
C.Ln;
C.StringLn("Usage: Compiler <main module> <target> [optional settings]"); C.Ln;
C.StringLn("target =");
IF UTILS.bit_depth = 64 THEN
C.StringLn('target = console | gui | dll | console64 | gui64 | dll64 | kos | obj | elfexe | elfso | elfexe64 | elfso64 | msp430 | stm32'); C.Ln;
ELSIF UTILS.bit_depth = 32 THEN
C.StringLn('target = console | gui | dll | kos | obj | elfexe | elfso | msp430 | stm32'); C.Ln;
OutTargetItem(TARGETS.Win64C, "Windows64 Console");
OutTargetItem(TARGETS.Win64GUI, "Windows64 GUI");
OutTargetItem(TARGETS.Win64DLL, "Windows64 DLL");
OutTargetItem(TARGETS.Linux64, "Linux64 Exec");
OutTargetItem(TARGETS.Linux64SO, "Linux64 SO")
END;
OutTargetItem(TARGETS.Win32C, "Windows32 Console");
OutTargetItem(TARGETS.Win32GUI, "Windows32 GUI");
OutTargetItem(TARGETS.Win32DLL, "Windows32 DLL");
OutTargetItem(TARGETS.Linux32, "Linux32 Exec");
OutTargetItem(TARGETS.Linux32SO, "Linux32 SO");
OutTargetItem(TARGETS.KolibriOS, "KolibriOS Exec");
OutTargetItem(TARGETS.KolibriOSDLL, "KolibriOS DLL");
OutTargetItem(TARGETS.MSP430, "MSP430 microcontrollers");
OutTargetItem(TARGETS.STM32, "STM32 Cortex-M3 microcontrollers");
C.Ln;
C.StringLn("optional settings:"); C.Ln;
C.StringLn(" -out <file name> output"); C.Ln;
C.StringLn(" -stk <size> set size of stack in megabytes"); C.Ln;
C.StringLn(' -nochk <"ptibcwra"> disable runtime checking (pointers, types, indexes,');
C.StringLn(' BYTE, CHR, WCHR)'); C.Ln;
C.StringLn(" -ver <major.minor> set version of program ('obj' target)"); C.Ln;
C.StringLn(" -ram <size> set size of RAM in bytes ('msp430', 'stm32' target)"); C.Ln;
C.StringLn(" -rom <size> set size of ROM in bytes ('msp430', 'stm32' target)"); C.Ln;
C.StringLn(" -out <file name> output"); C.Ln;
C.StringLn(" -stk <size> set size of stack in Mbytes (Windows, Linux, KolibriOS)"); C.Ln;
C.StringLn(" -nochk <'ptibcwra'> disable runtime checking (pointers, types, indexes,");
C.StringLn(" BYTE, CHR, WCHR)"); C.Ln;
C.StringLn(" -ver <major.minor> set version of program (KolibriOS DLL)"); C.Ln;
C.StringLn(" -ram <size> set size of RAM in bytes (MSP430) or Kbytes (STM32)"); C.Ln;
C.StringLn(" -rom <size> set size of ROM in bytes (MSP430) or Kbytes (STM32)"); C.Ln;
UTILS.Exit(0)
END;
+16 -16
View File
@@ -38,14 +38,14 @@ TYPE
TARGET = RECORD
target, CPU, BitDepth, OS, RealSize: INTEGER;
ComLinePar, LibDir, FileExt: STRING
ComLinePar*, LibDir, FileExt: STRING
END;
VAR
Targets: ARRAY 14 OF TARGET;
Targets*: ARRAY 14 OF TARGET;
target*, CPU*, BitDepth*, OS*, RealSize*, WordSize*, AdrSize*: INTEGER;
ComLinePar*, LibDir*, FileExt*: STRING;
@@ -99,18 +99,18 @@ END Select;
BEGIN
Enter( MSP430, cpuMSP430, 16, 0, osNONE, "msp430", "MSP430", ".hex");
Enter( Win32C, cpuX86, 32, 8, osWIN32, "console", "Windows32", ".exe");
Enter( Win32GUI, cpuX86, 32, 8, osWIN32, "gui", "Windows32", ".exe");
Enter( Win32DLL, cpuX86, 32, 8, osWIN32, "dll", "Windows32", ".dll");
Enter( KolibriOS, cpuX86, 32, 8, osKOS, "kos", "KolibriOS", "");
Enter( KolibriOSDLL, cpuX86, 32, 8, osKOS, "obj", "KolibriOS", ".obj");
Enter( Win64C, cpuAMD64, 64, 8, osWIN64, "console64", "Windows64", ".exe");
Enter( Win64GUI, cpuAMD64, 64, 8, osWIN64, "gui64", "Windows64", ".exe");
Enter( Win64DLL, cpuAMD64, 64, 8, osWIN64, "dll64", "Windows64", ".dll");
Enter( Linux32, cpuX86, 32, 8, osLINUX32, "elfexe", "Linux32", "");
Enter( Linux32SO, cpuX86, 32, 8, osLINUX32, "elfso", "Linux32", ".so");
Enter( Linux64, cpuAMD64, 64, 8, osLINUX64, "elfexe64", "Linux64", "");
Enter( Linux64SO, cpuAMD64, 64, 8, osLINUX64, "elfso64", "Linux64", ".so");
Enter( STM32, cpuTHUMB, 32, 4, osNONE, "stm32", "STM32", ".hex");
Enter( MSP430, cpuMSP430, 16, 0, osNONE, "msp430", "MSP430", ".hex");
Enter( Win32C, cpuX86, 32, 8, osWIN32, "win32con", "Windows32", ".exe");
Enter( Win32GUI, cpuX86, 32, 8, osWIN32, "win32gui", "Windows32", ".exe");
Enter( Win32DLL, cpuX86, 32, 8, osWIN32, "win32dll", "Windows32", ".dll");
Enter( KolibriOS, cpuX86, 32, 8, osKOS, "kosexe", "KolibriOS", "");
Enter( KolibriOSDLL, cpuX86, 32, 8, osKOS, "kosdll", "KolibriOS", ".obj");
Enter( Win64C, cpuAMD64, 64, 8, osWIN64, "win64con", "Windows64", ".exe");
Enter( Win64GUI, cpuAMD64, 64, 8, osWIN64, "win64gui", "Windows64", ".exe");
Enter( Win64DLL, cpuAMD64, 64, 8, osWIN64, "win64dll", "Windows64", ".dll");
Enter( Linux32, cpuX86, 32, 8, osLINUX32, "linux32exe", "Linux32", "");
Enter( Linux32SO, cpuX86, 32, 8, osLINUX32, "linux32so", "Linux32", ".so");
Enter( Linux64, cpuAMD64, 64, 8, osLINUX64, "linux64exe", "Linux64", "");
Enter( Linux64SO, cpuAMD64, 64, 8, osLINUX64, "linux64so", "Linux64", ".so");
Enter( STM32, cpuTHUMB, 32, 4, osNONE, "stm32", "STM32", ".hex");
END TARGETS.
+1 -1
View File
@@ -24,7 +24,7 @@ CONST
max32* = 2147483647;
vMajor* = 1;
vMinor* = 22;
vMinor* = 23;
FILE_EXT* = ".ob07";
RTL_NAME* = "RTL";