Commit Graph

56 Commits

Author SHA1 Message Date
Zoltan Somogyi
a2def4bcc8 Bring the style of some scripts up to date ...
... by replacing tabs with spaces, adding modelines, replacing [ with test,
and fixing indentation.
2020-08-14 20:11:56 +10:00
Julien Fischer
7ce2ddd2b2 Update and fix copyright notices in the scripts directory.
scripts/*:
    As above.
2020-06-16 17:22:09 +10:00
Zoltan Somogyi
3e894a7a9d Remove the hl grade component.
As we discussed, it has fallen into disuse. Its main purpose was to
pave the way for the .net backend and later for the java and csharp grades.
Now that the .net backend is ancient history and the java and csharp grades
are established, that purpose is gone, and for every other purpose,
hlc is better because it is simpler and faster.

compiler/options.m:
    Delete the --high-level-data option. It is no longer needed,
    bacause the data representation scheme is now a direct function
    of the target language.

doc/user_guide.texi:
    Delete references to the --high-level-data option.

NEWS:
    Mention that --high-level-data is no longer supported.

compiler/compute_grade.m:
    Delete references to the hl grade component, and conform
    to the deletion of the --high-level-data option.

compiler/compile_target_code.m:
    Give some predicates more meaningful names, and conform to the
    deletion of the --high-level-data option.

compiler/const_struct.m:
compiler/du_type_layout.m:
compiler/globals.m:
compiler/handle_options.m:
compiler/lco.m:
compiler/mercury_compile_main.m:
compiler/ml_gen_info.m:
compiler/ml_type_gen.m:
compiler/ml_unify_gen_construct.m:
compiler/mlds_to_c_data.m:
compiler/mlds_to_c_func.m:
compiler/mlds_to_c_type.m:
compiler/mlds_to_c_util.m:
    Conform to the deletion of the --high-level-data option.

grade_lib/grade_spec.m:
grade_lib/grade_vars.m:
    Delete the datarep solver variable, since the data representation
    is now a direct function of the target language.

    Delete the requirements involving the deleted solver variable.

grade_lib/grade_structure.m:
    Delete the datarep component of the representation of MLDS C grades,
    since its value would now be fixed.

grade_lib/grade_solver.m:
grade_lib/grade_string.m:
grade_lib/try_all_grade_structs.m:
grade_lib/var_value_names.m:
    Conform to the changes above.

grade_lib/Mmakefile:
    Link the grade library's test programs statically, like we do
    the executables in the other directories.

library/io.m:
library/robdd.m:
library/rtti_implementation.m:
runtime/mercury_conf_param.h:
runtime/mercury_grade.h:
runtime/mercury_hlc_types.h:
    Remove references to MR_HIGHLEVEL_DATA, as well as any code
    that was guarded by #ifdef MR_HIGHLEVEL_DATA.

scripts/Mmake.vars.in:
scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
scripts/mmake.in:
scripts/mmc.in:
scripts/mtc:
scripts/parse_grade_options.sh-subr:
scripts/parse_ml_options.sh-subr.in:
    Remove references to --high-level-data options.

    In canonical_grade.sh-subr, compute the base grade more directly.

    Remove a few left-over references to the assembler backend.

    Add or fix vim modelines where relevant.

    Fix inconsistent indentation.

    Add missing ;;s in case statements.

    Switch to using ${var} references instead of just $var.

tests/invalid/Mercury.options:
    Make the test_feature_set test case run in grade java instead of hl.gc.

tests/invalid/test_feature_set.err_exp:
    Update the expected out for the grade change.
2020-04-11 19:30:58 +10:00
Zoltan Somogyi
e21a1a1c1c Fix indentation. 2020-04-10 18:28:10 +10:00
Zoltan Somogyi
bc8938ba8f Add a way to debug mmake's actions.
Specifically, when the environment variable is nonempty, pass the debugging
flag -d to make.

Also, bring this script up to date with our current programming style,
including 4-space indentation.
2019-06-18 18:32:16 +02:00
Julien Fischer
5c91099f0b Delete left over references to the IL backend.
scripts/final_grade_options.sh-subr:
scripts/mmake.in:
scripts/parse_grade_options.sh-subr:
    As above.
2016-04-14 16:27:45 +10:00
Julien Fischer
fa33b08005 Delete residual support for the GCC backend.
scripts/Mmake.vars.in:
scripts/final_grade_option.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mmake.in:
scripts/parse_grade_options.sh-subr:
	As above.
2013-02-20 16:09:09 +11:00
Ian MacLarty
1c61a64b42 Fix a bug introduced by Peter where the command `mmake <target>' just
Estimated hours taken: 0.3
Branches: main

scripts/mmake.in:
	Fix a bug introduced by Peter where the command `mmake <target>' just
	hangs if there is no Mmakefile.  The problem was that cat was being
	called with no arguments, causing it to wait for input from stdin.
2005-11-30 16:23:51 +00:00
Peter Ross
eef6a0a847 Move the dvs back to their original position before
Estimated hours taken: 0.1
Branches: main

scripts/mmake.in:
	Move the dvs back to their original position before
	the Mmakefile as the Mmakefiles in the compiler depend on this.
2005-11-13 08:51:53 +00:00
Peter Ross
e9c112bedc Implement support for writing Mmakefile in the style of
"Recursive make considered harmful".

This consists of two parts, giving mmake the optional ability to ignore
the .d files in the current directory.  The second part is adding
support to the compiler to write out just the .d file.

We may need to ignore the .d files in the current directory because we
may have included that file from another directory and we don't want to
define rules twice.

scripts/mmake.in:
scripts/Mmake.vars.in:
	If the mmake variable MMAKE_AUTO_INCLUDE_DS is set to no then
	don't include the rules defined in the .d files in the current
	directory.

compiler/mercury_compile.m:
	Add support for the --generate-dependency-file flag which just
	writes out the .d file for a module and then stops.

compiler/options.m:
	Add the generate_dependency_file option.

compiler/mercury_compile.m:
compiler/add_type.m:
compiler/handle_options.m:
	Make sure that generate_dependency_file implies that we don't
	need to build/link anything.

doc/user_guide.texi:
	Document the --generate-dependency-file flag.
2005-11-12 10:16:55 +00:00
Ian MacLarty
7158a0000b Fix the -f mmake option. Previously `mmake install' would ignore this option
Estimated hours taken: 2

Fix the -f mmake option.  Previously `mmake install' would ignore this option
when compiling different grades in the temporary directory.

scripts/mmake.in:
	Export a MMAKEFILE variable which stores the Mmakefile being used.
	This causes child calls to mmake to use the same Mmakefile if no
	-f option is given to the child calls.
2005-08-11 10:40:48 +00:00
Ian MacLarty
86a83a3462 Fix linking error for hlc.par.gc grade on Darwin.
Estimated hours taken: 3
Branches: main

Fix linking error for hlc.par.gc grade on Darwin.  The problem was that the
"-undefined suppress" option is not allowed with two level namespaces.
The solution is to use "-undefined dynamic_lookup" instead.
However this means the MACOSX_DEPLOYMENT_TARGET environment variable must be
set to 10.3 since this feature will not work on Mac OS < 10.3.  To allow
hlc.gc.par to be built on Mac 10.3, but targetted for Mac OS 10.0 - 10.2 add
a configuration option to force the use of flat namespaces (the
"-undefined suppress" option may be used with flat namespaces).

configure.in
	Add --enable-darwin-flat-namespace option.  This is the default
	for Mac OS < 10.3.  For Mac OS 10.3 two level namespaces are used
	unless this option is given.

	Set a variable to cause the MACOSX_DEPLOYMENT_TARGET environment
	variable to be set if two level namespaces are being used.

scripts/mmake.in
scripts/ml.in
scripts/mmc.in
	Set the MACOSX_DEPLOYMENT_TARGET environment variable wherever the
	linker may be called.
2004-12-23 04:19:36 +00:00
Julien Fischer
807809e333 Add the option `--file' to mmake. This allows the user
Estimated hours taken: 1
Branches: main

Add the option `--file' to mmake.  This allows the user
to specify the name of the file that mmake uses as the Mmakefile.
This can be useful when porting programs between systems
and experimenting with different configurations, particularly
when the programs are not under the control of autoconf.

The option `--file' may be abbreviated to `-f'.  If a file
is specified via `--file' then it will be used in preference to
any file in the current directory named Mmakefile or Mmake.

Unlike GNU make using multiple instances of `--file' will
not cause mmake to jointly use all of the specified files.
Instead it will use the last one specified and ignore the
others.

scripts/mmake.in:
	Add the `--file' option to mmake.
2004-09-27 07:55:30 +00:00
Simon Taylor
a32f16b9dd Fix a bug which caused Mmake to ignore the
Estimated hours taken: 0.1
Branches: main

scripts/mmake.in:
	Fix a bug which caused Mmake to ignore the
	value of MERCURY_CONFIG_DIR.
2003-08-01 15:00:38 +00:00
Simon Taylor
7597ca1e80 Allow reconfiguration of existing installations, for example
Estimated hours taken: 20
Branches: main

Allow reconfiguration of existing installations, for example
to use a different C compiler. The reconfiguration works
by making a new copy of the scripts and mercury_conf.h,
and storing them in a partial installation directory tree
which uses the libraries and executables from the existing
installation.

Use this method to configure binary distributions, rather
than using a cut down version of the configuration script,
to avoid code duplication and to handle the case where the
C compiler in use on the installation machine is different
than that used to build the binary distribution.

This is more robust than the previous method of using a different
C compiler, which was to set the MERCURY_C_COMPILER variable and
hope the different C compilers were compatible enough.

Mmakefile:
runtime/Mmakefile:
scripts/Mmakefile:
	Modify the `install' targets to store files needed to create
	a new configuration in $INSTALL_LIBDIR/reconf.

runtime/Mmakefile:
	Install mercury_conf.h in $INSTALL_LIBDIR/conf, rather than
	$INSTALL_LIBDIR/inc, so that it can be overridden by a
	different configuration.

scripts/mercury_config.in:
	Create a new configuration, by creating part of a Mercury
	source tree from the files stored in $INSTALL_LIBDIR/reconf,
	running configure, then copying the files into a partial
	installation tree.

scripts/Mmake.vars.in:
	Define ENABLE_DEEP_PROFILER, for use by bindist/bindist.Makefile.

	Define variables INSTALL_CONF_DIR (contains the files describing
	the configuration) and INSTALL_RECONF_DIR (contains files needed
	to reconfigure an installation).

configure.in:
	Add an option `--enable-reconfigure', for use by
	mercury_config.in.

	Don't look for runtime/mercury_wrapper.c when checking
	for the sources -- it isn't present when reconfiguring.
	Look for scripts/mmc.in instead.

	Look for the runtime headers in the installation hierarchy
	rather than the `runtime/' and `trace/' directories when
	reconfiguring.

	Output the help message for the `configure' script to
	`configure.help'.  This is included in the help message
	for `mercury_config'.

	Add new configuration variables CONFIG_PREFIX and CONFIG_LIBDIR,
	which are like PREFIX and LIBDIR except that they point
	to the configuration files, not the library files.
	In the normal case PREFIX and CONFIG_PREFIX will be the same.

bindist/bindist.INSTALL.in:
bindist/bindist.Makefile.in:
	Use mercury_config to configure binary distributions.

bindist/Mmakefile:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
	Remove bindist.configure.in and bindist.build_vars.in.

compiler/options.m:
scripts/parse_ml_options.sh-subr.in:
scripts/mgnuc.in:
doc/user_guide.texi:
	Add an option `--mercury-config-dir', and an environment
	variable MERCURY_CONFIG_DIR, which tell the compiler and
	scripts where to find the configuration files for the
	installation.
	MERCURY_CONFIG_DIR is not documented because it should
	only be used by the scripts.

compiler/compile_target_code.m:
	Pass `--mercury-config-dir' to the scripts.

compiler/handle_options.m:
	Add `--c-include-directory $MERCURY_CONFIG_DIR/conf'.

library/getopt.m:
	Handle `maybe_string_special' options.

doc/user_guide.texi:
	Update the "Using a different C compiler" chapter.

NEWS:
	Document the changes.
2003-01-24 07:17:13 +00:00
Simon Taylor
30686b9e1d Remove Prolog support.
Estimated hours taken: 0.5
Branches: main

Remove Prolog support.

Makefile:
	Don't clean up Prolog files.

configure.in:
bindist/bindist.configure.in:
scripts/Mmakefile:
scripts/sicstus_conv.in:
	Remove sicstus_conv.in.

scripts/Mmake.rules:
scripts/Mmake.vars.in:
	Remove Prolog-related variables and targets.
2002-05-16 06:48:43 +00:00
Simon Taylor
6dcbb587f2 Allow `mmc --make' to be used with Mmake.
Estimated hours taken: 2.5
Branches: main

Allow `mmc --make' to be used with Mmake.

scripts/mmake.in:
	Add an option `--use-mmc-make', which tells mmake
	to use `mmc --make' to build Mercury targets.

scripts/Mmake.vars.in:
	Add a variable MC_MAKE_FILES, which should contain
	files (e.g. generated header files) which should be
	build with `mmc --make'.

	Add a variable MERCURY_MAIN_MODULES which should
	contain the top-level module names of the programs
	or libraries in the directory. The targets for
	the modules appearing in MERCURY_MAIN_MODULES
	are added to MC_MAKE_FILES.

	Add a variable MC_MAKE_FLAGS, which is like
	MCFLAGS, but is only passed to `mmc --make'.

scripts/Mmake.rules:
	Disable Mercury-specific rules when `--use-mmc-make'
	is passed to mmake.

	Use `mmc --make' for targets for which there are no
	rules, or for targets appearing in MC_MAKE_FILES.
2002-05-01 17:13:21 +00:00
Simon Taylor
c1ff17b9cb Fix bugs in my change to improve the handling of linking
Estimated hours taken: 0.1
Branches: main

Fix bugs in my change to improve the handling of linking
with a non-installed standard library.

scripts/mmake.in:
	Export MERCURY_STDLIB_DIR.

scripts/Mmake.rules:
	Always set MERC_INT_DIR to avoid undefined variable warnings.
2002-04-20 15:00:32 +00:00
Simon Taylor
b99e6cc370 Allow alternative locations for the standard library files
Estimated hours taken: 6
Branches: main

Allow alternative locations for the standard library files
to be specified using options to the various Mercury scripts
rather than environment variables.  This change is necessary
to allow the compiler to be compiled using `mmc --make', because
`mmc --make' does not support the environment variables.

All of the Mercury scripts now accept an option
`--mercury-standard-library-directory' to specify the installed
library to use, or `--no-mercury-standard-library-directory' to
disable the use of the installed library. The location
of the alternate files to use can then be specified
using ordinary options to the scripts.

There is a new environment variable MERCURY_STDLIB_DIR, which has
the same effect as the `--mercury-standard-library-directory' option.

scripts/parse_ml_options.sh-subr.in:
scripts/mgnuc.in:
scripts/mmc.in:
scripts/mmake.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
	Handle MERCURY_STDLIB_DIR and `--mercury-standard-library-directory'.

	Remove support for the MERCURY_C_INCL_DIR, MERCURY_MOD_LIB_DIRS
	and MERCURY_TRACE_LIB_DIRS environment variables -- they aren't
	used anywhere. MERCURY_C_INCL_DIR is being removed because the
	assumption it makes (that all header files are installed into
	a single directory) will not hold for much longer because the
	generated header files for hl* grades are grade dependent.

compiler/options.m:
compiler/compile_target_code.m:
	Add an option `--trace-init-file', used to specify `.init'
	files which should only be used when tracing is enabled,
	such as browser/mer_browse.init.

	Allow `--mercury-stdlib-dir' as an abbreviation for
	`--mercury-standard-library-directory'.

tools/lmc:
	Use options rather than environment variables.

doc/user_guide.texi:
	Document MERCURY_STDLIB_DIR, MERCURY_TRACE_LIB_MODS
	and the `--trace-init-file' mmc option.

	Remove documentation for the no longer used MERCURY_C_INCL_DIR,
	MERCURY_MOD_LIB_DIRS, MERCURY_TRACE_LIB_DIRS and
	MERCURY_NC_BUILTIN environment variables.
2002-04-19 14:59:37 +00:00
Peter Ross
70dfc04059 Avoid problems with very long command lines by using xargs.
Estimated hours taken: 1.5
Branches: main

Avoid problems with very long command lines by using xargs.

compiler/modules.m:
    Use xargs to rm all the files for the clean and realclean targets.

scripts/mmake.in:
    Use xargs to cat the .d and .dv files.
2002-02-15 09:25:07 +00:00
Fergus Henderson
0b107322f4 Fix a typo: missing line continuation in error message.
Estimated hours taken: 0.1
Branches: main

scripts/mmake.in:
	Fix a typo: missing line continuation in error message.
2001-07-27 17:06:17 +00:00
Fergus Henderson
62a1c59b4b Fix a missing newline in the help message.
Estimated hours taken: 0.1
Branches: main, release

scripts/mmake.in:
	Fix a missing newline in the help message.
2001-06-03 16:04:03 +00:00
Fergus Henderson
8bc8db5018 Delete some accidentally duplicated code.
Estimated hours taken: 0.25
Branches: main

scripts/mmake.in:
	Delete some accidentally duplicated code.
	The code for handling `--no-use-subdirs' was there twice.
2001-03-20 02:10:34 +00:00
David Jeffery
19ceeaf30f Merge the changes from the HAL branch onto the main branch.
Estimated hours taken: 40
                       (to do this merge... 100s of hours on the HAL branch
		        itself by myself and Warwick Harvey though).

Merge the changes from the HAL branch onto the main branch. With the recent
changes made to the HAL implementation, this means adding just one grade,
`.rt' or --reserve-tag, which reserves one tag (zero) in each type for
use by HAL's Herbrand constraint solver. This disables no-tag types and
enumerations.

This grade will now bootstrap, and passes all tests, except for a few failing
cases in the debugger and tabling directories.

compiler/options.m:
compiler/handle_options.m:
	Add the `.rt' or --reserve-tag grade option.
runtime/mercury_conf_param.h:
	Document the macro MR_RESERVE_TAG
doc/user_guide.texi:
	Document the `.rt' grade.

compiler/make_hlds.m:
	Don't record any types as no-tag types if we are in a .rt grade.
compiler/make_tags.m:
compiler/type_ctor_info.m:
	Allocate tags starting from `1' in .rt grades.
compiler/rtti_out.m:
	In .rt grades, output a dummy ptag definition for tag `0'.
compiler/type_util.m:
	Add predicates `type_util__constructors_are_dummy_argument_type' and
	`type_constructors_are_type_info' for use when allocating tags to
	ensure that type infos and dummy types (io__state/0 and store__store/1)
	are still treated as no-tag types in .rt grades.

library/sparse_bitset.m:
	When allocating a sparse bitset element, use tag `1' if we are in a
	.rt grade.

runtime/mercury_tags.h:
	Define a macro `MR_UNIV_TAG' which is `1' is we in a .rt grade and
	`0' otherwise. (Now that univ is a user defined type, it is a also
	assigned a `var' tag).
	Also make the definitions of MR_RAW_TAG_NIL and MR_RAW_TAG_CONS take the
	.rt grade into account.
runtime/mercury_type_info.h:
	Define `MR_unravel_univ' and
	`MR_initialise_univ' for taking apart and putting together univs.

	Add a new secondary tag alternative: MR_SECTAG_VARIABLE, used to
	represent Herbrand variables.

library/std_util.m:
	Use MR_UNIV_TAG, MR_unravel_univ and MR_initialise_univ when
	manipulating univs.

	Handle the new MR_SECTAG_VARIABLE secondary tag by aborting.

runtime/mercury_deep_copy_body.h:
runtime/mercury_tabling.c:
runtime/mercury_unify_compare_body.h:
	Handle the new MR_SECTAG_VARIABLE secondary tag by aborting.

library/std_util.m:
	Add a constant for MR_SECTAG_VARIABLE in the MC++ back end.

scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
	Process the new grade.

scripts/mmake.in:
	Add an option `--include-makefile', which includes a Makefile given
	as a command line argument into the Makefile generated by mmake.
	This is used to implement `halmake', a make program for HAL which
	just passes a bunch of extra rules and variable definitions onto
	mmake.

tests/debugger/existential_type_classes.m:
tests/hard_coded/existential_types_test.m:
trace/mercury_trace_declarative.c:
trace/mercury_trace_external.c:
trace/mercury_trace_internal.c:
	Use MR_UNIV_TAG.

TODO:
	- The declarative debugger falls over in .rt grades. This is possibly
	  because compiler/static_term.m assumes that the generated code uses
	  the same data representation as the compiler itself. This should be
	  fixed, although it is not critical; the declarative debugger won't
	  work with trailing as is, and the .rt grade is only ever used in
	  conjunction with trailing (.tr) at this stage.
2001-03-18 23:10:17 +00:00
Fergus Henderson
67df9a7894 Add some comments explaining that the `--target il' option is
Estimated hours taken: 0.25

scripts/mmake.in:
	Add some comments explaining that the `--target il' option is
	not supported.  Issue a warning if it is used.
2001-01-17 09:16:51 +00:00
Fergus Henderson
3de6904858 Merge my recent changes on the gcc-backend-branch back onto
Estimated hours taken: 0.5

mercury/Mmake.common.in:
mercury/configure.in:
mercury/compiler/Mmakefile:
mercury/compiler/maybe_mlds_to_gcc.pp:
mercury/compiler/mercury_compile.m:
mercury/compiler/mlds_to_gcc.m:
mercury/compiler/modules.m:
mercury/runtime/mercury_type_info.h:
mercury/runtime/mercury_wrapper.c:
mercury/runtime/mercury_wrapper.h:
mercury/scripts/Mmake.rules:
mercury/scripts/Mmake.vars.in:
mercury/scripts/final_grade_options.sh-subr:
mercury/scripts/init_grade_options.sh-subr:
mercury/scripts/mmake.in:
mercury/scripts/parse_grade_options.sh-subr:
gcc/Make-lang.in:
gcc/Makefile:
gcc/Mmakefile:
gcc/lang-specs.h:
gcc/mercury-gcc.c:
	Merge my recent changes on the gcc-backend-branch back onto
	the main branch.
2001-01-17 02:45:07 +00:00
Fergus Henderson
98e67d2201 Fix a problem where the test cases were sometimes failing
Estimated hours taken: 0.5

Fix a problem where the test cases were sometimes failing
if old /tmp/mmake* directories were left lying around.

scripts/ml.in:
scripts/mmake.in:
	When creating the temporary directory, if mkdir fails (e.g.
	because that directory already exists), then try again with a
	different directory name.  Only report an error if it fails 20
	times in a row.
1999-10-11 05:47:12 +00:00
Fergus Henderson
8b043a1791 Honour the TMPDIR environment, if it is set,
Estimated hours taken: 0.25

scripts/ml.in:
scripts/mmake.in:
	Honour the TMPDIR environment, if it is set,
	rather than always using /tmp.
1999-09-10 08:50:04 +00:00
Warwick Harvey
174ea0ff5b Split the automatically generated .dep' file into two files. The new .dv'
Estimated hours taken: 15

Split the automatically generated `.dep' file into two files.  The new `.dv'
file contains all the variable definitions which used to be in the `.dep'
file, which now contains just the rules.  With mmake including the `.dv'
files before the user's Mmakefile and the `.dep' files after, this allows
user-defined Mmakefiles to refer to the automatically-generated variables
and automatically-generated rules to refer to variables defined in the
user's Mmakefile.  This was possible before to a limited extent, but in
particular dependency lists for automatically-generated rules could not
refer to user-defined variables.

Also introduced `C2INITARGS' as part of an illustration of how this change
is useful (though probably this should be a separate change).  `C2INITARGS'
should be used to specify extra files to be passed to `c2init', rather than
the currently-used `C2INITFLAGS' (which should only be used for option
flags).  The `_init.c' target should depend on these extra arguments, but it
was not possible to do this automatically prior to this change (at least,
not if one wanted to support per-program specification of `C2INITARGS').

compiler/modules.m:
	Generate the new `.dv' files and revised `.dep' files.
	Update the `change_clean' and `real_clean' targets to delete the
	`.dv' files.
	Update the `_init.c' rule to refer to `$(ALL_C2INITARGS)' as well as
	`$(ALL_C2INITFLAGS)', and add a dependency on `$(ALL_C2INITARGS)'.

scripts/Mmake.rules:
	Add appropriate rules and dependencies for `.dv' files.

scripts/Mmake.vars.in:
	Add definitions for implementing `C2INITARGS'.

scripts/mmake.in:
	Add code for using `.dv' files (while maintaining backward
	compatibility for when they don't exist).

doc/user_guide.texi:
	Document the new `.dv' files.
	Document the new `C2INITARGS' variables and the dependencies they
	imply.

../clpr/Mmakefile:
../clpr/samples/Mmakefile:
extras/complex_numbers/samples/Mmakefile:
extras/complex_numbers/tests/Mmakefile:
extras/graphics/mercury_opengl/Mmakefile:
extras/references/samples/Mmakefile:
extras/references/tests/Mmakefile:
extras/trailed_update/samples/Mmakefile:
extras/trailed_update/tests/Mmakefile:
	Update to use `C2INITARGS' instead of `C2INITFLAGS', where
	appropriate, and remove any now-obsolete `%_init.c' dependencies
	(which wouldn't have worked anyway since GNU Make ignores pattern
	dependencies with no commands).
1999-07-20 03:39:24 +00:00
Fergus Henderson
1eca19786e Add Mmake support for target-specific MCFLAGS flags (MCFLAGS-foo, etc.)
Estimated hours taken: 3

Add Mmake support for target-specific MCFLAGS flags (MCFLAGS-foo, etc.)
using some tricky GNU Make hackery that avoids warning about undefined
variables.
Also define ALL_MCFLAGS = $(MCFLAGS) $(TARGET_MCFLAGS) $(EXTRA_MCFLAGS)
and use $(ALL_MCFLAGS) instead of $(MCFLAGS).  This allows user Mmakefiles
to override MCFLAGS without suppressing the use of the TARGET_MCFLAGS
and EXTRA_MCFLAGS.

Similarly for the other *FLAGS variables.

scripts/Mmake.vars.in:
	Define ALL_*FLAGS and TARGET_*FLAGS.

scripts/Mmake.rules:
	Use ALL_*FLAGS instead of *FLAGS.

scripts/mmake.in:
	Re-enable the warnings about undefined variables,
        since we won't get too many spurious warnings now.

Mmake.common.in:
	Delete `$(MCFLAGS-$*)' from the definition of `MCFLAGS', since this
	is now done automatically by Mmake.

tests/Mmake.common:
	Delete the definitions of MCFLAGS and GRADEFLAGS, since this stuff
	is now done automatically by Mmake.

doc/user_guide.texi:
NEWS:
	Document these changes.
1998-08-04 14:06:10 +00:00
Fergus Henderson
4647a1c2af Make the warnings about undefined variables optional;
Estimated hours taken: 0.5

scripts/mmake.in:
	Make the warnings about undefined variables optional;
	by default they are not enabled.
1998-07-25 12:01:43 +00:00
Fergus Henderson
35090c6099 Ensure that the scripts clean up properly if interrupted --
Estimated hours taken: 0.5

scripts/mmake.in:
scripts/ml.in:
	Ensure that the scripts clean up properly if interrupted --
	avoid a small timing window during which an interrupt signal
	could cause the scripts to leave temporary directories lying
	around in /tmp.
1998-06-28 07:46:09 +00:00
Fergus Henderson
306ed77dd5 Fix a typo.
Estimated hours taken: 0.1

scripts/mmake.in:
	Fix a typo.
1998-05-29 21:30:20 +00:00
Fergus Henderson
c578810748 Improve the efficiency of code added in my previous change,
Estimated hours taken: 0.25

scripts/mmake.in:
	Improve the efficiency of code added in my previous change,
	as suggested by zs: avoid using `...`.
1998-05-29 07:53:37 +00:00
Fergus Henderson
587f0a3233 If the current directory contains a `Mercury' subdirectory,
Estimated hours taken: 0.5

scripts/mmake.in:
	If the current directory contains a `Mercury' subdirectory,
	then enable `--use-subdirs' by default.
1998-05-29 04:27:18 +00:00
Fergus Henderson
f00346033a Make another small fix to mmake.in and add more empty definitions for various
Estimated hours taken: 0.5

Make another small fix to mmake.in and add more empty definitions for various
Mmake variables to avoid spurious warnings.

scripts/mmake.in:
	Add `*clean*' to the patterns for which we do not
	pass `--warn-undefined-variables'.

scripts/Mmake.rules:
	When invoking make recursively, pass $(MFLAGS) rather than
	$(MAKEOVERRIDES).  This avoids a warning, and is probably the
	right thing to do anyway (I'm not sure why I used MAKEOVERRIDES
	in the first place).

boehm_gc/Mmakefile:
tests/hard_coded/Mmakefile:
	Add empty definition for `MMAKEFLAGS'.
1998-04-02 13:23:10 +00:00
Tyson Dowd
5efca12a76 Use
Estimated hours taken: 0.05

scripts/mmake.in:
	Use
		if mkdir .... ; then
			true
		else
			error case
		fi
	since it's a bit neater than a case statement.
1998-03-31 05:48:03 +00:00
Fergus Henderson
6f065be64a Fix some Mmakefile errors that were diagnosed by `--warn-undefined-variables'.
Estimated hours taken: 1

Fix some Mmakefile errors that were diagnosed by `--warn-undefined-variables'.
Also, make a small fix to mmake.in and add empty definitions for various
Mmake variables to avoid spurious warnings.

scripts/mmake.in:
	Add ` dep*' to the patterns for which we do not
	pass `--warn-undefined-variables'; previously it
	matched "$@" against `dep*', which did not catch the
	case of `mmake -k depend'.
		       ^^^

scripts/Mmake.vars.in:
	Add definition for `ds_subdir'.
	Define `MLLIBS' as `$(EXTRA_MLLIBS)' rather than empty,
	and add empty definition for `EXTRA_MLLIBS'.
	Add empty definition for `MAIN_TARGET'.

Mmakefile:
	Fix misspelling: `deps_subdir' not `dep_subdir'.
	Add empty definitions for `PREINSTALL_HACK', `POSTINSTALL_HACK',
	and `MMAKEFLAGS'.

boehm_gc/Mmakefile:
	Add empty definition for `PROF'.

runtime/Mmakefile:
	Add empty definition for `DLL_CFLAGS'.

library/Mmakefile:
	Add empty definition for `CHECK_TERM_OPTS'.

compiler/Mmakefile:
	Add empty definition for `MTAGSFLAGS'.
1998-03-30 13:03:17 +00:00
Tyson Dowd
dbc819121a Bugfix for previous change, mmake wasn't working on murlibobo.
Estimated hours taken: 0.05

scripts/mmake.in:
	Bugfix for previous change, mmake wasn't working on murlibobo.
	"if ! mkdir... " seems to be a bash-ism.  Use mkdir ...., then
	check $? instead.
1998-03-30 06:11:24 +00:00
Tyson Dowd
d928e526a0 Fix two security holes in the way temporary files in /tmp are handled.
Estimated hours taken: 1

Fix two security holes in the way temporary files in /tmp are handled.

configure.in:
	Look for mktemp.

scripts/ml.in:
	Previously, if a file /tmp/ml$$ existed, linker errors would
	be missed (or fake linker errors could be provided).
	Use
		mkdir /tmp/ml.$$ || exit 1
	approach to create a directory, then use a file in that
	directory as the fifo for linker errors.

scripts/mmake.in:
	Previously, if a file /tmp/mmake.$$ existed, it would stop
	the generation of a mmake file, and the system would invoke
	gmake on the existing file (possibly executing arbitrary
	commands).
	Use mktemp (if available) to create the file, and exit if
	it is not possible to create the file.
	If mktemp is not available, use mkdir || exit 1 technique.
1998-03-30 05:26:33 +00:00
Fergus Henderson
60eac4cd0c Pass `--warn-undefined-variables', except when making dependencies.
Estimated hours taken: 0.75

scripts/mmake.in:
	Pass `--warn-undefined-variables', except when making dependencies.

runtime/Mmakefile:
scripts/Mmake.vars.in:
	Add empty definitions of a few variables, to avoid warnings with
	`--warn-undefined-variables'.
1998-03-27 08:34:23 +00:00
Fergus Henderson
f884cee0c4 Finish off the centralization of the file name handling code, and
Estimated hours taken: 11

Finish off the centralization of the file name handling code, and
add support for generating intermediate files in subdirectories.

scripts/mmake.in:
	Add a new boolean option `--use-subdirs';
	if enabled, it just sets the environment variable MMAKE_USE_SUBDIRS
	to `yes' before invoking Make.
	Also add negative versions of the various options
	(`--no-use-subdirs', `--no-verbose', `--no-save-makefile').

scripts/Mmake.rules:
	Add code to handle generating intermediate file names
	in subdirectories.  If MMAKE_USE_SUBDIRS=yes, we add
	`--use-subdirs' to MCFLAGS, and most of the pattern rules
	are changed to use subdirectories.

	Note that getting this to work required a bit of a hack:
	due to what seem to be bugs in GNU Make, `mmake depend'
	needs to do `mmc --make-short-interface *.m' to get things
	started.  But once the int3s are there, the dependencies
	seem to work OK.

compiler/options.m:
	Add a new boolean option `--use-subdirs'.

compiler/modules.m:
	Add new predicate `fact_table_file_name'.
	Add an extra argument to `module_name_to_file_name',
	specifying whether or not to create any directories
	needed for the file name.
	Change all the file-name-creating predicates here
	to go through a single new predicate `choose_file_name',
	and add code in that predicate to handle the `--use-subdirs'
	option.
	Also if the `--use-subdirs' option is set, don't use the
	compact dependencies format, since it can't work in that case.

compiler/fact_table.m:
	Call `fact_table_file_name' rather than using `string__append'.

compiler/mercury_compile.m:
	Change `link_module_list' and `join_module_list'
	so that they create file names by calling `module_name_to_file_name'.

compiler/export.m:
compiler/intermod.m:
compiler/llds_out.m:
compiler/mercury_compile.m:
compiler/module_qual.m:
compiler/modules.m:
compiler/termination.m:
compiler/trans_opt.m:
compiler/unused_args.m:
	Change all calls to `module_name_to_file_name' to pass
	the extra argument specifying whether or not to make
	any directories needed for the file name.

library/Mmakefile:
	Change the rule for `mmake install_ints' so that it
	creates a `Mercury' subdirectory with symbolic links
	`ints', `int2s', `int3s', `opts', and `trans_opts'
	which just point to `..'.  This is needed for the
	`--use-subdirs' option to work, because Mmake currently
	does not support mixing libraries compiled with and
	without `--use-subdirs'.

doc/user_guide.texi:
	Document the above changes.
1998-03-18 08:09:50 +00:00
Fergus Henderson
04b720630b Update the copyright messages so that (a) they contain the correct years
and (b) they say "Copyright (C) ... _The_ University of Melbourne".
1997-07-27 15:09:59 +00:00
Fergus Henderson
59cf271af1 Undo my previous change to use `exec', since that causes
Estimated hours taken: 0.25

scripts/mmake.in:
	Undo my previous change to use `exec', since that causes
	problems because the temporary files never get removed.
	Instead, I've just added a comment saying why `exec' can't
	be used.
1997-02-27 15:32:29 +00:00
Fergus Henderson
da41b23096 Change the code so that it uses `exec' to run make,
Estimated hours taken: 0.25

scripts/mmake.in:
	Change the code so that it uses `exec' to run make,
	rather than just invoking it as a sub-process.  This
	should be a little more efficient.
1997-02-26 09:25:54 +00:00
Fergus Henderson
186f71464e Add a tiny bit more documentation.
Estimated hours taken: 0.1

scripts/mmake.in:
	Add a tiny bit more documentation.
1997-02-09 03:50:43 +00:00
Fergus Henderson
8ce103cc76 Add Unix-style man pages for most of the Mercury development tools.
scripts/c2init.in:
scripts/mmake.in:
scripts/msc.in:
	Small changes to the help messages to make them come out
	better when converted to man pages.

scripts/mgnuc.in:
	Add a `--help' option.
1997-02-07 14:17:41 +00:00
Fergus Henderson
d2457986f8 Check for Mmakefile' as an alternative to Mmake'.
Estimated hours taken: 0.25

scripts/mmake.in:
	Check for `Mmakefile' as an alternative to `Mmake'.
	(This change is so I can rename scripts/Mmake as Mmakefile
	to avoid a conflict with scripts/mmake on systems with
	case-insensitive file systems, e.g. Windows 95.)
1996-05-25 03:42:17 +00:00
Fergus Henderson
14ffa5fcd0 Ensure that mmake does not attempt to remake the `.c' file if it is up-to-date.
Estimated hours taken: 1

Ensure that mmake does not attempt to remake the `.c' file if it is up-to-date.
(This change should hopefully fix a problem with the source distribution not
being able to bootstrap itself.)

Also a couple of minor tidy-ups.

scripts/mmake.in:
	Export new variable MMAKE_MAKE_CMD, for use by Mmake.rules.

scripts/Mmake.rules:
	In the rule for `.m' -> `.o', use a recursive invocatino of
	make (via the MMAKE_MAKE_CMD variable) to build the `.c' file,
	rather than unconditionally invoking `$(MCG)'.

scripts/.cvsignore:
	Add Mmake.vars, since it is now automatically-generated.

scripts/ml.in:
	Some stylistic changes: make sure that autoconf @var@ variables occur
	only in assignments to shell variables at the start of the script,
	not scattered throughout the body of the script.
1996-02-04 06:17:30 +00:00
Fergus Henderson
8cf86fd1ef Replace all uses of
scripts/*.in:
	Replace all uses of

		... "$@" ...

	with

		case $# in
			0) ... ...
			*) ... "$@" ...
		esac

	since on ULTRIX and OSF, "$@" does the wrong thing if $# is 0.
1995-09-18 07:14:09 +00:00