Files
mercury/compiler/libs.m
Peter Wang 3085aa8f6d Add mmc --make --track-flags:
Branches: main

Add mmc --make --track-flags:

    --track-flags
	With `--make', keep track of the options used when compiling
	each module.  If an option for a module is added or removed,
	`mmc --make' will then know to recompile the module even if the
	timestamp on the file itself has not changed.  Warning and
	verbosity options are not tracked.

The motivation was to be able to set the execution trace level on selected
modules by editing Mercury.options, without needing to manually touch the
affected files afterwards to force recompilation.  It's probably useful for
anyone that's worried about consistent builds.

The implementation works by recording a hash of the option table which is the
product of the options set for each particular module in .track_flags files,
not a hash of the actual options passed by the user, which might be reordered
or redundant, etc.  Hashes are used as they are much quicker to compare and
take less space (the full options tables are quite big).

compiler/options.m:
	Add the new option.

	Add a predicate to return options that shouldn't be tracked
	(e.g. adding -v shouldn't cause everything to recompile).

compiler/make.m:
	When --track-flags is enabled, write `.track_flags' files which need
	to be changed.

compiler/make.dependencies.m:
	When --track-flags is enabled, make compiled code files depend on the
	`.track_flags' files.

compiler/make.program_target.m:
	Delete .track_flags files on realclean.

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

compiler/libs.m:
compiler/md4.m:
	Add an implementation of the MD4 digest function to libs.

doc/user_guide.texi:
NEWS:
	Document the new option.

	Recommend `mmc --make' instead of `mmake' in the user guide.

library/term_io.m:
	Avoid unnecessary memory allocation in should_atom_be_quoted.
2009-04-16 01:45:09 +00:00

45 lines
1.5 KiB
Mathematica

%-----------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%-----------------------------------------------------------------------------%
% Copyright (C) 2002-2003, 2005, 2008-2009 The University of Melbourne.
% This file may only be copied under the terms of the GNU General
% Public License - see the file COPYING in the Mercury distribution.
%-----------------------------------------------------------------------------%
%
% This package contains general utilities that are used by other packages.
%
:- module libs.
:- interface.
% Option handling.
:- include_module globals.
:- include_module handle_options.
:- include_module options.
:- include_module trace_params.
% Error handling.
:- include_module compiler_util.
% Generic algorithms and data structures that are not quite useful enough
% or otherwise aren't in the standard library.
:- include_module atsort.
:- include_module file_util.
:- include_module graph_colour.
:- include_module md4.
:- include_module pickle.
% OS interfaces not provided by the standard library.
:- include_module process_util.
:- include_module timestamp.
% Constraint machinery for the termination analysers.
:- include_module lp.
:- include_module lp_rational.
:- include_module polyhedron.
:- include_module rat.
%-----------------------------------------------------------------------------%
:- end_module libs.
%-----------------------------------------------------------------------------%