Rename the top-level of the compiler.

Currently, the compiler's top-level module is the module 'top_level'.  This
means that the executable (or Java archive, or assembly) we generate is named
after that.  However, the rest of the system requires that the compiler
executable be named 'mercury_compile', so we currently rename it after it is
generated.  (At least, we do in C grades, in non-C grades the compiler
"executable" currently has the "wrong" name.)  Making this scheme work across
multiple backends and platforms leads to quite a bit of complication in the
build system.  This change simplifies matters by repurposing the
'mercury_compile' module to be the new top-level module; this means that the
executable is generated with the correct name to begin with.

compiler/mercury_compile.m:
     Shift the existing contents of this module to  new module,
     mercury_compile_main.

     Shift this module out of the top_level package and export main/2 from it.

compiler/mercury_compile_main.m:
     New module that contains the old contents of mercury_compile.m.

compiler/top_level.m:
     Conform to the above changes.

     Delete the definition of main/2 from this module.

compiler/make.m:
compiler/make.module_target.m:
     Conform to the above changes.

compiler/Mmakefile:
     Conform to the change in the name of the top-level module.

    Delete the rule for renaming the compiler executable.

Mmakefile:
    Update the dep_compiler target.

compiler/notes/compiler_design.html:
    Update this document.

scripts/mercury_compile.sh-csharp:
scripts/mercury_compile.sh-java:
    Update these scripts.

compiler/.gitignore:
    Conform to the above changes and generally update
    this file.

configure.ac:
tools/binary_step:
tools/bootcheck:
    Update the top-level module.
This commit is contained in:
Julien Fischer
2016-02-17 15:37:28 +11:00
parent deac75169b
commit 8e732885ff
14 changed files with 2394 additions and 2400 deletions

View File

@@ -12,4 +12,4 @@ esac
MONO_PATH="$DIR/../lib/mercury/lib/csharp"${SEP}$MONO_PATH
export MONO_PATH
CLI_INTERPRETER=${CLI_INTERPRETER:-/opt/local/bin/mono}
exec "$CLI_INTERPRETER" "$DIR/top_level.exe" "$@"
exec "$CLI_INTERPRETER" "$DIR/mercury_compile.exe" "$@"

View File

@@ -10,7 +10,7 @@ case $WINDIR in
*) SEP=';' ;;
esac
JARDIR="$DIR/../lib/mercury/lib/java"
CLASSPATH="$DIR/top_level.jar"${SEP}$CLASSPATH${SEP}$JARDIR/mer_rt.jar${SEP}$JARDIR/mer_std.jar${SEP}$JARDIR/mer_browser.jar${SEP}$JARDIR/mer_mdbcomp.jar
CLASSPATH="$DIR/mercury_compile.jar"${SEP}$CLASSPATH${SEP}$JARDIR/mer_rt.jar${SEP}$JARDIR/mer_std.jar${SEP}$JARDIR/mer_browser.jar${SEP}$JARDIR/mer_mdbcomp.jar
export CLASSPATH
JAVA=${JAVA:-java}
exec "$JAVA" -Xss32M jmercury.top_level "$@"
exec "$JAVA" -Xss32M jmercury.mercury_compile "$@"