mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-08 02:11:55 +00:00
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.
16 lines
425 B
Bash
Executable File
16 lines
425 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# This script invokes the _installed_ version of the Mercury compiler when it
|
|
# is built in the C# grade and run using Mono.
|
|
|
|
DIR=${0%/*}
|
|
DIR=$( cd "${DIR}" && pwd -P )
|
|
case $WINDIR in
|
|
'') SEP=':' ;;
|
|
*) SEP=';' ;;
|
|
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/mercury_compile.exe" "$@"
|