Commit Graph

18 Commits

Author SHA1 Message Date
Julien Fischer
2deb13aa63 Delete the unused libmmc target.
Makefile:
Mmakefile:
    Delete the libmmc target; we haven't supported building the compiler as
    a library for a number of years.
2020-04-14 21:26:30 +10:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Peter Wang
6b1f89831e Let Mercury be built with a MinGW cross-compiler.
Branches: main

Let Mercury be built with a MinGW cross-compiler.

tools/configure_mingw_cross:
	Add shell script to prepare for cross-compilation.

README.MinGW-cross:
	Document how to use the shell script.

configure.in:
Mmake.common.in:
	Set a new variable CROSS_COMPILING.

	Set FULLARCH and BUILD_C_PROGS_FOR_BUILD_SYSTEM variables
	to be passed to the Boehm GC build system.

	Use $host-ar for AR when cross-compiling.

m4/mercury.m4:
	Determine gcc version with gcc -dumpversion instead of building
	a program and running it.

	Don't run test for mercury_cv_cc_type if set explicitly.

Mmake.workspace:
	Use the default c2init and mkinit when cross-compiling.
	The copies in the util directory would not be usable then.

boehm_gc/Mmakefile:
	Pass configured values of AR, RANLIB down to sub-make.

boehm_gc/Makefile.direct:
boehm_gc/build_atomic_ops.sh:
	Use configured value from Mmake.common for HOSTCC.

	Pass --host when configuring libatomic_ops.

util/Mmakefile:
	Make tools with .exe suffixes on Windows.

Mmakefile:
	Use the bootstrap compiler to build libgrades when cross-compiling.

	Conform to changed target names in the util directory.

compiler/Mmakefile:
deep_profiler/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	Conform to changed target names in the util directory.

Makefile:
	Clean .exe files on Windows.
2012-01-09 00:35:41 +00:00
Paul Bone
fd1459eccc Compatibility with Debian packaging.
Packaging Mercury for Debian requires creating some patches to make sure that
Mercury can be built under the control of dpkg-buildpackage.  It's recommended
that these patches are pushed upstream (into Mercury) so that everyone can
benefit from them, not just Debian packagers.

Mmake.common.in:
scripts/Mmake.vars.in:
    Install Mercury at $DESTDIR/@prefix@, $DESTDIR helps someone setup Mercury
    to run from @prefix@ while putting it in $DESTDIR.  $DESTDIR/* can easily
    be tared up and then deployed on other systems.

Mmakefile:
Makefile:
    Pass the $DESTDIR variable to make sub-processes.

scripts/Mercury.config.in:
scripts/Mercury.config.bootstrap.in:
    Remove the hash-bang line from these scripts since they are not executable.

    This change improves conformance with Debian packaging standards.
2010-12-14 07:01:55 +00:00
Peter Wang
6ad6d12260 Filter out warning message from gcc 4.x which are emitted when compiling
Branches: main, 10.04

Filter out warning message from gcc 4.x which are emitted when compiling
low-level C code using assembler labels, at least until a better fix is
available.

util/Mmakefile:
util/mfiltercc.c:
        Add a new program, mfiltercc.

compiler/options.m:
        Add `--filtercc-command' option (undocumented).

compiler/compile_target_code.m:
        Filter compiler output with mfiltercc if using assembler labels.

scripts/mgnuc.in:
        Filter compiler output with mfiltercc if using assembler labels, but
        only if mfiltercc can be found on the $PATH.  The bootstrap compiler
        may not have mfiltercc.

.mercury-compiler.spec.in:
Makefile:
README.MinGW:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
scripts/mercury_config.in:
        Mention mfiltercc in various places.
2010-07-09 07:10:16 +00:00
Zoltan Somogyi
c5b34b9847 Don't automatically save the output of "make all" and "make install"
Estimated hours taken: 0.1
Branches: main

Makefile:
	Don't automatically save the output of "make all" and "make install"
	in log files. If the users want to save the info, they can do so
	themselves.
2005-08-22 03:38:34 +00:00
Ian MacLarty
5d2b07416c Fix shared libs on Mac OS X for the source distribution.
Estimated hours taken: 8
Branches: main

Fix shared libs on Mac OS X for the source distribution.  The problem is that
the source distribution is generated on a Linux PC, so the Darwin-specific
-install_name linker option is not passed to the linker in the .dep files.

The fix is to instead pass the -install_name linker option in the Mmakefiles.
However this means that the -install_name linker option will be passed twice
(which is not allowed by the linker) if the .dep files are generated on a
Darwin system, so we disable the --shlib-linker-use-install-name mmc flag so
that the -install_name linker option is not passed in the .dep files.

Also change the default install-name path to the value of
FINAL_INSTALL_MERC_LIB_DIR, instead of just INSTALL_MERC_LIB_DIR in case the
install directory is different from the final install directory.

Makefile
	Remove .dylib files when cleaning.

browser/Mmakefile
library/Mmakefile
	Pass -install_name linker option when building .dylib targets.
	Disable --shlib-linker-use-install-name mmc option.

compiler/options.m
	Change default value of --shlib-linker-install-name-path to the value
	of FINAL_INSTALL_MERC_LIB_DIR, instead of INSTALL_MERC_LIB_DIR.
2004-11-01 04:46:20 +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
Fergus Henderson
499ffadbc3 Connect the Mercury compiler to the GCC back-end.
Estimated hours taken: 120

Connect the Mercury compiler to the GCC back-end.
These changes give us a version of the Mercury compiler which
compiles to assembler without going via any intermediate files.
This version generates GCC's `tree' data type, and then calls functions
in the GCC middle-end to convert that to GCC's RTL (Register Transfer
Language) and to invoke the rest of the GCC middle-end and back-end
to compile it to assembler.

RATIONALE

The main advantage is improved compilation speed.

(The improvement is not huge, since the current front-end is so slow,
but improving the speed of the back-end increases the incentive to
improve the speed of the front-end, since it means that any increases
in the speed of the front-end will get bigger overall speedups.)

Another advantage is that it gives us more opportunity to give the GCC
back-end information about how to optimize the code that we generate.
For example:
	- We can tell GCC when it is safe to treat function calls
	  as tail calls.  (The gcc back-end already has some support
	  for doing tail calls.  But its check to determine when
	  it is safe to do them is much too conservative for Mercury.
	  I've been working on extending the gcc back-end infrastructure
	  so that front ends can tell the gcc back-end when it is safe.)
	- We can use `__builtin_{set,long}jmp' rather than ordinary
	  `{set,long}jmp'.  (We can also do this for the C back-end,
	  as it happens, since those are supported in GNU C too, but
	  I wouldn't have found out about it if not for doing this
	  back-end.)  Or we can use gcc's exception handling;
          the gcc developers have told me that using exception
	  handling may be more efficient on some platforms.
	- We can mark GC_malloc as an allocation function,
	  so that GCC knows that stuff allocated with it won't
	  alias other pointers.
	- In general we could give GCC more information about aliasing.
	  I haven't investigated this much yet, but I think the GCC
	  back-end has support for keeping track of alias sets and
	  recording which set each pointer points to and which sets
	  may be subsets of which other sets.

Another advantage is that it provides a demonstration of how to
compile logic languages or functional languages using the GNU C
back-end.  This may be useful to researchers or open-source developers
who are working on other languages.

It is also good public relations, because it removes one more
barrier towards acceptance of Mercury.  Some people want a language
implementation that has a "native code compiler", and don't want one
that compiles via C.  These people may be more willing to consider
Mercury now.

gcc/mercury:
	New directory.
	This contains the C side of the Mercury <-> GCC interface.

gcc/mercury/Make-lang.in:
gcc/mercury/config-lang.in:
gcc/mercury/lang-specs.h:
	Makefile/configure/specs fragments (respectively)
	that are required by GCC.

gcc/mercury/lang-options.h:
	Documents the Mercury-specific gcc options,
	in particular the `--mmc-flag=' option.

gcc/mercury/mercury-gcc.c:
gcc/mercury/mercury-gcc.h:
	This is the "meat" on the C side of the Mercury <-> GCC interface.
	These files provide the C code that GCC requires of each
	language front-end.  They also define some routines for
	building parts of the GCC `tree' data structure that are
	used by the Mercury compiler.

gcc/mercury/Makefile:
	A Makefile which just runs `make mercury' in the parent directory.
	Just for convenience.

gcc/mercury/README:
gcc/mercury/ChangeLog:
	Some (very basic) documentation.

gcc/mercury/test.m:
	A sample Mercury module, to serve as a simple test case.

gcc/mercury/testmercury.c:
	C driver program for the test Mercury module.

mercury/compiler/gcc.m:
	New file.  This is an interface to the tree data structure defined
	in gcc/tree.h, and to functions for manipulating that data structure
	which are defined in gcc/mercury/mercury-gcc.c and in other parts
	of the GCC back-end.  It's almost entirely composed of simple
	pragma c_code routines that each just call a single C function.

mercury/compiler/mlds_to_gcc.m:
	New file.  This converts the MLDS into the gcc tree representation
	whose interface is in gcc.m, using the routines defined in gcc.m.
	This is the "meat" on the Mercury side of the Mercury <=> GCC interface.

mercury/compiler/globals.m:
	Define new target `asm', for compiling directly to assembler
	(without any intermediate files), via the gcc back-end.

mercury/compiler/handle_options.m:
	`--target asm' implies `--high-level-code'.

mercury/compiler/mercury_compile.m:
	Handle `--target asm' by invoking mlds_to_gcc.m.

mercury/main.c:
	New file, containing main() that calls mercury_main().

mercury/compiler/Mmakefile:
	Add C2INITFLAGS=--library, so that we can link `libmercury_compile.a'
	as a library without main().  For the mercury_compile executable,
	get main by linking in ../main.o.

	Add `libmmc' target, for building libmercury_compile.a and
	mercury_compile_init.a.

	Add the appropriate `-D' and `-I' options to CFLAGS-gcc so that we
	can compile gcc.m.

mercury/runtime/mercury.c:
	Define out-of-line copies of MR_box_float() and MR_unbox_float(),
	so that the new `--target asm' back-end can generate calls to them.

mercury/runtime/mercury.h:
mercury/runtime/mercury_heap.h:
	Add comments warning about code duplication between
	the inline and out-of-line versions of various functions.

mercury/Makefile:
mercury/Mmakefile:
	Add `libmmc' target, for use by gcc/mercury/Make-lang.in.

mercury/runtime/mercury_std.h:
	When IN_GCC is defined, use safe_ctype.h rather than
	ctype.h, since the latter conflicts with the GCC headers.

	Comment out the definition of the `reg' macro, since
	that too conflicts with the GCC headers.

mercury/runtime/mercury_dlist.c:
mercury/runtime/mercury_hash_table.c:
mercury/runtime/mercury_stacks.h:
	Delete unnecessary uses of the `reg' macro.
2001-01-10 10:57:25 +00:00
Fergus Henderson
40f7fad627 Fix some code rot in the rules for `make clean';
Estimated hours taken: 0.5

Makefile:
tests/valid/Mmakefile:
tests/invalid/Mmakefile:
	Fix some code rot in the rules for `make clean';
	amoung other things, change them so that they
	handle `--use-subdirs' correctly.
1998-04-09 03:59:12 +00:00
Tyson Dowd
7ce7d489a2 Cleaned up runtime directory.
Estimated hours taken: 2

Cleaned up runtime directory.

runtime/*.c:
	- Renamed all .c files as mercury_*.c
	  Some have been renamed to make their purpose clearer.
	  	call.mod -> mercury_ho_call.c

runtime/*.h:
	- Moved contents of .h files to mercury_*.h
	- *.h now contain #include mercury_*.h. They be removed later.
	- Updated references to conf.h -> mercury_conf.h

runtime/conf.h.in:
	- Renamed conf.h.in as mercury_conf.h.in.
	  Didn't leave a forwarding header for this one, as conf.h was
	  never part of the repository anyway.

runtime/Mmakefile:
	- Convert lists to one-per-line lists.
	- Add mercury_accurate_gc.h to HDRS.
	- Remove all .mod files
	- Make sure runtime.init uses the ORIG_CS not MOD_CS.
	- Fix the rules for "clean_o" and "clean_mod_c", which used
	  wildcards like "*.o" to remove files.  The one that removed
	  all .c files corresponding with *.mod, instead of using MOD_CS
	  was particularly vicious.
	- Cope with the file renamings.

configure.in:
	- Cope with the file renamings.
1997-11-20 02:04:40 +00:00
Fergus Henderson
d254f4c722 Declare the phony targets as `.PHONY'.
Estimated hours taken: 0.25

Makefile:
	Declare the phony targets as `.PHONY'.
	This avoids a problem on gnu-win32 where the case-insensitive
	file system means that make does the wrong thing for `make install'
	because of the existence of the `INSTALL' file.
1996-12-05 20:30:53 +00:00
Fergus Henderson
d8ea9c5247 Save the output of make all' and make install' in log files.
Estimated hours taken: 0.2

mercury/Makefile:
	Save the output of `make all' and `make install' in log files.
1996-01-26 14:22:53 +00:00
Fergus Henderson
13dc858451 In the rule for distclean', remove bindist/bindist.build_vars'.
Estimated hours taken: 0.1

mercury/Makefile:
	In the rule for `distclean', remove `bindist/bindist.build_vars'.
1996-01-23 12:21:49 +00:00
Fergus Henderson
3a3e1733f4 Add `uninstall' target.
mercury/Makefile:
	Add `uninstall' target.
1995-10-24 07:19:30 +00:00
Fergus Henderson
0ae0eb1a51 Oops, -j2 should not be enabled by default.
mercury/Makefile:
	Oops, -j2 should not be enabled by default.
1995-09-12 01:48:36 +00:00
Fergus Henderson
238bf814fa Fix bug in the passing of $PARALLEL (-j2) options.
mercury/Makefile:
	Fix bug in the passing of $PARALLEL (-j2) options.
1995-09-08 02:44:41 +00:00
Fergus Henderson
83f485a2e0 Embed the `hello world' Mercury program in the configure
configure.in:
	Embed the `hello world' Mercury program in the configure
	script rather than compiling the one in the samples directory.
	Add support for shared libraries on i386-*-freebsd*.

Makefile:
	Add a Makefile which basically just forwards the work to Mmake.
	This is just to make the installation sequence more standard.

INSTALL:
	Modify the instructions so that they use `make' rather than `mmake'.

Mmake:
	Make the `mmake clean' rule remove `config.log' and `config.status'.
	Pass MMAKE_DIR rather than passing both MMAKE_VARS and MMAKE_RULES.
1995-07-30 16:30:07 +00:00