Browse Source

libFreeOberon.a added, compile and link with Ofront+ on Windows works

Arthur Yefimov 4 years ago
parent
commit
492c4d8279
3 changed files with 40 additions and 24 deletions
  1. 6 2
      data/bin/compile.bat
  2. 14 12
      data/bin/link_graph.bat
  3. 20 10
      src/make.bat

+ 6 - 2
data/bin/compile.bat

@@ -3,9 +3,13 @@ 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 OFRDIR=%CURDIR%OfrontPlus\Target\Win64
+SET PATH=%OFRDIR%;%CURDIR%mingw32\bin;%PATH%
+SET OBERON=.;%OFRDIR%\Lib\Sym
+SET OFR=ofront+ -88 -C -s
+
 ECHO ON
 ECHO ON
-@CALL voc -OC -cfF %2 ../Programs/%1
+%OFR% %2 ..\Programs\%1
 @SET RETCODE=%ERRORLEVEL%
 @SET RETCODE=%ERRORLEVEL%
 @ECHO OFF
 @ECHO OFF
 EXIT /b %RETCODE%
 EXIT /b %RETCODE%

+ 14 - 12
data/bin/link_graph.bat

@@ -6,7 +6,11 @@ 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 ONAME=%~n1
-SET PATH=%CURDIR%voc\bin;%CURDIR%mingw32\bin;%PATH%
+SET OFRDIR=%CURDIR%OfrontPlus\Target\Win64
+SET PATH=%OFRDIR%;%CURDIR%mingw64\bin;%PATH%
+SET CC=gcc
+REM SET SDL2Opts=-w -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2
+SET SDL2Opts=-lmingw32 -lSDL2main -lSDL2
 
 
 REM Put all arguments starting from 2nd to ARGS.
 REM Put all arguments starting from 2nd to ARGS.
 SHIFT
 SHIFT
@@ -18,17 +22,15 @@ SET ARGS=%ARGS% %1
 SHIFT
 SHIFT
 GOTO START
 GOTO START
 :FINISH
 :FINISH
-REM END Put all... ARGS.
-
+REM END Put all ARGS.
 ECHO ON
 ECHO ON
-gcc -fPIC -g -I "%CURDIR%voc/C/include"^
- -o %ONAME%.exe %ONAME%.o^
- %ARGS%^
- "%CURDIR%voc/lib/Graph.o"^
- "%CURDIR%voc/lib/SDL2.o"^
- "%CURDIR%voc/lib/Int.o"^
- -L"%CURDIR%voc/lib" -lvoc-OC^
- -w -Wl,-subsystem,windows -lmingw32^
- -lSDL2main -lSDL2 -lSDL2_image
+%CC% -g3 -O0 -fno-exceptions ^
+  -I %OFRDIR%\..\..\Mod\Lib ^
+  -I %OFRDIR%\Lib\Obj ^
+  %ONAME%.c -o %ONAME%.exe ^
+  %ARGS%^
+  %CURDIR%libFreeOberon.a ^
+  %OFRDIR%\Lib\Ofront.a ^
+  %SDL2Opts% -lSDL2_image
 @SET RETCODE=%ERRORLEVEL%
 @SET RETCODE=%ERRORLEVEL%
 @EXIT /b %RETCODE%
 @EXIT /b %RETCODE%

+ 20 - 10
src/make.bat

@@ -1,13 +1,17 @@
-@SET PROG=FreeOberon
-@SET OFRDIR=C:\prg\OfrontPlus\Target\Win64
-@SET GCCDIR=C:\prg\mingw-w64\mingw64\bin
-@SET PATH=%GCCDIR%;%OFRDIR%;%PATH%
-@SET CC=gcc
-@REM SET SDL2Opts=-w -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2
-@SET SDL2Opts=-lmingw32 -lSDL2main -lSDL2
-@SET OFR=ofront+ -88 -C -s
-@SET OBERON=.;%OFRDIR%\Lib\Sym
+@ECHO OFF
+SET PROG=FreeOberon
+SET OFRDIR=C:\prg\OfrontPlus\Target\Win64
+SET GCCDIR=C:\prg\mingw-w64\mingw64\bin
+SET PATH=%GCCDIR%;%OFRDIR%;%PATH%
+REM SET SDL2Opts=-w -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2
+SET SDL2Opts=-lmingw32 -lSDL2main -lSDL2
+SET OFR=ofront+ -88 -C -s
+SET OBERON=.;%OFRDIR%\Lib\Sym
+SET CC=gcc
+SET AR=ar
+SET CCFULL=%CC% -g3 -O0 -fno-exceptions -I %OFRDIR%\..\..\Mod\Lib -I %OFRDIR%\Lib\Obj
 
 
+ECHO ON
 %OFR% Config_win32.Mod
 %OFR% Config_win32.Mod
 %OFR% Int.Mod
 %OFR% Int.Mod
 %OFR% -i SDL2.Mod
 %OFR% -i SDL2.Mod
@@ -22,4 +26,10 @@
 windres resources.rc resources.o
 windres resources.rc resources.o
 
 
 REM                        -O0 change to -Os (?)   add -s (?)
 REM                        -O0 change to -Os (?)   add -s (?)
-%CC% -g3 -O0 -fno-exceptions -I %OFRDIR%\..\..\Mod\Lib -I %OFRDIR%\Lib\Obj Config.c term\term_win32.c Int.c SDL2.c Graph.c Term.c Terminal.c OV.c EditorText.c Editor.c %PROG%.c resources.o -o ..\%PROG%.exe %OFRDIR%\Lib\Ofront.a %SDL2Opts% -lSDL2_image
+
+%CCFULL% -c Int.c
+%CCFULL% -c SDL2.c
+%CCFULL% -c Graph.c
+%AR% -crs ..\data\bin\libFreeOberon.a Int.o SDL2.o Graph.o
+
+%CCFULL% Config.c term\term_win32.c Int.o SDL2.o Graph.o Term.c Terminal.c OV.c EditorText.c Editor.c %PROG%.c resources.o -o ..\%PROG%.exe %OFRDIR%\Lib\Ofront.a %SDL2Opts% -lSDL2_image