Browse Source

Compile and link scripts updated to use Ofront+ on Linux

Arthur Yefimov 4 years ago
parent
commit
4d4c27db56
4 changed files with 46 additions and 14 deletions
  1. 5 2
      data/bin/compile.bat
  2. 13 5
      data/bin/compile.sh
  3. 3 0
      data/bin/link_graph.bat
  4. 25 7
      data/bin/link_graph.sh

+ 5 - 2
data/bin/compile.bat

@@ -1,6 +1,9 @@
 @ECHO OFF
 @ECHO OFF
-REM This script is run by Free Oberon on Windows. Current directory of the
-REM script will be where FreeOberon.exe is located.
+REM This script is automatically run by Free Oberon on Windows
+REM for each compiled module. The initial current directory of
+REM the script is where FreeOberon executable is located.
+REM You are free to edit this file to adjust the process.
+
 CD bin >nul 2>&1
 CD bin >nul 2>&1
 SET CURDIR=%~dp0
 SET CURDIR=%~dp0
 SET OFRDIR=%CURDIR%OfrontPlus\Target\Win64
 SET OFRDIR=%CURDIR%OfrontPlus\Target\Win64

+ 13 - 5
data/bin/compile.sh

@@ -1,10 +1,18 @@
 #!/bin/bash
 #!/bin/bash
-# This script is run by Free Oberon on Linux. Current directory of the
-# script will be where FreeOberon executable is located.
+#   This script is automatically run by Free Oberon on Windows
+#   for each compiled module. The initial current directory of
+#   the script is where FreeOberon executable is located.
+#   You are free to edit this file to adjust the process.
+
 cd bin
 cd bin
-VOCDIR=../data/bin/voc/install
-VOC=$VOCDIR/bin/voc
-$VOC -OC -cfF $2 ../Programs/$1
+
+OFRDIR="../data/bin/OfrontPlus/Target/Linux_amd64"
+PATH="$OFRDIR:$PATH"
+export OBERON=".:$OFRDIR/Lib/Sym"
+OFR="ofront+ -88 -C -s"
+
+
+$OFR $2 ../Programs/$1
 retcode=$?
 retcode=$?
 cd ..
 cd ..
 exit $retcode
 exit $retcode

+ 3 - 0
data/bin/link_graph.bat

@@ -2,6 +2,7 @@
 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 particular script
 REM script will be where FreeOberon.exe is located. This particular script
 REM is for graphical programs.
 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
@@ -24,6 +25,7 @@ GOTO START
 :FINISH
 :FINISH
 REM END Put all ARGS.
 REM END Put all ARGS.
 ECHO ON
 ECHO ON
+
 %CC% -g3 -O0 -fno-exceptions ^
 %CC% -g3 -O0 -fno-exceptions ^
   -I %OFRDIR%\..\..\Mod\Lib ^
   -I %OFRDIR%\..\..\Mod\Lib ^
   -I %OFRDIR%\Lib\Obj ^
   -I %OFRDIR%\Lib\Obj ^
@@ -33,4 +35,5 @@ ECHO ON
   %OFRDIR%\Lib\Ofront.a ^
   %OFRDIR%\Lib\Ofront.a ^
   %SDL2Opts% -lSDL2_image
   %SDL2Opts% -lSDL2_image
 @SET RETCODE=%ERRORLEVEL%
 @SET RETCODE=%ERRORLEVEL%
+
 @EXIT /b %RETCODE%
 @EXIT /b %RETCODE%

+ 25 - 7
data/bin/link_graph.sh

@@ -2,19 +2,37 @@
 # This script is run by Free Oberon on Linux. Current directory of the
 # This script is run by Free Oberon on Linux. Current directory of the
 # script will be where FreeOberon executable is located. This
 # script will be where FreeOberon executable is located. This
 # particular script is for graphical programs.
 # particular script is for graphical programs.
+
 cd bin
 cd bin
-VOCDIR=../data/bin/voc/install
-CC=gcc
+
 THENAME="${1%.*}"
 THENAME="${1%.*}"
 ONAME="${THENAME##*/}"
 ONAME="${THENAME##*/}"
+OFRDIR="../data/bin/OfrontPlus/Target/Linux_amd64"
+PATH="$OFRDIR:$PATH"
+CC="gcc"
+
 SDL2Opts=`sdl2-config --cflags --libs`
 SDL2Opts=`sdl2-config --cflags --libs`
+
 shift
 shift
-$CC -fPIC -g -I $VOCDIR/C/include \
-  -o $ONAME $ONAME.o \
+
+
+
+
+
+
+
+
+
+
+
+
+$CC -g3 -O0 -fno-exceptions \
+  -I $OFRDIR/../../Mod/Lib \
+  -I $OFRDIR/Lib/Obj \
+  $ONAME.c -o $ONAME \
   $@ \
   $@ \
-  $VOCDIR/lib/Graph.o $VOCDIR/lib/SDL2.o \
-  $VOCDIR/lib/Int.o \
-  $VOCDIR/lib/libvoc-OC.a \
+  ../data/bin/libFreeOberon.a \
+  $OFRDIR/Lib/libOfront.a \
   $SDL2Opts -lSDL2_image
   $SDL2Opts -lSDL2_image
 retcode=$?
 retcode=$?
 cd ..
 cd ..