Commit Graph

105 Commits

Author SHA1 Message Date
Fergus Henderson
8b45bd6016 Fix a bug which occurred when combining --target asm with --use-subdirs.
Branches: main, release
Estimated hours taken: 1

Fix a bug which occurred when combining --target asm with --use-subdirs.

scripts/Mmake.rules:
compiler/modules.m:
	The .pic_s files go in the `pic_ss' subdirectory,
	not in the `ss' subdirectory.

scripts/Mmake.vars.in:
	Add `pic_ss_subdir' variable.
2001-07-27 16:06:29 +00:00
mercury
76b287a421 Fix a bug with the GCC back-end Mmake support that seems to have been
Branches: main
Estimated hours taken: 2

Fix a bug with the GCC back-end Mmake support that seems to have been
triggered somehow by stayl's .c_date changes.

scripts/Mmake.rules:
	For the *__c_code.{o,pic_o} targets, depend on the .s/.pic_s
	file rather than the .c file, since the .c file is generated
	as a side effect of generating the .s/.pic_s file.
2001-07-27 06:12:31 +00:00
Tyson Dowd
66bbcfc26d Merge the changes to support csharp building into the main branch
Estimated hours taken: 4
Branches: main

Merge the changes to support csharp building into the main branch
of the compiler.

compiler/modules.m:
	Write the CSHARP_ASSEMBLY_REFS-modulename for each C# foreign
	module.

scripts/Mmake.rules:
	Add rules to build C# DLLs.
2001-07-24 14:19:23 +00:00
Peter Ross
2c5af924c0 Remove the .foreign_os target.
Estimated hours taken: 0.25
Branches: main

Remove the .foreign_os target.

compiler/modules.m:
    Don't generate any references to .foreign_os.

scripts/Mmake.rules:
    Remove the .obj file which is created as a side effect by MSVC.
2001-07-18 09:37:34 +00:00
Peter Ross
9e20b981ea Add mmake support for building modules which contain foreign code on the
Estimated hours taken: 5
Branches: main

Add mmake support for building modules which contain foreign code on the
IL backend.
Note that currently we don't install mercury_il.dll and mercury_mcpp.dll
somewhere where the C compiler can find them, so this change doesn't
work out of the box.

compiler/mlds_to_ilasm.m:
    Change the output file name for cpp files to <modulename>__cpp_code.cpp

compiler/mlds_to_mcpp.m:
    No longer output a reference to <modulename>.dll, as the cpp code
    doesn't refer to any of the entities defined in this dll.

compiler/modules.m:
    If a module contains some foreign code and we are on the IL backend
    generate a dependency which causes the foreign code dll to be built.
    Generate the make variable .foreign, .foreign_cs, .foreign_os and
    .foreign_dlls which refer to all the foreign modules.
    Generate rules to clean the foreign modules up.

scripts/Mmake.rules:
    Turn some unix paths into windows paths.

library/Mmakefile:
    Use the new .foreign variables to build the library instead of the
    previous hacks.
2001-07-17 15:40:38 +00:00
Simon Taylor
6e46b775b6 Fix a bug in my change to add timestamps for `.c' files.
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.rules:
	Fix a bug in my change to add timestamps for `.c' files.
	Create the subdirectories for the `.c_date', `.il_date',
	`.s_date' and `.pic_s_date' files when running `mmake depend'
	to work around a GNU make bug. (This duplicates similar code
	for `.date' etc. files).

	Fix a typo in the rules for `.pic_s' files.
2001-07-08 11:02:25 +00:00
Simon Taylor
120e4abf0c Fix a bug in my last change - add .PRECIOUS rules for
Estimated hours taken: 0.1
Branches: main

scripts/Mmake.rules:
	Fix a bug in my last change - add .PRECIOUS rules for
	the new date stamp files to stop make removing them.
2001-07-07 05:50:51 +00:00
Simon Taylor
4a7fb746f9 Use a timestamp file mechanism similar to that used for `.int' files
Estimated hours taken: 3

Use a timestamp file mechanism similar to that used for `.int' files
to avoid rechecking whether a module needs to be recompiled on each
mmake if no used interfaces have changed.

compiler/mercury_compile.m:
	Touch a `.c_date', `.il_date', `.s_date' or `.pic_s_date' file
	after compilation has finished.

compiler/recompilation_check.m:
	Touch a `.c_date', `.il_date', `.s_date' or `.pic_s_date' file
	if a module does not need to be recompiled.

compiler/modules.m:
scripts/Mmake.rules:
	Set up the make dependencies for timestamp files, in a similar
	manner to the `.date' files.

	Remove the timestamp files in the `clean' mmake target.

	Handle `.s' and `.pic_s' files as for the `.o' files
	when using `--target asm'. There are no `.s' or `.pic_s'
	files for nested modules.

scripts/Mmake.vars.in:
	Set up the subdir variables for the timestamp files.

Mmakefile:
scripts/mercury_cleanup_install:
	Save/restore the timestamp files and the `.used' files
	across the library grade installation.

configure.in:
	Remove the `.c_date' files for the `.c' files that
	need to be rebuilt.

doc/user_guide.texi:
	Document the new file extensions.
2001-07-06 11:25:36 +00:00
Zoltan Somogyi
48dc5aae2c Fix a problem that used to cause installs into not-yet-created directories
Estimated hours taken: 0.5
Branches: main

Fix a problem that used to cause installs into not-yet-created directories
to fail.

scripts/Mmake.rules:
	Instead of invoking $(MC) --errorcheck-only when creating .err files,
	invoke the macros $(MCE).

scripts/Mmake.vars:
	Define the default value of $(MCE) as $(MC) --errorcheck-only.

compiler/Mmakefile:
	Override the default value of $(MCE) to specify the search path,
	just as all the other invocations of the Mercury compiler in this
	directory do. The absence of such override could lead to a raft
	of messages about interface files not being found when trying to
	create maybe_mlds_to_gcc.err.
2001-07-03 09:49:41 +00:00
Simon Taylor
9dd11b2fc6 Smart recompilation. Record version numbers for each item
Estimated hours taken: 400

Smart recompilation. Record version numbers for each item
in interface files. Record which items are used in each compilation.
Only recompile a module if the output file does not exist or
nothing has changed.

There is still some work to do on this:
- it doesn't work with inter-module optimization.
- it doesn't work when the module name doesn't match the file name.
  (this problem will go away when mmake functionality is moved into
  the compiler.

I'll hold off documenting this change in the NEWS file and
on the web page for a month or so, until I've had a bit more
experience using it.

compiler/options.m:
compiler/handle_options.m:
doc/user_guide.texi:
	Add an option `--smart-recompilation', currently off by default.

	Add an internal option `--generate-version-numbers' to control
	whether version numbers are written to the interface files. If
	`--smart-recompilation' is disabled because the module
	is being compiled with `--intermodule-optimization' (e.g. in the
	standard library), we still want to write the version numbers
	to the interface files.

	Add an option `--verbose-recompilation' (default off)
	to write messages describing why recompilation is needed.

	Add an option `--warn-smart-recompilation' (default on)
	to control warnings relating to the smart recompilation
	system. Warn if smart recompilation will not work with
	the output and inter-module optimization options given.

compiler/recompilation.m:
	Type declarations for smart recompilation.
	Predicates to record program items used by compilation.

compiler/recompilation_version.m:
	Compute version numbers for program items in interface files.

compiler/recompilation_usage.m:
	Find all items used by a compilation.

compiler/recompilation_check.m:
	Check whether recompilation is necessary.

compiler/timestamp.m:
	Timestamp ADT for smart recompilation.

compiler/mercury_compile.m:
	Invoke the smart recompilation passes.

compiler/modules.m:
compiler/prog_io.m:
	Return timestamps for modules read.

	When reading a module make sure the current input stream
	is reset to its old value, not stdin.

	Handle version number items in interface files.

compiler/module_qual.m:
compiler/unify_proc.m:
compiler/make_hlds.m:
	Record all items used by local items.

compiler/make_hlds.m:
	Process `:- pragma type_spec' declarations in
	add_item_list_clauses. The qual_info is needed
	when processing `:- pragma type_spec' declarations
	so that any equivalence types used by the declaration
	can be recorded as used by the predicate or function to
	which the `:- pragma type_spec' applies.

compiler/equiv_type.m:
	For each imported item, record which equivalence types
	are used by that item.

compiler/hlds_module.m:
	Add a field to the module_info to store information about
	items used during compilation of a module.

compiler/check_typeclass.m:
	Make sure any items used in clauses for typeclass method
	implementations are recorded in the `.used' file.

compiler/prog_data.m:
compiler/*.m:
	Factor out some duplicated code by combining the
	pred and func, and pred_mode and func_mode items.

	Make it easier to extract the name of a type, inst or mode
	from its declaration.

	Add an item type to hold the version numbers for an interface file.

	Allow warnings to be reported for `nothing' items (used for
	reporting when version numbers are written using an
	obsolete format).

compiler/prog_io.m:
compiler/prog_io_util.m:
compiler/typecheck.m:
compiler/type_util.m:
compiler/*.m:
	Strip contexts from all types, not just those in class constraints.
	This makes it possible to use ordinary unification to check
	whether items have changed (with the exception of clauses).

	Remove code to create types with contexts in typechecking.

	Remove code scattered through the compiler to remove contexts
	from types in class constraints.

compiler/hlds_pred.m:
compiler/prog_util.m:
	Move hlds_pred__adjust_func_arity to prog_util, so that it
	can be used by the pre-hlds passes.

compiler/typecheck.m:
compiler/hlds_module.m:
	Move typecheck__visible_modules to hlds_module.m, so it can
	be used by recompilation_usage.m.

compiler/typecheck.m:
	Add a comment telling where updates may be required if the
	code to typecheck a var-functor unification changes.

compiler/error_util.m:
	Allow writing messages without contexts (used for the verbose
	recompilation messages).

	Add functions to format sym_name and sym_name_and_arity,
	and to add punctuation to the end of an error message
	without unwanted line breaks before the punctuation.

scripts/Mmake.rules:
compiler/modules.m:
	Don't remove the output file before running the compiler. We need
	to leave the old output file intact if smart recompilation detects
	that recompilation is not needed.

compiler/notes/compiler_design.html:
	Document the new modules.

library/io.m:
NEWS:
	Add predicates to find the modification time of files
	and input_streams.

library/set.m:
NEWS:
	Add a predicate version of set__fold

	Don't sort the output of set__filter, it's already sorted.

library/std_util.m:
NEWS:
	Add a predicate `std_util__map_maybe/3' and a function
  	`std_util__map_maybe/2' to apply a predicate or a function to
    	a value stored in a term of type `std_util__maybe'.

configure.in:
runtime/mercury_conf.h.in:
runtime/RESERVED_MACRO_NAMES:
	When checking whether the compiler is recent enough, check for
	the --warn-smart-recompilation option.

	Check for stat().

library/Mmakefile:
	Disable warnings about smart recompilation not working with
	`--intermodule-optimization'.

browser/Mmakefile:
	Disable warnings about smart recompilation not working when
	the module name doesn't match the file name.

runtime/mercury_string.h:
	Add a macro MR_make_string_const() which automates computation
	of the length of string argument to MR_string_const().

tests/recompilation/Mmakefile:
tests/recompilation/runtests:
tests/recompilation/test_functions:
tests/recompilation/TESTS:
tests/recompilation/README:
	A framework for testing smart recompilation.
	The option currently only works for the recompilation directory.

tests/recompilation/TEST.m.{1,2}:
tests/recompilation/TEST_2.m.{1,2}:
tests/recompilation/TEST.exp.{1,2}:
tests/recompilation/TEST.err_exp.2:
	Test cases, where TEST is one of add_constructor_r, add_instance_r,
	add_instance_2_r, add_type_nr, change_class_r, change_instance_r,
	change_mode_r, field_r, func_overloading_nr, func_overloading_r,
	lambda_mode_r, nested_module_r, no_version_numbers_r,
	pragma_type_spec_r, pred_ctor_ambiguity_r, pred_overloading_r,
	add_type_re, remove_type_re, type_qual_re.

tests/handle_options:
	Add an option `-e' to generate any missing expected output files.
2001-06-27 05:05:21 +00:00
Tyson Dowd
bd732f891c Track the changes in the latest version of the .NET C++ compiler.
Estimated hours taken: 0.5
Branches: main

Track the changes in the latest version of the .NET C++ compiler.

scripts/Mmake.rules:
	Add mscoree.lib to the parameters passed to the C++ compiler.
2001-05-23 09:06:29 +00:00
Simon Taylor
319df48866 Remove the RM_C mmake variable, which controlled whether the intermediate
Estimated hours taken: 0.5
Branches: main

Remove the RM_C mmake variable, which controlled whether the intermediate
`.c' files were removed (now they never are).

The implementation was buggy (it didn't work with parallel makes), and
made it difficult to avoid always recompiling the `.c' file with smart
recompilation.

Mmake.common.in:
configure.in:
README.AIX:
bindist/bindist.build_vars.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
compiler/modules.m:
tools/bootcheck:
tools/binary_step:
*/Mmakefile:
	Remove references to RM_C, DEFAULT_RM_C and LIBRARY_RM_C.

compiler/modules.m:
	The `.o' and `.pic_o' file now depends only on the `.c' file,
	not on everthing the `.c' file depends on. The extra dependencies
	were only needed because the intermediate `.c' file could
	be removed by RM_C. This change is needed to avoid recompiling
	unchanged `.c' files with smart recompilation.
2001-05-18 14:23:59 +00:00
Tyson Dowd
5ddff184df A few fixes for the scripts in the .NET backend.
Estimated hours taken: 0.5
Branches: main

A few fixes for the scripts in the .NET backend.


scripts/Mmake.rules:
	Use -CLR instead of -com+, the latter is undocumented, confusing and
	may stop working in the future.

scripts/Mmake.vars.in:
	Remove the reference to the .NET libraries as these are no longer
	needed when using the command line C++ compiler cl.
	Remove ALL_CFLAGS from the CLFLAGS -- the wrong flags were being
	passed to cl (such as the -g flag) which it didn't understand.
2001-04-25 15:16:49 +00:00
Tyson Dowd
96eac21430 Modify Mmakefiles so that we don't try to install unnecessary
Estimated hours taken: 1
Branches: main release

boehm_gc/Mmakefile:
browser/Mmakefile:
trace/Mmakefile:
	Modify Mmakefiles so that we don't try to install unnecessary
	subsystems in IL grades.

runtime/Mmakefile:
	Add some support for installing the MCPP_HDRS and the DLLs in IL
	grades (largely untested).
	Fix some missing dependencies on the 'install_dirs' target.

library/Mmakefile:
scripts/Mmake.rules:
	Remove the check for ils_subdir, as this appears to be a
	cut-and-paste error -- the rules it surrounds are not for doing
	subdir builds.
	Use a clearer test for il as a substring in GRADE.
2001-03-16 01:40:43 +00:00
Fergus Henderson
9dcfc8663e Fix a problem where the nightly tests were failing the `--target asm'
Estimated hours taken: 0.5
Branches: main release

Fix a problem where the nightly tests were failing the `--target asm'
tests, because they were passing `--pic-reg', and that option was
being used with different semantics for the gcc back-end.

scripts/Mmake.rules:
	Use `--pic' rather than `--pic-reg'.
	(I forgot to commit this with my earlier changes.)
2001-03-11 16:52:45 +00:00
Fergus Henderson
05475302fd Add Mmake support for building code that uses the C interface
Estimated hours taken: 4

Add Mmake support for building code that uses the C interface
with the GCC back-end.

The GCC back-end already compiles code using the C interface to a
separate C file.  This changes add Mmake support for compiling that
file and linking it into the final executable (or library).

scripts/Mmake.rules:
	Add a rule for building the *__c_code.{o,pic_o} files.

compiler/modules.m:
	Add field names to the `modules_import' type.
	Add a new field `foreign_code' which records whether
	or not the module contains foreign code.
	For target asm, if the module does contain foreign code,
	include the *__c_code.o files as extra object files to link.

compiler/intermod.m:
compiler/mercury_compile.m:
	Trivial changes to reflect the new field of the modules_import
	type.
2001-01-24 13:18:26 +00:00
Fergus Henderson
624651fb03 Fix a bug in the Mmake support for shared libraries
Estimated hours taken: 0.75

Fix a bug in the Mmake support for shared libraries
for `--target asm'.

scripts/Mmake.rules:
	When generating the `.pic_s' file, pass `--pic-reg' to mmc.
	(XXX we should perhaps use a different option,
	e.g. `--pic', for this.)

compiler/mlds_to_gcc.m:
	If `--pic-reg' is passed, generate the output in a `.pic_s'
	file, rather than a `.s' file.
2001-01-24 06:28:34 +00:00
Fergus Henderson
da1f8c7f6a Fix a bug where the Mmake rule for making `.pic_s' files didn't work,
Estimated hours taken: 0.5

Fix a bug where the Mmake rule for making `.pic_s' files didn't work,
because it was passing $(CFLAGS_FOR_PIC), i.e. `-fpic -DPIC',
to the GCC back-end, but the GCC back-end didn't understand `-DPIC'.
(The GCC *driver* understands `-D', as does the GCC C front-end,
but the back-end doesn't.)

scripts/Mmake.vars.in:
	Define new variable GCCFLAGS_FOR_PIC, and set it to `-fpic'.

scripts/Mmake.rules:
	In the rule for making `.pic_s' files, use $(GCCFLAGS_FOR_PIC)
	instead of $(CFLAGS_FOR_PIC).
2001-01-23 16:12:56 +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
Tyson Dowd
53f2dbc1b4 First implementation of the standard library in managed C++.
Estimated hours taken: 200

First implementation of the standard library in managed C++.

configure.in:
	Autodetect the .NET SDK, and set MS_DOTNET_SDK_DIR based on it.
	Find the IL assembler, and set ILASM.

compiler/inlining.m:
	Turn off inlining of pragma_foreign_code with the IL backend.

compiler/mlds_to_c.m:
	Add a comment questioning the foreign language interfacing still to be
        done in this backend, and remove the "inline target code" from
        this list (since it has been completed).

compiler/mlds_to_il.m:
	Generate code for :- external.  We generate a forwarding
	function to the expected implementation in
	<modulename>__c_code.cpp

	Rename all the classes to use MixedCase, and to put them in the
	mercury.runtime namespace.

compiler/mlds_to_ilasm.m:
	Don't use the System or mercury namespaces by default.
	Change the names of the runtime cpp files to mercury_mcpp.dll
	and mercury_il.dll.
	Use c_util to output unops and binops.

doc/user_guide.texi:
	Document MS_CL_NOASM, MS_CLFLAGS and EXTRA_MS_CLFLAGS.

library/*.m:
	Rename pragma c_code as pragma foreign_code("C", ...).
	Add pragma foreign_code for MC++.
	Only a fraction of the predicates are implemented, everything
	else simply throws and exception when called.
	Implementations of predicates marked with :- external are
	provided as pragma foreign_code, but are commented out.

library/Mmakefile:
runtime/Mmakefile:
	Add targets for building the dlls for the library.

runtime/mercury_mcpp.cpp:
runtime/mercury_mcpp.h:
	Implementation of the runtime.

runtime/mercury_il.il:
	This file mainly implements things that can't be written in
	managed C++ (e.g. function pointers).

scripts/Mmake.rules:
scripts/Mmake.vars.in:
        Add rules for generating .dlls and .exes from .ils and .cpps.
2001-01-01 04:04:05 +00:00
Fergus Henderson
bc34d2adc6 Fix a bug with the Mmake dependencies for il' and .rlo'
Estimated hours taken: 0.5

compiler/modules.m:
	Fix a bug with the Mmake dependencies for `il' and `.rlo'
	files in cases of code involving nested modules where the
	source file name doesn't directly match the fully-qualified
	module name.

scripts/Mmake.rules:
	Fix a cut-and-paste error in the rule for creating `.il' files.
2000-12-09 11:03:10 +00:00
Fergus Henderson
72565412b8 Add Mmake support for generating `.il' files.
Estimated hours taken: 1

Add Mmake support for generating `.il' files.
Note that this change does NOT add rules for generating
`.dll' or `.exe' files from the `.il' files.

scripts/Mmake.vars.in:
	Set the ils_subdir variable.

scripts/Mmake.rules:
	Add a pattern rule for creating `.il' files.

compiler/modules.m:
	Add code to emit the dependencies for `.il' files.
	Add code to emit the `<main-module>.ils' variable
	and the `<main-module>.ils' target.
	Also fix a bug where it wasn't handling the `.rlos'
	target correctly when --use-subdirs was enabled.
2000-11-17 07:34:17 +00:00
Peter Ross
83cae0d2d0 When generating the .dv and .dep files use autoconfed settings for
Estimated hours taken: 8

When generating the .dv and .dep files use autoconfed settings for
such things as: object and library file extensions, and how to create a
library.  Change the compiler Mmakefiles to handle files with the new
extensions.

compiler/modules.m:
    When generating the '.dv' and '.dep' files use '.$O' and '.$A'
    instead of '.o' and '.a'.  Use $EXT_FOR_EXE when generating the
    realclean target, as you need to pass the full file name to rm.
    Use $AR_LIBFILE_OPT when creating libraries.

scripts/Mmake.vars.in:
    Set the value EXT_FOR_EXE, which is the extension which must be
    placed on executables.

Mmakefile:
library/Mmakefile:
runtime/Mmakefile:
scripts/Mmake.rules:
tools/bootcheck:
trace/Mmakefile:
    Use '.$O' for '.o' and '.$A' for '.a'.

util/Mmakefile:
    You need to remove PROGFILENAMES not PROGS, as PROGFILENAMES
    includes the executable extension.
2000-06-22 08:50:27 +00:00
Peter Ross
a68df3d95f Allow compilation of the mercury compiler *ONLY* in the grade hlc.gc
Estimated hours taken: 40

Allow compilation of the mercury compiler *ONLY* in the grade hlc.gc
using the Microsoft Visual C++ compiler (MSVC).  This is still
work-in-progress.

configure.in:
    Test to see whether or not we are using the Microsoft compiler.
    Don't fail if we can't interpret return values from system.

boehm_gc/Mmakefile:
    Use NT_MAKEFILE if we are using MSVC.

boehm_gc/NT_MAKEFILE:
    Apply the the changes to boehm_gc/Makefile to this file.

browser/Mmakefile:
library/Mmakefile:
runtime/Mmakefile:
trace/Mmakefile:
    Use the correct executable to create libraries.
    Use AR_LIBFILE_OPT to name the library.

compiler/llds_out.m:
    Export output_c_file_intro_and_grade so that the correct header can
    be placed at the start of each C file.

compiler/mlds_to_c.m:
    Output the header at the start of each C file, so that configure
    doesn't delete the file when checking the compatability with
    the configured settings.
    When initializing empty arrays place a dummy entry in the array, so
    that the MSVC compiler generates a symbol for that array.

compiler/passes_aux.m:
    Add invoke_shell_command.  This predicate wraps commands with
    a bash -c 'command ' when shell scripts aren't supported by the
    target system.

compiler/mercury_compile.m:
compiler/modules.m:
    Use invoke_shell_command instead of invoke_system_command for shell
    scripts.

library/io.m:
    Call _unlink in io_rename_file, when compiling with MSVC.


runtime/mercury_wrapper.c:
    Initialise MR_runqueue_head so that the segment containing this
    variable is registered with the garbage collector.  This stops
    intermittent failures of the GC_is_visible() test.

runtime/mercury_conf.h.in:
    Define MR_WIN32 when we are using MSVC.

runtime/mercury_memory.c:
runtime/mercury_memory_handlers.c:
runtime/mercury_memory_zones.c:
runtime/mercury_prof.c:
runtime/mercury_reg_workarounds.c:
runtime/mercury_reg_workarounds.h:
runtime/mercury_signal.c:
runtime/mercury_timing.c:
runtime/mercury_timing.h:
runtime/mercury_trace_base.c:
util/mkinit.c:
    Only include unistd.h and sys/times.h when they exist.
    MSVC doesn't have SIGBUS so #ifdef sections which refer to it.

scripts/Mmake.rules:
    Use /Fo instead of -o to generate .o files if compiling with MSVC.

scripts/Mmake.vars.in:
    Define AR to use the autoconfed executable for linking.

scripts/mgnuc.in:
    Only add option -Wno-uninitialized if we are using gcc.

util/Mmakefile:
    Explicitly locate the getopt src, and use it in compiling the
    utilities.
2000-06-08 07:59:13 +00:00
Fergus Henderson
2befe35249 In the rule for install_grades', invoke install_hdrs',
Estimated hours taken: 0.25

Mmakefile:
scripts/Mmake.rules:
	In the rule for `install_grades', invoke `install_hdrs',
	so that we install the header files too, not just the
	`.a' and `.so' files.  This is needed for MLDS grades.
2000-05-19 07:17:32 +00:00
Simon Taylor
864ce4f08b Fix a bug in Fergus' last change which broke the
Estimated hours taken: 0.1

scripts/Mmake.rules:
	Fix a bug in Fergus' last change which broke the
	`lib%.install_grades' target. Run `mmake <module>.depend'
	rather than `mmake lib<module>.depend'.
2000-05-19 01:54:53 +00:00
Fergus Henderson
b06f663025 Change the Mmake rules for `mmake install' so that they install the
Estimated hours taken: 3

Change the Mmake rules for `mmake install' so that they install the
compiler-generated header files for MLDS grades.

compiler/modules.m:
	Generate a new rule for `lib<module>.install_hdrs' in the `.dep' files.
	If --high-level-code is enabled, this rule installs the header
	files, otherwise it does nothing.

scripts/Mmake.rules:
	Make `lib<module>.install' depend on `lib<module>.install_hdrs'.

library/Mmakefile:
	- Override the default definition of `mercury.hs', so that
	  the header file names include the `mercury.' prefix that
	  the MLDS back-end uses for header files in the standard library.
	- Simplify the code by using the automatically generated rule for
	  `liblibrary.install_ints' rather than hand-coding it, and by
	  using `install_lib_dirs' and `install_grade_dirs' (which
	  are defined by scripts/Mmake.rules) rather than hand-coding
	  a rule for `install_dirs'.

Mmakefile:
scripts/Mmake.rules:
scripts/mercury_cleanup_install:
	In the rules for `mmake install_grades', make sure to move
	the `.h' and `.dep' files out of the way too, like we do for the
	`.c', `.o', etc. files, since the contents of the `.h' and `.dep'
	files now depend on the grade.
2000-05-17 12:07:19 +00:00
Simon Taylor
bde558d7ac Modify the Mmake rules to install libraries so that the user can
Estimated hours taken: 1

Modify the Mmake rules to install libraries so that the user can
specify commands to copy files and make directories. This is useful
if the user wants more control over the ownership and permissions of
the created files and directories.

scripts/Mmake.rules:
compiler/modules.m:
	Use $(INSTALL) to copy a file into its installed location.
	Use $(INSTALL_MKDIR) to create directories.

scripts/Mmake.vars.in:
	Set the default value of INSTALL to `cp' and
	INSTALL_MKDIR to `mkdir -p'.

doc/user_guide.texi:
	Document the new Mmake variables.
2000-05-11 03:46:29 +00:00
Fergus Henderson
d30500f2a3 Some fixes to the Mmake auto-dependency support for
Estimated hours taken: 1

Some fixes to the Mmake auto-dependency support for
the MLDS back-end.

scripts/Mmake.rules:
	When creating the dependencies, pass $(ALL_GRADEFLAGS) to mmc,
	since the `--high-level-code' option, which is a grade option
	(it corresponds to the `hlc' base grade) affects the dependencies.

compiler/mlds_to_c.m:
	Put the `#include' statements in the `.c' files rather than
	in the `.h' files.
2000-04-19 07:31:54 +00:00
Fergus Henderson
d9c496b1a9 Fix a portability problem: we need a ";" before the "}".
Estimated hours taken: 0.5

scripts/Mmake.rules:
	Fix a portability problem: we need a ";" before the "}".
2000-02-10 08:19:33 +00:00
Zoltan Somogyi
0f3fecd7a9 Add back these rules for bootstrapping purposes.
Estimated hours taken: 1

scripts/Mmake.rules:
	Add back these rules for bootstrapping purposes.
2000-01-14 01:33:43 +00:00
Warwick Harvey
d0b2a61a62 Added some extra dependencies to the generated `.d' files, so that local
Estimated hours taken: 3

Added some extra dependencies to the generated `.d' files, so that local
`.int', `.opt', etc. files shadow the installed versions properly (e.g. for
when you're trying to build a new version of an installed library).
This saves the user from having to add these explicitly if they have
multiple libraries installed in the same installation hierarchy which
aren't independent (e.g. one uses another).

This change is necessary due to the way the combination of search paths
and pattern rules works in Make.

compiler/modules.m:
	Generate the extra dependencies when writing `.d' files.

scripts/Mmake.rules:
	Deleted some obsoleted dependency rules.
2000-01-11 07:53:42 +00:00
Fergus Henderson
7654602989 Minor efficiency improvment in the rules for *.install and
Estimated hours taken: 0.1

scripts/Mmake.rules:
	Minor efficiency improvment in the rules for *.install and
	*.install_grades: use `{ ...; }' rather than `( ... )', to
	avoid creating unnecessary processes.
1999-10-25 14:26:56 +00:00
Warwick Harvey
be51ca48b6 Added built-in mmake support for installing user libraries.
Estimated hours taken: 30

Added built-in mmake support for installing user libraries.

Mmake.common.in:
	Moved the definitions of many of the generic install directories
	(plus FULLARCH and LIBGRADES) to scripts/Mmake.vars.in, so they
	can be used for things other than just the Mercury compiler.

compiler/modules.m:
	Added code to generate appropriate lib<module>.install* targets.
	Improved the dependency list generated for the lib<module> target to
	include intermodule optimisation files if and only if the
	appropriate flags have been set (previously it always depended on
	the `.opt' files, but never on the `.trans_opt' files).

scripts/Mmake.rules:
	Added some rules for use when installing libraries.

scripts/Mmake.vars.in:
	Added the definitions of many of the generic install directories
	(plus FULLARCH and LIBGRADES) from Mmake.common.in.
	Added support for overriding and/or adding to the definition of
	LIBGRADES on a per-library basis.

scripts/mercury_cleanup_install:
	New script, for cleaning up after failed installs.

scripts/Mmakefile:
	Added `mercury_cleanup_install' to the list of scripts to be
	installed.

bindist/Mmakefile:
bindist/bindist.Makefile.in:
	Added `mercury_cleanup_install' and `vpath_find' to the list of
	utilities included in and installed by a binary distribution.  These
	are used by some of the install targets.

doc/user_guide.texi:
	Documented the new features.

extras/references/Mmakefile:
extras/references/samples/Mmakefile:
	Changed to exploit/test new features.
1999-10-21 14:36:39 +00:00
Warwick Harvey
a11d224374 Reconciled the implementation and the documentation of the automatically
Estimated hours taken: 3

Reconciled the implementation and the documentation of the automatically
generated clean targets.  Also removed the `change_clean' targets to
simplify things, since they're not particularly useful.

`clean' now no longer deletes transitive optimization files, and should be
suitable for use when changing compilation models.  When changing the level
of intermodule optimization, a `depend' is required, but a `clean' is also
recommended.

compiler/modules.m:
	Removed the generation and recognition of the `.change_clean'
	target.
	Moved the deletion of the `.trans_opt' and `.trans_opt_date' files
	from the `.clean' target to the `.realclean' target.

doc/user_guide.texi:
	Removed the documentation for the `.change_clean' target, but
	documented how to achieve each of its two intended purposes by using
	other targets.
	Updated the documentation of the clean targets to more accurately
	and completely reflect what they do.

scripts/Mmake.rules:
	Removed a reference to `change_clean'.
1999-08-18 06:26:09 +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
Warwick Harvey
d2b98d996c Fixed a typo in the rule to generate .pic_o' files from .m' files
Estimated hours taken: 0.25

scripts/Mmake.rules:
	Fixed a typo in the rule to generate `.pic_o' files from `.m' files
	when `RM_C' is not set to `:'.
1999-07-14 07:17:51 +00:00
Mark Brown
bf66b3545c Add two new mmake targets, clean_local and realclean_local, which
Estimated hours taken: 1

Add two new mmake targets, clean_local and realclean_local, which
are the same as clean and realclean except that the former retain their
original meanings if rules are added to the latter.  This is useful
if users want to add rules for a recursive mmake clean.

compiler/modules.m:
	Output `clean_local: module.clean' to generated .dep files
	instead of `clean: module.clean'.  Same for `realclean'.

scripts/Mmake.rules:
	Add dependencies to implement the original targets in terms of
	the new targets.
1999-07-09 04:53:13 +00:00
Fergus Henderson
e06fa4993d For --use-subdirs, add `-I.' to ALL_MGNUCFLAGS rather than to
Estimated hours taken: 0.25

scripts/Mmake.rules:
	For --use-subdirs, add `-I.' to ALL_MGNUCFLAGS rather than to
	MGNUCFLAGS.  This avoids problems where EXTRA_MGNUCFLAGS and
	MGNUCFLAGS_FOR_TARGET were being interpreted as gcc options
	rather than as mgnuc options, because `-I.' is a gcc option
	rather than an mgnuc option and so all options which follow
	it are assumed to be gcc options.
1999-03-29 10:33:20 +00:00
Simon Taylor
18430aaef1 Aditi compilation.
Estimated hours taken: 1200

Aditi compilation.

compiler/options.m:
	The documentation for these is commented out because the Aditi
	system is not currently useful to the general public.
	--aditi: enable Aditi compilation.
	--dump-rl: write the intermediate RL to `<module>.rl_dump'.
	--dump-rl-bytecode: write a text version of the bytecodes
		to `<module>.rla'
	--aditi-only: don't produce a `.c' file.
	--filenames-from-stdin: accept a list of filenames to compile
		from stdin. This is used by the query shell.
	--optimize-rl, --optimize-rl-cse, --optimize-rl-invariants,
	--optimize-rl-index, --detect-rl-streams:
		Options to control RL optimization passes.
	--aditi-user:
		Default owner of any Aditi procedures,
		defaults to $USER or "guest".
	--generate-schemas:
		write schemas for base relations to `<module>'.base_schema
		and schemas for derived relations to `<module>'.derived_schema.
		This is used by the query shell.

compiler/handle_options.m:
	Handle the default for --aditi-user.

compiler/hlds_pred.m:
compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/make_hlds.m:
	Add some Aditi pragma declarations - `aditi', `supp_magic', `context',
	`naive', `psn' (predicate semi-naive), `aditi_memo', `aditi_no_memo',
	`base_relation', `owner' and `index'.
	Separate out code to parse a predicate name and arity.

compiler/hlds_pred.m:
	Add predicates to identify Aditi procedures.
	Added markers `generate_inline' and `aditi_interface', which
	are used internally for Aditi code generation.
	Add an `owner' field to pred_infos, which is used for database
	security checks.
	Add a field to pred_infos to hold the list of indexes for a base
	relation.

compiler/make_hlds.m:
	Some pragmas must be exported if the corresponding predicates
	are exported, check this.
	Make sure stratification of Aditi procedures is checked.
	Predicates with a mode declaration but no type declaration
	are no longer assumed to be local.
	Set the `do_aditi_compilation' field of the module_info if there
	are any local Aditi procedures or base relations.
	Check that `--aditi' is set if Aditi compilation is required.

compiler/post_typecheck.m:
	Check that every Aditi predicate has an `aditi__state' argument,
	which is used to ensure sequencing of updates and that Aditi
	procedures are only called within transactions.

compiler/dnf.m:
	Changed the definition of disjunctive normal form slightly
	so that a call followed by some atomic goals not including
	any database calls is considered atomic. magic.m can handle
	this kind of goal, and it results in more efficient RL code.

compiler/hlds_module.m:
compiler/dependency_graph.m:
	Added dependency_graph__get_scc_entry_points which finds
	the procedures in an SCC which could be called from outside.
	Added a new field to the dependency_info, the
	aditi_dependency_ordering. This contains all Aditi SCCs of
	the original program, with multiple SCCs merged where
	possible to improve the effectiveness of differential evaluation
	and the low level RL optimizations.

compiler/hlds_module.m:
	Add a field to record whether there are any local Aditi procedures
	in the current module.
	Added versions of module_info_pred_proc_info and
	module_info_set_pred_proc_info which take a pred_proc_id,
	not a separate pred_id and proc_id.

compiler/polymorphism.m:
compiler/lambda.m:
	Make sure that predicates created for closures in Aditi procedures
	have the correct markers.

compiler/goal_util.m:
	Added goal_util__switch_to_disjunction,
	goal_util__case_to_disjunct (factored out from simplify.m)
	and goal_util__if_then_else_to_disjunction. These are
	require because supplementary magic sets can't handle
	if-then-elses or switches.

compiler/type_util.m:
	Added type_is_aditi_state/1.

compiler/mode_util.m:
	Added partition_args/5 which partitions a list of arguments
	into inputs and others.

compiler/inlining.m:
	Don't inline memoed procedures.
	Don't inline Aditi procedures into non-Aditi procedures.

compiler/intermod.m:
	Handle Aditi markers.
	Clean up handling of markers which should not appear in `.opt' files.

compiler/simplify.m:
	Export a slightly different interface for use by magic.m.
	Remove explicit quantifications where possible.
	Merge multiple nested quantifications.
	Don't report infinite recursion warnings for Aditi procedures.

compiler/prog_out.m:
	Generalised the code to output a module list to write any list.

compiler/code_gen.m:
compiler/arg_info.m:
	Don't process Aditi procedures.

compiler/mercury_compile.m:
	Call magic.m and rl_gen.m.
	Don't perform the low-level annotation passes on Aditi procedures.
	Remove calls to constraint.m - sometime soon a rewritten version
	will be called directly from deforestation.

compiler/passes_aux.m:
	Add predicates to process only non-Aditi procedures.

compiler/llds.m:
compiler/llds_out.m:
	Added new `code_addr' enum members, do_{det,semidet,nondet}_aditi_call,
	which are defined in extras/aditi/aditi.m.

compiler/call_gen.m:
	Handle generation of do_*_aditi_call.

compiler/llds_out.m:
	Write the RL code for the module as a constant char array
	in the `.c' file.

compiler/term_errors.m:
compiler/error_util.m:
	Move code to describe predicates into error_util.m
	Allow the caller to explicitly add line breaks.
	Added error_util:list_to_pieces to format a list of
	strings.
	Reordered some arguments for currying.

compiler/hlds_out.m:
	Don't try to print clauses if there are none.

runtime/mercury_init.h:
util/mkinit.c:
scripts/c2init.in:
	Added a function `mercury__load_aditi_rl_code()' to the generated
	`<module>_init.c' file which throws all the RL code for the program
	at the database. This should be called at connection time by
	`aditi__connect'.
	Added an option `--aditi' which controls the output
	`mercury__load_aditi_rl_code()'.

compiler/notes/compiler_design.html:
	Document the new files.

Mmakefile:
bindist/Mmakefile:
	Don't distribute extras/aditi yet.

New files:

compiler/magic.m:
compiler/magic_util.m:
	Supplementary magic sets transformation. Report errors
	for constructs that Aditi can't handle.

compiler/context.m:
	Supplementary context transformation.

compiler/rl_gen.m:
compiler/rl_relops.m:
	Aditi code generation.

compiler/rl_info.m:
	Code generator state.

compiler/rl.m:
	Intermediate RL representation.

compiler/rl_util:
	Predicates to collect information about RL instructions.

compiler/rl_dump.m:
	Print out the representation in rl.m.

compiler/rl_opt.m:
	Control low-level RL optimizations.

compiler/rl_block.m:
	Break a procedure into basic blocks.

compiler/rl_analyse.m:
	Generic dataflow analysis for RL procedures.

compiler/rl_liveness.m:
	Make sure all relations are initialised before used, clear
	references to relations that are no longer required.

compiler/rl_loop.m:
	Loop invariant removal.

compiler/rl_block_opt.m:
	CSE and instruction merging on basic blocks.

compiler/rl_key.m:
	Detect upper/lower bounds for which a goal could succeed.

compiler/rl_sort.m:
	Use indexing for joins and projections.
	Optimize away unnecessary sorting and indexing.

compiler/rl_stream.m:
	Detect relations which don't need to be materialised.

compiler/rl_code.m:
	RL bytecode definitions. Automatically generated from the Aditi
	header files.

compiler/rl_out.m:
compiler/rl_file.m:
	Output the RL bytecodes in binary to <module>.rlo (for use by Aditi)
	and in text to <module>.rla (for use by the RL interpreter).
	Also output the schema information if --generate-schemas is set.

compiler/rl_exprn.m:
	Generate bytecodes for join conditions.

extras/aditi/Mmakefile:
extras/aditi/aditi.m:
	Definitions of some Aditi library predicates and the
	interfacing and transaction processing code.
1998-12-06 23:49:14 +00:00
Fergus Henderson
99b39fd3fc Fix a bug reported by Renaud Paquay <rpa@miscrit.be>.
Estimated hours taken: 0.5

Fix a bug reported by Renaud Paquay <rpa@miscrit.be>.

compiler/modules.m:
scripts/Mmake.rules:
	When invoking Mmake recursively, pass down the values of
	MC and ALL_MCFLAGS, in case their values were overridden
	on the command line.
1998-10-29 16:25:55 +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
c766e2dfcc Fix a bug or two introduced in my previous change:
Estimated hours taken: 0.25

scripts/Mmake.rules:
	Fix a bug or two introduced in my previous change:
	it turns out that making `%.depend' depend on `%.dep'
	doesn't work, because (a) GNU Make deletes the
	"intermediate" .dep file after making it and
	(b) it won't remaking the `.dep' file if it already exists.
	So I when back to the old solution of code duplication,
	just adding a comment to warn about the duplication.
1998-06-12 16:35:01 +00:00
Fergus Henderson
be0df21856 Fix a problem where the dependency files were being remade unnecessarily.
Estimated hours taken: 0.5

Fix a problem where the dependency files were being remade unnecessarily.
The problem was caused by the following change:

> Instead of deleting the `_init.c' file every time we recreate
> the `.dep' file, just tell make that the `_init.c' file depends on
> the `.dep' file, so that make will remake it if the `.dep' file
> changes.  (I don't know why I didn't do it that way in the
> first place.)

The reason we didn't want the `_init.c' file to define on the `.dep'
file is that the `.dep' file is listed as depending on the top-level
`.m' file.  The fix is to change things so that the `.dep' file
is not listed as depending on the `.m' file.

scripts/Mmake.rules:
	Fix some code duplication (and subsequent code rot, caused by
	changes in one place but not the other) in the rules for `.dep'
	and `.depend'.
	Delete the `.m' file from the dependencies for the `.dep' file.
1998-06-12 04:11:37 +00:00
Fergus Henderson
ea5d21a93a Update the GNU make bug work-around so that it creates the `date3s'
Estimated hours taken: 0.25

scripts/Mmake.rules:
	Update the GNU make bug work-around so that it creates the `date3s'
	directory as well as the other `*date*' directories when doing
	`mmake depend'.  Previously, the *.int3 files never depended on
	anything else (they were always the first thing created), so this
	wasn't necessary.  However, with nested modules, the `.int3'
	files for sub-modules depends on the `.int3' file for the parent
	module, so we now need to create the `date3s' directory too.
1998-05-29 04:20:32 +00:00
Fergus Henderson
935fbfe36e Add Mmake support for nested sub-modules.
Estimated hours taken: 6

Add Mmake support for nested sub-modules.

compiler/mercury_compile.m:
compiler/modules.m:
compiler/intermod.m:
	Pass down the source file name to various places.
	Store the source file name in the module_imports data structure.
	In various places, use this source file name instead of assuming
	that the source file name can be obtained from the module name.

compiler/modules.m:
	Change the generated .d and .dep files to use the source file names.
	Add hard-coded rules in the .d files if the source file name does not
	match the form expected by the pattern rules in scripts/Mmake.rules.
	XXX unfortunately the rules don't work right for parallel makes of
	    nested modules

scripts/Mmake.rules:
	Add a comment saying that any changes here might need to
	be duplicated in compiler/modules.m.

tests/hard_coded/Mmakefile:
tests/hard_coded/nested.m:
tests/hard_coded/nested2.m:
tests/hard_coded/nested.exp:
tests/hard_coded/nested2.exp:
	Add a couple of test cases for nested modules (XXX not enabled,
	due to the above-mentioned problem with parallel makes).

doc/reference_manual.texi:
	Update the "implementation bugs and limitations" section.

NEWS:
	Update the news about nested modules.
1998-05-27 04:00:54 +00:00
Fergus Henderson
54f7db8c33 When invoking make recursively, pass $(MFLAGS) rather than
Estimated hours taken: 0.5

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).  Previously I made exactly the same change
	in one place, but missed another occurrence of
	$(MAKEOVERRIDES).  This change fixes that other occurrence.

	Also when invoking make recursively, pass down the value of
	$(GRADEFLAGS).  Newer versions of GNU Make (e.g. 3.75) do
	this automatically, but older versions (e.g. 3.70) don't.
	This should fix a bug reported by Warwick Harvey where
	`mmake install_grades' at the top-level caused `.m' files in
	the library to be compiled with the wrong grades.
1998-05-26 09:48:29 +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
Fergus Henderson
7860363a0e Fix some bugs which meant that building NU-Prolog or SICStus Prolog
Estimated hours taken: 2

Fix some bugs which meant that building NU-Prolog or SICStus Prolog
executables with MMAKE_USE_SUBDIRS set to `yes' did not work.

scripts/mnc.in:
scripts/msc.in:
	Add support for a `--use-subdirs' option.

scripts/Mmake.rules:
	If MMAKE_USE_SUBDIRS=yes, then add `--use-subdirs' to
	$(MNCFLAGS) and $(MSCFLAGS).

scripts/mnl.in:
	Add support for new environment variable MERCURY_NU_DEBUG_LIB_OBJS,
	for use by library/Mmakefile.

library/Mmakefile:
	Fix places where .no and .ql files where hard-coded as being in
	the current directory instead of in $(nos_subdir) or $(qls_subdir).
1998-03-27 16:37:01 +00:00
Fergus Henderson
1481544541 Fix the handling of dependencies on $(MLOBJS) and $(MLPICOBJS)
Estimated hours taken: 0.5

Fix the handling of dependencies on $(MLOBJS) and $(MLPICOBJS)
so that we don't reinvoke the linker for every make, even when
the executable(s) are already up-to-date.

scripts/Mmake.rules:
	Delete the MLOBJS and MLPICOBJS targets.
	Add `$(MLOBJS_DEPS) : $(MLOBJS)', and likewise for $(MLPICOBJS).

compiler/modules.m:
	When generating the `.dep' files, instead of using the MLOBJS
	and MLPICOBJS phony targets, record dependencies of files on
	$(MLOBJS) by adding those files to $(MLOBJS_DEPS),
	and likewise for $(MLPICOBJS).
1998-03-20 05:53:27 +00:00