Commit Graph

27 Commits

Author SHA1 Message Date
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
Fergus Henderson
1b2817b075 Work-around bug in "$@" handling in Ultrix's /bin/sh.
scripts/mmake.in:
	Work-around bug in "$@" handling in Ultrix's /bin/sh.
1995-09-13 04:02:58 +00:00
Fergus Henderson
3ab5e9e46a Remove some old special-case stuff (if $host = kryten ...).
scripts/ml.in:
	Remove some old special-case stuff (if $host = kryten ...).

	Change it so that it uses $CC as determined by configure
	rather than hard-coding gcc.

	Use a named pipe to invoke the demangler, so that we
	return the exit status of the C compiler, not the demangler.

	Add a new option --no-libs which suppresses the linking
	in of the libraries; this is useful if you want to link
	a shared library and have the output of the linker passed
	through the demangler.

scripts/mmake.in:
	Use a new environment variable MMAKE_DIR as the location to
	look for both Mmake.vars and Mmake.rules; this is simpler than
	use the MMAKE_VARS and MMAKE_RULES environment variables.
1995-07-29 11:16:47 +00:00
Fergus Henderson
1b69277fd6 Use MERCURY_DEFAULT_GRADE, with a default value @DEFAULT_GRADE@
{mc,ml,mgnuc,mmake}.in:
	Use MERCURY_DEFAULT_GRADE, with a default value @DEFAULT_GRADE@
	determined by configure, rather than hard-coding asm_fast.gc as
	the default grade.

mmake.in:
	Update the documentation.
1995-05-29 14:20:57 +00:00
Fergus Henderson
326edf7fc4 Use @GNU_MAKE@' (from configure) rather than make' as the
scripts/mmake.in:
	Use `@GNU_MAKE@' (from configure) rather than `make' as the
	default make program to use.
1995-05-20 14:39:38 +00:00
Fergus Henderson
60bc8f3ef9 Change "#!/bin/sh" to "#! /bin/sh", since the latter is more portable.
scripts/*.in:
	Change "#!/bin/sh" to "#! /bin/sh", since the latter is more portable.
	Add "# @configure_input@" to the start of each file.
1995-05-19 08:17:46 +00:00
Fergus Henderson
76dbe913e2 Rename *.sh as *.in.
scripts:
	Rename *.sh as *.in.
	The scripts are now made by configure, not by make/mmake in the
	scripts directory.
1995-05-12 21:01:34 +00:00