Artur Efimov 6 years ago
parent
commit
ef3291f594
4 changed files with 53 additions and 15 deletions
  1. 4 4
      data/bin/compile.bat
  2. 22 5
      data/bin/compile.sh
  3. 26 5
      data/bin/link_console.sh
  4. 1 1
      data/bin/link_graph.sh

+ 4 - 4
data/bin/compile.bat

@@ -3,9 +3,9 @@ REM This script is run by Free Oberon on Windows. Current directory of the
 REM script will be where FreeOberon.exe is located.
 REM script will be where FreeOberon.exe is located.
 CD bin >nul 2>&1
 CD bin >nul 2>&1
 SET CURDIR=%~dp0
 SET CURDIR=%~dp0
-SET PATH=%CURDIR%voc\bin;%CURDIR%mingw32\bin;%PATH%
+SET PATH=%CURDIR%voc/bin;%CURDIR%mingw32/bin;%PATH%
 ECHO ON
 ECHO ON
-@CALL voc -OC -cfF %2 ..\Programs\%1
-@SET MYEXITCODE=%ERRORLEVEL%
+@CALL voc -OC -cfF %2 ../Programs/%1
+@SET RETCODE=%ERRORLEVEL%
 @ECHO OFF
 @ECHO OFF
-EXIT /b %MYEXITCODE%
+EXIT /b %RETCODE%

+ 22 - 5
data/bin/compile.sh

@@ -1,12 +1,29 @@
 @ECHO OFF
 @ECHO OFF
 REM This script is run by Free Oberon on Windows. Current directory of the
 REM This script is run by Free Oberon on Windows. Current directory of the
-REM script will be where FreeOberon.exe is located. This
-REM particular script is for console programs.
+REM script will be where FreeOberon.exe is located. This particular script
+REM is for console programs.
 CD bin >nul 2>&1
 CD bin >nul 2>&1
 @DEL /s %~n1.exe >nul 2>&1
 @DEL /s %~n1.exe >nul 2>&1
 SET CURDIR=%~dp0
 SET CURDIR=%~dp0
+SET ONAME=%~n1
 SET PATH=%CURDIR%voc\bin;%CURDIR%mingw32\bin;%PATH%
 SET PATH=%CURDIR%voc\bin;%CURDIR%mingw32\bin;%PATH%
+
+REM Put all arguments starting from 2nd to ARGS.
+SHIFT
+SET ARGS=%1
+SHIFT
+:START
+IF [%1] == [] GOTO FINISH
+SET ARGS=%ARGS% %1
+SHIFT
+GOTO START
+:FINISH
+REM END Put all... ARGS.
+
 ECHO ON
 ECHO ON
-gcc -fPIC -g -I "%CURDIR%voc/C/include" -o %~n1.exe %~n1.o -L"%CURDIR%voc/lib" -lvoc-OC -lmingw32
-SET MYEXITCODE=%ERRORLEVEL%
-EXIT /b %MYEXITCODE%
+gcc -fPIC -g -I "%CURDIR%voc\C\include"^
+ -o %ONAME%.exe %ONAME%.o^
+ %ARGS%^
+ -L"%CURDIR%voc\lib" -lvoc-OC -lmingw32
+@SET RETCODE=%ERRORLEVEL%
+@EXIT /b %RETCODE%

+ 26 - 5
data/bin/link_console.sh

@@ -1,12 +1,33 @@
 @ECHO OFF
 @ECHO OFF
 REM This script is run by Free Oberon on Windows. Current directory of the
 REM This script is run by Free Oberon on Windows. Current directory of the
-REM script will be where FreeOberon.exe is located. This
-REM particular script is for graphical programs.
+REM script will be where FreeOberon.exe is located. This particular script
+REM is for graphical programs.
 CD bin >nul 2>&1
 CD bin >nul 2>&1
 @DEL /s %~n1.exe >nul 2>&1
 @DEL /s %~n1.exe >nul 2>&1
 SET CURDIR=%~dp0
 SET CURDIR=%~dp0
+SET ONAME=%~n1
 SET PATH=%CURDIR%voc\bin;%CURDIR%mingw32\bin;%PATH%
 SET PATH=%CURDIR%voc\bin;%CURDIR%mingw32\bin;%PATH%
+
+REM Put all arguments starting from 2nd to ARGS.
+SHIFT
+SET ARGS=%1
+SHIFT
+:START
+IF [%1] == [] GOTO FINISH
+SET ARGS=%ARGS% %1
+SHIFT
+GOTO START
+:FINISH
+REM END Put all... ARGS.
+
 ECHO ON
 ECHO ON
-gcc -fPIC -g -I "%CURDIR%voc/C/include" -o %~n1.exe %~n1.o "%CURDIR%voc/lib/Graph.o" "%CURDIR%voc/lib/SDL2.o" -L"%CURDIR%voc/lib" -lvoc-OC -w -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2 -lSDL2_image
-SET MYEXITCODE=%ERRORLEVEL%
-EXIT /b %MYEXITCODE%
+gcc -fPIC -g -I "%CURDIR%voc/C/include"^
+ -o %ONAME%.exe %ONAME%.o^
+ %ARGS%^
+ "%CURDIR%voc/lib/Graph.o"^
+ "%CURDIR%voc/lib/SDL2.o"^
+ -L"%CURDIR%voc/lib" -lvoc-OC^
+ -w -Wl,-subsystem,windows -lmingw32^
+ -lSDL2main -lSDL2 -lSDL2_image
+@SET RETCODE=%ERRORLEVEL%
+@EXIT /b %RETCODE%

+ 1 - 1
data/bin/link_graph.sh

@@ -14,7 +14,7 @@ BEGIN
       VALUE "LegalCopyright", "Free Oberon"
       VALUE "LegalCopyright", "Free Oberon"
       VALUE "OriginalFilename", "FreeOberon.exe"
       VALUE "OriginalFilename", "FreeOberon.exe"
       VALUE "ProductName", "Free Oberon"
       VALUE "ProductName", "Free Oberon"
-      VALUE "ProductVersion", "0.1.0"
+      VALUE "ProductVersion", "1.0.3"
     END
     END
   END
   END
   BLOCK "VarFileInfo"
   BLOCK "VarFileInfo"