diff --git a/ReadMe.md b/ReadMe.md index 55ccd3d9..f7f1270e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -6,7 +6,7 @@ implementation of the Oberon-2 language and libraries for use on conventional operating systems such as Linux, BSD, Android, Mac and Windows. -Vishap's Oberon Compiler (voc) uses a C backend (gcc, clang or msc) to compile +Vishap's Oberon Compiler (voc) uses a C backend (gcc, clang, tcc, msc or nvcc) to compile Oberon programs under Unix, Mac or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. @@ -31,9 +31,11 @@ It is easy to install the Oberon compiler and libraries with the following simple steps: 1. Install pre-requisites such as git, gcc, static C libraries, diff utils. - 2. Clone the repository and run 'make full'. - 3. Optionally install to a system directory such as /opt or /usr/local/share with 'make install'. - 4. Set your PATH variable to include the compiler binary. + 2. Clone the repository: `git clone https://github.com/vishaps/voc` + 3. Optionally `export CC=clang` or `export CC=tcc` or `export CC=nvcc` + 4. run `make full`. + 5. Optionally install to a system directory such as /opt or /usr/local/share with `make install` (might be with sudo). + 6. Set your PATH variable to include the compiler binary. These are detailed below: @@ -179,9 +181,9 @@ Most of the runtime in libVishapOberon is distributed under GPLv3 with runtime e ## Platform support and porting -Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm and ppc. +Vishap Oberon supports 32 and 64 bit little-endian architectures including Intel x86 and x64, arm. -It compiles under gcc, clang and Microsoft Visual C. +It compiles under gcc, clang, Microsoft Visual C and NVIDIA nvcc. Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). diff --git a/makefile b/makefile index 8186e175..67fd6eb5 100644 --- a/makefile +++ b/makefile @@ -80,7 +80,8 @@ usage: @echo " make clean - Clean out the build directory" @echo " make compiler - Build the compiler but not the library" @echo " make browsercmd - Build the symbol browser (showdef)" - @echo " make library - Build all library files and make library" + @echo " make O2library - Build all library files with Oberon-2 type sizes" + @echo " make OClibrary - Build all library files with Component Pascal type sizes" @echo " make install - Install built compiler and library in /opt or C:\\PROGRAM FILES*" @echo " (Needs root access)" @echo "" diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index b64e1e94..203b1b0e 100755 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -8,7 +8,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CONST OptionChar* = "-"; - + cextopt = "--extention"; (* compiler option flag bits; don't change the encoding *) inxchk* = 0; (* index check on *) ranchk* = 2; (* range check on *) @@ -296,7 +296,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Pick up global option changes from start of command line *) S:=1; s:=""; Modules.GetArg(S, s); WHILE s[0] = OptionChar DO - ScanOptions(s); + IF s = cextopt (* if '--extention' present *) THEN + (* cext it is initialized as ".c" in Configuration.Mod *) + Modules.GetArg(S, s); COPY(s, Configuration.cext); + ELSE + ScanOptions(s); + END; INC(S); s:=""; Modules.GetArg(S, s) END; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 0c7acded..07e3967f 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -63,7 +63,8 @@ PROCEDURE Assemble*(moduleName: ARRAY OF CHAR); InitialiseCompilerCommand(cmd); Strings.Append("-c ", cmd); Strings.Append(moduleName, cmd); - Strings.Append(".c", cmd); + Strings.Append(Configuration.cext, cmd); + Strings.Append(" ", cmd); execute("C compile: ", cmd); END Assemble; @@ -74,7 +75,8 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition BEGIN InitialiseCompilerCommand(cmd); Strings.Append(moduleName, cmd); - Strings.Append(".c ", cmd); + Strings.Append(Configuration.cext, cmd); + Strings.Append(" ", cmd); Strings.Append(additionalopts, cmd); IF statically THEN IF Configuration.os = "darwin" THEN diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 459b6836..3d45a9bc 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -411,8 +411,10 @@ void writeConfigurationMod() { fprintf(fd, " staticLink* = '%s';\n", staticlink); fprintf(fd, "VAR\n"); fprintf(fd, " versionLong-: ARRAY %d OF CHAR;\n", (int)strnlen(versionstring, 100)+1); + fprintf(fd, " cext* : ARRAY 16 OF CHAR;\n"); fprintf(fd, "BEGIN\n"); fprintf(fd, " versionLong := '%s';\n", versionstring); + fprintf(fd, " cext := \".c\";\n"); fprintf(fd, "END Configuration.\n"); fclose(fd);